@wordpress/block-library 8.2.0 → 8.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/babel-plugin.js +1 -1
- package/build/archives/index.js +1 -0
- package/build/archives/index.js.map +1 -1
- package/build/avatar/index.js +1 -0
- package/build/avatar/index.js.map +1 -1
- package/build/block/edit.js +1 -0
- package/build/block/edit.js.map +1 -1
- package/build/button/edit.js +2 -1
- package/build/button/edit.js.map +1 -1
- package/build/button/index.js +1 -0
- package/build/button/index.js.map +1 -1
- package/build/buttons/edit.js +0 -2
- package/build/buttons/edit.js.map +1 -1
- package/build/calendar/index.js +1 -0
- package/build/calendar/index.js.map +1 -1
- package/build/categories/edit.js +3 -3
- package/build/categories/edit.js.map +1 -1
- package/build/categories/index.js +1 -0
- package/build/categories/index.js.map +1 -1
- package/build/column/edit.native.js +2 -1
- package/build/column/edit.native.js.map +1 -1
- package/build/columns/deprecated.js +1 -1
- package/build/columns/deprecated.js.map +1 -1
- package/build/comment-author-avatar/index.js +1 -0
- package/build/comment-author-avatar/index.js.map +1 -1
- package/build/comment-author-name/index.js +1 -0
- package/build/comment-author-name/index.js.map +1 -1
- package/build/comment-content/index.js +1 -0
- package/build/comment-content/index.js.map +1 -1
- package/build/comment-date/index.js +1 -0
- package/build/comment-date/index.js.map +1 -1
- package/build/comment-edit-link/index.js +1 -0
- package/build/comment-edit-link/index.js.map +1 -1
- package/build/comment-reply-link/index.js +1 -0
- package/build/comment-reply-link/index.js.map +1 -1
- package/build/comment-template/index.js +1 -0
- package/build/comment-template/index.js.map +1 -1
- package/build/comments/edit/comments-inspector-controls.js +1 -1
- package/build/comments/edit/comments-inspector-controls.js.map +1 -1
- package/build/comments/index.js +2 -1
- package/build/comments/index.js.map +1 -1
- package/build/comments-pagination/comments-pagination-arrow-controls.js +1 -0
- package/build/comments-pagination/comments-pagination-arrow-controls.js.map +1 -1
- package/build/comments-pagination/edit.js +3 -14
- package/build/comments-pagination/edit.js.map +1 -1
- package/build/comments-pagination/index.js +1 -0
- package/build/comments-pagination/index.js.map +1 -1
- package/build/comments-pagination-next/index.js +1 -0
- package/build/comments-pagination-next/index.js.map +1 -1
- package/build/comments-pagination-numbers/index.js +1 -0
- package/build/comments-pagination-numbers/index.js.map +1 -1
- package/build/comments-pagination-previous/index.js +1 -0
- package/build/comments-pagination-previous/index.js.map +1 -1
- package/build/cover/deprecated.js +153 -30
- package/build/cover/deprecated.js.map +1 -1
- package/build/cover/edit/index.js +4 -3
- package/build/cover/edit/index.js.map +1 -1
- package/build/cover/edit/inspector-controls.js +45 -4
- package/build/cover/edit/inspector-controls.js.map +1 -1
- package/build/cover/edit.native.js +0 -4
- package/build/cover/edit.native.js.map +1 -1
- package/build/cover/index.js +4 -0
- package/build/cover/index.js.map +1 -1
- package/build/cover/save.js +3 -2
- package/build/cover/save.js.map +1 -1
- package/build/embed/variations.js +1 -1
- package/build/embed/variations.js.map +1 -1
- package/build/experiments.js +19 -0
- package/build/experiments.js.map +1 -0
- package/build/gallery/deprecated.js +6 -4
- package/build/gallery/deprecated.js.map +1 -1
- package/build/gallery/edit.js +48 -7
- package/build/gallery/edit.js.map +1 -1
- package/build/gallery/gallery.js +8 -34
- package/build/gallery/gallery.js.map +1 -1
- package/build/gallery/v1/edit.js +5 -5
- package/build/gallery/v1/edit.js.map +1 -1
- package/build/group/deprecated.js +1 -1
- package/build/group/deprecated.js.map +1 -1
- package/build/group/edit.js +1 -2
- package/build/group/edit.js.map +1 -1
- package/build/heading/index.js +1 -7
- package/build/heading/index.js.map +1 -1
- package/build/home-link/index.js +1 -0
- package/build/home-link/index.js.map +1 -1
- package/build/image/edit.native.js +2 -2
- package/build/image/edit.native.js.map +1 -1
- package/build/image/image.js +12 -15
- package/build/image/image.js.map +1 -1
- package/build/latest-comments/index.js +1 -0
- package/build/latest-comments/index.js.map +1 -1
- package/build/latest-posts/deprecated.js +1 -0
- package/build/latest-posts/deprecated.js.map +1 -1
- package/build/latest-posts/index.js +1 -0
- package/build/latest-posts/index.js.map +1 -1
- package/build/list/ordered-list-settings.js +1 -0
- package/build/list/ordered-list-settings.js.map +1 -1
- package/build/loginout/index.js +1 -0
- package/build/loginout/index.js.map +1 -1
- package/build/media-text/edit.js +2 -4
- package/build/media-text/edit.js.map +1 -1
- package/build/missing/edit.native.js +4 -4
- package/build/missing/edit.native.js.map +1 -1
- package/build/navigation/edit/deleted-navigation-warning.js +31 -0
- package/build/navigation/edit/deleted-navigation-warning.js.map +1 -0
- package/build/navigation/edit/index.js +19 -11
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/inner-blocks.js +0 -5
- package/build/navigation/edit/inner-blocks.js.map +1 -1
- package/build/navigation/edit/manage-menus-button.js +9 -2
- package/build/navigation/edit/manage-menus-button.js.map +1 -1
- package/build/navigation/edit/menu-inspector-controls.js +29 -47
- package/build/navigation/edit/menu-inspector-controls.js.map +1 -1
- package/build/navigation/edit/navigation-menu-delete-control.js +0 -1
- package/build/navigation/edit/navigation-menu-delete-control.js.map +1 -1
- package/build/navigation/edit/navigation-menu-name-control.js +1 -0
- package/build/navigation/edit/navigation-menu-name-control.js.map +1 -1
- package/build/navigation/edit/navigation-menu-selector.js +11 -52
- package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build/navigation/edit/overlay-menu-preview.js +1 -0
- package/build/navigation/edit/overlay-menu-preview.js.map +1 -1
- package/build/navigation/edit/placeholder/index.js +1 -6
- package/build/navigation/edit/placeholder/index.js.map +1 -1
- package/build/navigation/index.js +5 -0
- package/build/navigation/index.js.map +1 -1
- package/build/navigation/menu-items-to-blocks.js +0 -2
- package/build/navigation/menu-items-to-blocks.js.map +1 -1
- package/build/navigation-link/edit.js +17 -8
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-submenu/edit.js +4 -0
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/navigation-submenu/index.js +13 -3
- package/build/navigation-submenu/index.js.map +1 -1
- package/build/page-list/edit.js +153 -132
- package/build/page-list/edit.js.map +1 -1
- package/build/page-list/index.js +2 -11
- package/build/page-list/index.js.map +1 -1
- package/build/page-list/{convert-to-navigation-links.js → use-convert-to-navigation-links.js} +41 -9
- package/build/page-list/use-convert-to-navigation-links.js.map +1 -0
- package/build/page-list-item/edit.js +4 -2
- package/build/page-list-item/edit.js.map +1 -1
- package/build/page-list-item/index.js +1 -1
- package/build/page-list-item/index.js.map +1 -1
- package/build/paragraph/edit.js +1 -1
- package/build/paragraph/edit.js.map +1 -1
- package/build/paragraph/index.js +1 -7
- package/build/paragraph/index.js.map +1 -1
- package/build/post-author/index.js +1 -0
- package/build/post-author/index.js.map +1 -1
- package/build/post-author-biography/index.js +1 -0
- package/build/post-author-biography/index.js.map +1 -1
- package/build/post-author-name/index.js +1 -1
- package/build/post-comment/edit.js +1 -0
- package/build/post-comment/edit.js.map +1 -1
- package/build/post-comments-count/index.js +1 -0
- package/build/post-comments-count/index.js.map +1 -1
- package/build/post-comments-form/index.js +1 -0
- package/build/post-comments-form/index.js.map +1 -1
- package/build/post-comments-link/index.js +1 -0
- package/build/post-comments-link/index.js.map +1 -1
- package/build/post-content/edit.js +1 -20
- package/build/post-content/edit.js.map +1 -1
- package/build/post-content/index.js +1 -0
- package/build/post-content/index.js.map +1 -1
- package/build/post-date/index.js +1 -0
- package/build/post-date/index.js.map +1 -1
- package/build/post-excerpt/edit.js +6 -1
- package/build/post-excerpt/edit.js.map +1 -1
- package/build/post-excerpt/index.js +1 -0
- package/build/post-excerpt/index.js.map +1 -1
- package/build/post-featured-image/dimension-controls.js +2 -1
- package/build/post-featured-image/dimension-controls.js.map +1 -1
- package/build/post-featured-image/edit.js +39 -22
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/post-featured-image/index.js +1 -0
- package/build/post-featured-image/index.js.map +1 -1
- package/build/post-featured-image/overlay.js +1 -1
- package/build/post-featured-image/overlay.js.map +1 -1
- package/build/post-navigation-link/edit.js +1 -0
- package/build/post-navigation-link/edit.js.map +1 -1
- package/build/post-navigation-link/index.js +1 -0
- package/build/post-navigation-link/index.js.map +1 -1
- package/build/post-template/edit.js +6 -4
- package/build/post-template/edit.js.map +1 -1
- package/build/post-template/index.js +1 -0
- package/build/post-template/index.js.map +1 -1
- package/build/post-terms/edit.js +5 -4
- package/build/post-terms/edit.js.map +1 -1
- package/build/post-terms/index.js +1 -0
- package/build/post-terms/index.js.map +1 -1
- package/build/post-title/edit.js +1 -0
- package/build/post-title/edit.js.map +1 -1
- package/build/post-title/index.js +1 -0
- package/build/post-title/index.js.map +1 -1
- package/build/query/deprecated.js +90 -1
- package/build/query/deprecated.js.map +1 -1
- package/build/query/edit/index.js +2 -50
- package/build/query/edit/index.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/pattern-selection-modal.js +88 -0
- package/build/query/edit/pattern-selection-modal.js.map +1 -0
- package/build/query/edit/query-content.js +3 -24
- package/build/query/edit/query-content.js.map +1 -1
- package/build/query/edit/query-placeholder.js +2 -2
- package/build/query/edit/query-placeholder.js.map +1 -1
- package/build/query/edit/query-toolbar.js +6 -11
- package/build/query/edit/query-toolbar.js.map +1 -1
- package/build/query/index.js +1 -0
- package/build/query/index.js.map +1 -1
- package/build/query/utils.js +25 -3
- package/build/query/utils.js.map +1 -1
- package/build/query-no-results/index.js +1 -0
- package/build/query-no-results/index.js.map +1 -1
- package/build/query-pagination/edit.js +3 -14
- package/build/query-pagination/edit.js.map +1 -1
- package/build/query-pagination/index.js +1 -0
- package/build/query-pagination/index.js.map +1 -1
- package/build/query-pagination/query-pagination-arrow-controls.js +1 -0
- package/build/query-pagination/query-pagination-arrow-controls.js.map +1 -1
- package/build/query-pagination-next/index.js +1 -0
- package/build/query-pagination-next/index.js.map +1 -1
- package/build/query-pagination-numbers/index.js +1 -0
- package/build/query-pagination-numbers/index.js.map +1 -1
- package/build/query-pagination-previous/index.js +1 -0
- package/build/query-pagination-previous/index.js.map +1 -1
- package/build/query-title/index.js +1 -0
- package/build/query-title/index.js.map +1 -1
- package/build/read-more/index.js +1 -0
- package/build/read-more/index.js.map +1 -1
- package/build/rss/edit.js +5 -2
- package/build/rss/edit.js.map +1 -1
- package/build/rss/index.js +1 -0
- package/build/rss/index.js.map +1 -1
- package/build/search/index.js +1 -0
- package/build/search/index.js.map +1 -1
- package/build/site-logo/edit.js +9 -13
- 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-tagline/index.js +1 -0
- package/build/site-tagline/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/edit.js +3 -1
- package/build/social-link/edit.js.map +1 -1
- package/build/social-link/index.js +1 -0
- package/build/social-link/index.js.map +1 -1
- package/build/social-links/edit.js +3 -14
- package/build/social-links/edit.js.map +1 -1
- package/build/table/edit.js +9 -5
- package/build/table/edit.js.map +1 -1
- package/build/table/index.js +15 -0
- 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 +1 -1
- package/build/table/state.js.map +1 -1
- package/build/table/transforms.js +47 -3
- package/build/table/transforms.js.map +1 -1
- package/build/table/utils.js +26 -0
- package/build/table/utils.js.map +1 -0
- package/build/tag-cloud/edit.js +3 -9
- package/build/tag-cloud/edit.js.map +1 -1
- package/build/tag-cloud/index.js +1 -0
- package/build/tag-cloud/index.js.map +1 -1
- package/build/template-part/edit/advanced-controls.js +2 -1
- package/build/template-part/edit/advanced-controls.js.map +1 -1
- package/build/template-part/edit/index.js +0 -1
- package/build/template-part/edit/index.js.map +1 -1
- package/build/template-part/edit/selection-modal.js +3 -3
- package/build/template-part/edit/selection-modal.js.map +1 -1
- package/build/template-part/edit/title-modal.js +6 -5
- package/build/template-part/edit/title-modal.js.map +1 -1
- package/build/template-part/edit/utils/hooks.js +2 -2
- package/build/template-part/edit/utils/hooks.js.map +1 -1
- package/build/template-part/index.js +1 -0
- package/build/template-part/index.js.map +1 -1
- package/build/term-description/index.js +1 -0
- package/build/term-description/index.js.map +1 -1
- package/build/utils/init-block.js +1 -1
- package/build/utils/init-block.js.map +1 -1
- package/build/utils/init-block.native.js +1 -1
- package/build/utils/init-block.native.js.map +1 -1
- package/build/{template-part/edit/utils/search.js → utils/search-patterns.js} +3 -1
- package/build/utils/search-patterns.js.map +1 -0
- package/build/video/tracks-editor.js +17 -11
- package/build/video/tracks-editor.js.map +1 -1
- package/build-module/archives/index.js +1 -0
- package/build-module/archives/index.js.map +1 -1
- package/build-module/avatar/index.js +1 -0
- package/build-module/avatar/index.js.map +1 -1
- package/build-module/block/edit.js +1 -0
- package/build-module/block/edit.js.map +1 -1
- package/build-module/button/edit.js +2 -1
- package/build-module/button/edit.js.map +1 -1
- package/build-module/button/index.js +1 -0
- package/build-module/button/index.js.map +1 -1
- package/build-module/buttons/edit.js +0 -2
- package/build-module/buttons/edit.js.map +1 -1
- package/build-module/calendar/index.js +1 -0
- package/build-module/calendar/index.js.map +1 -1
- package/build-module/categories/edit.js +2 -2
- package/build-module/categories/edit.js.map +1 -1
- package/build-module/categories/index.js +1 -0
- package/build-module/categories/index.js.map +1 -1
- package/build-module/column/edit.native.js +2 -1
- package/build-module/column/edit.native.js.map +1 -1
- package/build-module/columns/deprecated.js +1 -1
- package/build-module/columns/deprecated.js.map +1 -1
- package/build-module/comment-author-avatar/index.js +1 -0
- package/build-module/comment-author-avatar/index.js.map +1 -1
- package/build-module/comment-author-name/index.js +1 -0
- package/build-module/comment-author-name/index.js.map +1 -1
- package/build-module/comment-content/index.js +1 -0
- package/build-module/comment-content/index.js.map +1 -1
- package/build-module/comment-date/index.js +1 -0
- package/build-module/comment-date/index.js.map +1 -1
- package/build-module/comment-edit-link/index.js +1 -0
- package/build-module/comment-edit-link/index.js.map +1 -1
- package/build-module/comment-reply-link/index.js +1 -0
- package/build-module/comment-reply-link/index.js.map +1 -1
- package/build-module/comment-template/index.js +1 -0
- package/build-module/comment-template/index.js.map +1 -1
- package/build-module/comments/edit/comments-inspector-controls.js +1 -1
- package/build-module/comments/edit/comments-inspector-controls.js.map +1 -1
- package/build-module/comments/index.js +2 -1
- package/build-module/comments/index.js.map +1 -1
- package/build-module/comments-pagination/comments-pagination-arrow-controls.js +1 -0
- package/build-module/comments-pagination/comments-pagination-arrow-controls.js.map +1 -1
- package/build-module/comments-pagination/edit.js +3 -14
- package/build-module/comments-pagination/edit.js.map +1 -1
- package/build-module/comments-pagination/index.js +1 -0
- package/build-module/comments-pagination/index.js.map +1 -1
- package/build-module/comments-pagination-next/index.js +1 -0
- package/build-module/comments-pagination-next/index.js.map +1 -1
- package/build-module/comments-pagination-numbers/index.js +1 -0
- package/build-module/comments-pagination-numbers/index.js.map +1 -1
- package/build-module/comments-pagination-previous/index.js +1 -0
- package/build-module/comments-pagination-previous/index.js.map +1 -1
- package/build-module/cover/deprecated.js +155 -31
- package/build-module/cover/deprecated.js.map +1 -1
- package/build-module/cover/edit/index.js +4 -3
- package/build-module/cover/edit/index.js.map +1 -1
- package/build-module/cover/edit/inspector-controls.js +46 -5
- package/build-module/cover/edit/inspector-controls.js.map +1 -1
- package/build-module/cover/edit.native.js +0 -4
- package/build-module/cover/edit.native.js.map +1 -1
- package/build-module/cover/index.js +4 -0
- package/build-module/cover/index.js.map +1 -1
- package/build-module/cover/save.js +3 -2
- package/build-module/cover/save.js.map +1 -1
- package/build-module/embed/variations.js +1 -1
- package/build-module/embed/variations.js.map +1 -1
- package/build-module/experiments.js +9 -0
- package/build-module/experiments.js.map +1 -0
- package/build-module/gallery/deprecated.js +6 -3
- package/build-module/gallery/deprecated.js.map +1 -1
- package/build-module/gallery/edit.js +50 -10
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/gallery/gallery.js +9 -35
- package/build-module/gallery/gallery.js.map +1 -1
- package/build-module/gallery/v1/edit.js +6 -6
- package/build-module/gallery/v1/edit.js.map +1 -1
- package/build-module/group/deprecated.js +1 -1
- package/build-module/group/deprecated.js.map +1 -1
- package/build-module/group/edit.js +1 -2
- package/build-module/group/edit.js.map +1 -1
- package/build-module/heading/index.js +1 -6
- package/build-module/heading/index.js.map +1 -1
- package/build-module/home-link/index.js +1 -0
- package/build-module/home-link/index.js.map +1 -1
- package/build-module/image/edit.native.js +2 -2
- package/build-module/image/edit.native.js.map +1 -1
- package/build-module/image/image.js +14 -17
- package/build-module/image/image.js.map +1 -1
- package/build-module/latest-comments/index.js +1 -0
- package/build-module/latest-comments/index.js.map +1 -1
- package/build-module/latest-posts/deprecated.js +1 -0
- package/build-module/latest-posts/deprecated.js.map +1 -1
- package/build-module/latest-posts/index.js +1 -0
- package/build-module/latest-posts/index.js.map +1 -1
- package/build-module/list/ordered-list-settings.js +1 -0
- package/build-module/list/ordered-list-settings.js.map +1 -1
- package/build-module/loginout/index.js +1 -0
- package/build-module/loginout/index.js.map +1 -1
- package/build-module/media-text/edit.js +2 -3
- package/build-module/media-text/edit.js.map +1 -1
- package/build-module/missing/edit.native.js +4 -4
- package/build-module/missing/edit.native.js.map +1 -1
- package/build-module/navigation/edit/deleted-navigation-warning.js +21 -0
- package/build-module/navigation/edit/deleted-navigation-warning.js.map +1 -0
- package/build-module/navigation/edit/index.js +18 -11
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/inner-blocks.js +0 -5
- package/build-module/navigation/edit/inner-blocks.js.map +1 -1
- package/build-module/navigation/edit/manage-menus-button.js +10 -3
- package/build-module/navigation/edit/manage-menus-button.js.map +1 -1
- package/build-module/navigation/edit/menu-inspector-controls.js +28 -47
- package/build-module/navigation/edit/menu-inspector-controls.js.map +1 -1
- package/build-module/navigation/edit/navigation-menu-delete-control.js +0 -1
- package/build-module/navigation/edit/navigation-menu-delete-control.js.map +1 -1
- package/build-module/navigation/edit/navigation-menu-name-control.js +1 -0
- package/build-module/navigation/edit/navigation-menu-name-control.js.map +1 -1
- package/build-module/navigation/edit/navigation-menu-selector.js +13 -54
- package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build-module/navigation/edit/overlay-menu-preview.js +1 -0
- package/build-module/navigation/edit/overlay-menu-preview.js.map +1 -1
- package/build-module/navigation/edit/placeholder/index.js +1 -6
- package/build-module/navigation/edit/placeholder/index.js.map +1 -1
- package/build-module/navigation/index.js +5 -0
- package/build-module/navigation/index.js.map +1 -1
- package/build-module/navigation/menu-items-to-blocks.js +0 -2
- package/build-module/navigation/menu-items-to-blocks.js.map +1 -1
- package/build-module/navigation-link/edit.js +16 -7
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +4 -0
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/navigation-submenu/index.js +14 -4
- package/build-module/navigation-submenu/index.js.map +1 -1
- package/build-module/page-list/edit.js +155 -132
- package/build-module/page-list/edit.js.map +1 -1
- package/build-module/page-list/index.js +3 -12
- package/build-module/page-list/index.js.map +1 -1
- package/build-module/page-list/{convert-to-navigation-links.js → use-convert-to-navigation-links.js} +37 -7
- package/build-module/page-list/use-convert-to-navigation-links.js.map +1 -0
- package/build-module/page-list-item/edit.js +3 -2
- package/build-module/page-list-item/edit.js.map +1 -1
- package/build-module/page-list-item/index.js +1 -1
- package/build-module/page-list-item/index.js.map +1 -1
- package/build-module/paragraph/edit.js +1 -1
- package/build-module/paragraph/edit.js.map +1 -1
- package/build-module/paragraph/index.js +1 -6
- package/build-module/paragraph/index.js.map +1 -1
- package/build-module/post-author/index.js +1 -0
- package/build-module/post-author/index.js.map +1 -1
- package/build-module/post-author-biography/index.js +1 -0
- package/build-module/post-author-biography/index.js.map +1 -1
- package/build-module/post-author-name/index.js +1 -1
- package/build-module/post-comment/edit.js +1 -0
- package/build-module/post-comment/edit.js.map +1 -1
- package/build-module/post-comments-count/index.js +1 -0
- package/build-module/post-comments-count/index.js.map +1 -1
- package/build-module/post-comments-form/index.js +1 -0
- package/build-module/post-comments-form/index.js.map +1 -1
- package/build-module/post-comments-link/index.js +1 -0
- package/build-module/post-comments-link/index.js.map +1 -1
- package/build-module/post-content/edit.js +2 -20
- package/build-module/post-content/edit.js.map +1 -1
- package/build-module/post-content/index.js +1 -0
- package/build-module/post-content/index.js.map +1 -1
- package/build-module/post-date/index.js +1 -0
- package/build-module/post-date/index.js.map +1 -1
- package/build-module/post-excerpt/edit.js +6 -1
- package/build-module/post-excerpt/edit.js.map +1 -1
- package/build-module/post-excerpt/index.js +1 -0
- package/build-module/post-excerpt/index.js.map +1 -1
- package/build-module/post-featured-image/dimension-controls.js +2 -1
- package/build-module/post-featured-image/dimension-controls.js.map +1 -1
- package/build-module/post-featured-image/edit.js +39 -22
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/post-featured-image/index.js +1 -0
- package/build-module/post-featured-image/index.js.map +1 -1
- package/build-module/post-featured-image/overlay.js +1 -1
- package/build-module/post-featured-image/overlay.js.map +1 -1
- package/build-module/post-navigation-link/edit.js +1 -0
- package/build-module/post-navigation-link/edit.js.map +1 -1
- package/build-module/post-navigation-link/index.js +1 -0
- package/build-module/post-navigation-link/index.js.map +1 -1
- package/build-module/post-template/edit.js +6 -4
- package/build-module/post-template/edit.js.map +1 -1
- package/build-module/post-template/index.js +1 -0
- package/build-module/post-template/index.js.map +1 -1
- package/build-module/post-terms/edit.js +4 -3
- package/build-module/post-terms/edit.js.map +1 -1
- package/build-module/post-terms/index.js +1 -0
- package/build-module/post-terms/index.js.map +1 -1
- package/build-module/post-title/edit.js +1 -0
- package/build-module/post-title/edit.js.map +1 -1
- package/build-module/post-title/index.js +1 -0
- package/build-module/post-title/index.js.map +1 -1
- package/build-module/query/deprecated.js +87 -1
- package/build-module/query/deprecated.js.map +1 -1
- package/build-module/query/edit/index.js +4 -50
- package/build-module/query/edit/index.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/pattern-selection-modal.js +75 -0
- package/build-module/query/edit/pattern-selection-modal.js.map +1 -0
- package/build-module/query/edit/query-content.js +4 -25
- package/build-module/query/edit/query-content.js.map +1 -1
- package/build-module/query/edit/query-placeholder.js +2 -2
- package/build-module/query/edit/query-placeholder.js.map +1 -1
- package/build-module/query/edit/query-toolbar.js +6 -10
- package/build-module/query/edit/query-toolbar.js.map +1 -1
- package/build-module/query/index.js +1 -0
- package/build-module/query/index.js.map +1 -1
- package/build-module/query/utils.js +21 -2
- package/build-module/query/utils.js.map +1 -1
- package/build-module/query-no-results/index.js +1 -0
- package/build-module/query-no-results/index.js.map +1 -1
- package/build-module/query-pagination/edit.js +3 -14
- package/build-module/query-pagination/edit.js.map +1 -1
- package/build-module/query-pagination/index.js +1 -0
- package/build-module/query-pagination/index.js.map +1 -1
- package/build-module/query-pagination/query-pagination-arrow-controls.js +1 -0
- package/build-module/query-pagination/query-pagination-arrow-controls.js.map +1 -1
- package/build-module/query-pagination-next/index.js +1 -0
- package/build-module/query-pagination-next/index.js.map +1 -1
- package/build-module/query-pagination-numbers/index.js +1 -0
- package/build-module/query-pagination-numbers/index.js.map +1 -1
- package/build-module/query-pagination-previous/index.js +1 -0
- package/build-module/query-pagination-previous/index.js.map +1 -1
- package/build-module/query-title/index.js +1 -0
- package/build-module/query-title/index.js.map +1 -1
- package/build-module/read-more/index.js +1 -0
- package/build-module/read-more/index.js.map +1 -1
- package/build-module/rss/edit.js +6 -3
- package/build-module/rss/edit.js.map +1 -1
- package/build-module/rss/index.js +1 -0
- package/build-module/rss/index.js.map +1 -1
- package/build-module/search/index.js +1 -0
- package/build-module/search/index.js.map +1 -1
- package/build-module/site-logo/edit.js +10 -14
- 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-tagline/index.js +1 -0
- package/build-module/site-tagline/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/edit.js +3 -1
- package/build-module/social-link/edit.js.map +1 -1
- package/build-module/social-link/index.js +1 -0
- package/build-module/social-link/index.js.map +1 -1
- package/build-module/social-links/edit.js +3 -14
- package/build-module/social-links/edit.js.map +1 -1
- package/build-module/table/edit.js +9 -5
- package/build-module/table/edit.js.map +1 -1
- package/build-module/table/index.js +15 -0
- 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 +1 -1
- package/build-module/table/state.js.map +1 -1
- package/build-module/table/transforms.js +46 -3
- package/build-module/table/transforms.js.map +1 -1
- package/build-module/table/utils.js +19 -0
- package/build-module/table/utils.js.map +1 -0
- package/build-module/tag-cloud/edit.js +4 -9
- package/build-module/tag-cloud/edit.js.map +1 -1
- package/build-module/tag-cloud/index.js +1 -0
- package/build-module/tag-cloud/index.js.map +1 -1
- package/build-module/template-part/edit/advanced-controls.js +2 -1
- package/build-module/template-part/edit/advanced-controls.js.map +1 -1
- package/build-module/template-part/edit/index.js +0 -1
- package/build-module/template-part/edit/index.js.map +1 -1
- package/build-module/template-part/edit/selection-modal.js +1 -1
- package/build-module/template-part/edit/selection-modal.js.map +1 -1
- package/build-module/template-part/edit/title-modal.js +7 -6
- package/build-module/template-part/edit/title-modal.js.map +1 -1
- package/build-module/template-part/edit/utils/hooks.js +2 -2
- package/build-module/template-part/edit/utils/hooks.js.map +1 -1
- package/build-module/template-part/index.js +1 -0
- package/build-module/template-part/index.js.map +1 -1
- package/build-module/term-description/index.js +1 -0
- package/build-module/term-description/index.js.map +1 -1
- package/build-module/utils/init-block.js +1 -1
- package/build-module/utils/init-block.js.map +1 -1
- package/build-module/utils/init-block.native.js +1 -1
- package/build-module/utils/init-block.native.js.map +1 -1
- package/build-module/{template-part/edit/utils/search.js → utils/search-patterns.js} +3 -5
- package/build-module/utils/search-patterns.js.map +1 -0
- package/build-module/video/tracks-editor.js +18 -12
- package/build-module/video/tracks-editor.js.map +1 -1
- package/build-style/editor-rtl.css +14 -67
- package/build-style/editor.css +14 -67
- package/build-style/query/editor-rtl.css +11 -14
- package/build-style/query/editor.css +11 -14
- package/build-style/rss/editor-rtl.css +3 -16
- package/build-style/rss/editor.css +3 -16
- package/build-style/table/editor-rtl.css +0 -3
- package/build-style/table/editor.css +0 -3
- package/build-style/video/editor-rtl.css +0 -34
- package/build-style/video/editor.css +0 -34
- package/package.json +30 -29
- package/src/archives/block.json +1 -0
- package/src/avatar/block.json +1 -0
- package/src/block/edit.js +1 -0
- package/src/button/block.json +1 -0
- package/src/button/edit.js +2 -1
- package/src/buttons/edit.js +2 -2
- package/src/calendar/block.json +1 -0
- package/src/calendar/index.php +3 -1
- package/src/categories/block.json +1 -0
- package/src/categories/edit.js +2 -2
- package/src/column/edit.native.js +6 -1
- package/src/columns/deprecated.js +1 -1
- package/src/comment-author-avatar/block.json +1 -0
- package/src/comment-author-name/block.json +1 -0
- package/src/comment-author-name/index.php +6 -3
- package/src/comment-content/block.json +1 -0
- package/src/comment-content/index.php +6 -3
- package/src/comment-date/block.json +1 -0
- package/src/comment-date/index.php +1 -1
- package/src/comment-edit-link/block.json +1 -0
- package/src/comment-edit-link/index.php +6 -3
- package/src/comment-reply-link/block.json +1 -0
- package/src/comment-reply-link/index.php +6 -3
- package/src/comment-template/block.json +1 -0
- package/src/comments/block.json +2 -1
- package/src/comments/edit/comments-inspector-controls.js +1 -1
- package/src/comments-pagination/block.json +1 -0
- package/src/comments-pagination/comments-pagination-arrow-controls.js +1 -0
- package/src/comments-pagination/edit.js +1 -13
- package/src/comments-pagination/index.php +4 -1
- package/src/comments-pagination-next/block.json +1 -0
- package/src/comments-pagination-numbers/block.json +1 -0
- package/src/comments-pagination-previous/block.json +1 -0
- package/src/cover/block.json +4 -0
- package/src/cover/deprecated.js +173 -6
- package/src/cover/edit/index.js +5 -4
- package/src/cover/edit/inspector-controls.js +45 -2
- package/src/cover/edit.native.js +0 -3
- package/src/cover/save.js +3 -2
- package/src/embed/variations.js +1 -1
- package/src/experiments.js +10 -0
- package/src/gallery/deprecated.js +2 -3
- package/src/gallery/edit.js +66 -5
- package/src/gallery/gallery.js +27 -44
- package/src/gallery/v1/edit.js +8 -9
- package/src/group/deprecated.js +3 -1
- package/src/group/edit.js +1 -2
- package/src/heading/index.js +1 -6
- package/src/home-link/block.json +1 -0
- package/src/image/edit.native.js +2 -3
- package/src/image/image.js +17 -22
- package/src/latest-comments/block.json +1 -0
- package/src/latest-posts/block.json +1 -0
- package/src/latest-posts/index.php +9 -10
- package/src/list/ordered-list-settings.js +1 -0
- package/src/loginout/block.json +1 -0
- package/src/media-text/edit.js +3 -7
- package/src/missing/edit.native.js +3 -4
- package/src/missing/test/edit.native.js +2 -2
- package/src/navigation/block.json +2 -0
- package/src/navigation/edit/deleted-navigation-warning.js +19 -0
- package/src/navigation/edit/index.js +22 -24
- package/src/navigation/edit/inner-blocks.js +0 -6
- package/src/navigation/edit/manage-menus-button.js +24 -13
- package/src/navigation/edit/menu-inspector-controls.js +38 -73
- package/src/navigation/edit/navigation-menu-delete-control.js +0 -1
- package/src/navigation/edit/navigation-menu-name-control.js +1 -0
- package/src/navigation/edit/navigation-menu-selector.js +12 -77
- package/src/navigation/edit/overlay-menu-preview.js +1 -0
- package/src/navigation/edit/placeholder/index.js +0 -6
- package/src/navigation/index.js +3 -0
- package/src/navigation/index.php +25 -7
- package/src/navigation/menu-items-to-blocks.js +0 -2
- package/src/navigation-link/edit.js +16 -7
- package/src/navigation-link/index.php +0 -32
- package/src/navigation-submenu/edit.js +4 -0
- package/src/navigation-submenu/index.js +8 -2
- package/src/navigation-submenu/index.php +0 -32
- package/src/page-list/block.json +1 -0
- package/src/page-list/edit.js +196 -161
- package/src/page-list/index.js +2 -8
- package/src/page-list/test/convert-to-links-modal.js +1 -1
- package/src/page-list/{convert-to-navigation-links.js → use-convert-to-navigation-links.js} +36 -6
- package/src/page-list-item/edit.js +3 -2
- package/src/page-list-item/index.js +1 -1
- package/src/paragraph/edit.js +1 -1
- package/src/paragraph/index.js +1 -6
- package/src/post-author/block.json +1 -0
- package/src/post-author/index.php +10 -4
- package/src/post-author-biography/block.json +1 -0
- package/src/post-author-name/block.json +1 -1
- package/src/post-author-name/index.php +9 -4
- package/src/post-comment/edit.js +1 -0
- package/src/post-comments-count/block.json +1 -0
- package/src/post-comments-form/block.json +1 -0
- package/src/post-comments-form/index.php +6 -4
- package/src/post-comments-link/block.json +1 -0
- package/src/post-comments-link/index.php +8 -2
- package/src/post-content/block.json +1 -0
- package/src/post-content/edit.js +2 -13
- package/src/post-date/block.json +1 -0
- package/src/post-date/index.php +10 -3
- package/src/post-excerpt/block.json +1 -0
- package/src/post-excerpt/edit.js +22 -12
- package/src/post-excerpt/index.php +6 -3
- package/src/post-featured-image/block.json +1 -0
- package/src/post-featured-image/dimension-controls.js +2 -1
- package/src/post-featured-image/edit.js +46 -27
- package/src/post-featured-image/index.php +19 -6
- package/src/post-featured-image/overlay.js +1 -1
- package/src/post-navigation-link/block.json +1 -0
- package/src/post-navigation-link/edit.js +1 -0
- package/src/post-template/block.json +1 -0
- package/src/post-template/edit.js +4 -3
- package/src/post-template/index.php +4 -1
- package/src/post-terms/block.json +1 -0
- package/src/post-terms/edit.js +4 -3
- package/src/post-terms/index.php +6 -3
- package/src/post-title/block.json +1 -0
- package/src/post-title/edit.js +1 -0
- package/src/post-title/index.php +10 -4
- package/src/preformatted/test/__snapshots__/edit.native.js.snap +0 -2
- package/src/query/block.json +1 -0
- package/src/query/deprecated.js +77 -1
- package/src/query/edit/index.js +4 -60
- package/src/query/edit/inspector-controls/index.js +1 -0
- package/src/query/edit/pattern-selection-modal.js +86 -0
- package/src/query/edit/query-content.js +1 -12
- package/src/query/edit/query-placeholder.js +4 -8
- package/src/query/edit/query-toolbar.js +6 -16
- package/src/query/editor.scss +21 -19
- package/src/query/utils.js +22 -8
- package/src/query-no-results/block.json +1 -0
- package/src/query-no-results/index.php +3 -1
- package/src/query-pagination/block.json +1 -0
- package/src/query-pagination/edit.js +1 -13
- package/src/query-pagination/index.php +2 -0
- package/src/query-pagination/query-pagination-arrow-controls.js +1 -0
- package/src/query-pagination-next/block.json +1 -0
- package/src/query-pagination-numbers/block.json +1 -0
- package/src/query-pagination-previous/block.json +1 -0
- package/src/query-title/block.json +1 -0
- package/src/read-more/block.json +1 -0
- package/src/rss/block.json +1 -0
- package/src/rss/edit.js +16 -12
- package/src/rss/editor.scss +4 -15
- package/src/search/block.json +1 -0
- package/src/search/index.php +2 -2
- package/src/site-logo/block.json +1 -0
- package/src/site-logo/edit.js +9 -16
- package/src/site-tagline/block.json +1 -0
- package/src/site-title/block.json +1 -0
- package/src/site-title/index.php +6 -3
- package/src/social-link/block.json +1 -0
- package/src/social-link/edit.js +3 -1
- package/src/social-links/edit.js +1 -14
- package/src/table/block.json +15 -0
- package/src/table/edit.js +38 -26
- package/src/table/editor.scss +0 -6
- package/src/table/save.js +9 -1
- package/src/table/state.js +1 -1
- package/src/table/test/utils.js +20 -0
- package/src/table/transforms.js +65 -2
- package/src/table/utils.js +18 -0
- package/src/tag-cloud/block.json +1 -0
- package/src/tag-cloud/edit.js +12 -15
- package/src/template-part/block.json +1 -0
- package/src/template-part/edit/advanced-controls.js +2 -1
- package/src/template-part/edit/index.js +0 -1
- package/src/template-part/edit/selection-modal.js +1 -1
- package/src/template-part/edit/title-modal.js +12 -15
- package/src/template-part/edit/utils/hooks.js +3 -8
- package/src/template-part/index.php +19 -7
- package/src/term-description/block.json +1 -0
- package/src/term-description/index.php +8 -4
- package/src/utils/init-block.js +1 -1
- package/src/utils/init-block.native.js +1 -1
- package/src/{template-part/edit/utils/search.js → utils/search-patterns.js} +2 -2
- package/src/utils/test/search-patterns.js +58 -0
- package/src/video/editor.scss +0 -35
- package/src/video/tracks-editor.js +65 -51
- package/tsconfig.tsbuildinfo +1 -1
- package/build/page-list/constants.js +0 -15
- package/build/page-list/constants.js.map +0 -1
- package/build/page-list/convert-to-links-modal.js +0 -83
- package/build/page-list/convert-to-links-modal.js.map +0 -1
- package/build/page-list/convert-to-navigation-links.js.map +0 -1
- package/build/template-part/edit/utils/search.js.map +0 -1
- package/build-module/page-list/constants.js +0 -6
- package/build-module/page-list/constants.js.map +0 -1
- package/build-module/page-list/convert-to-links-modal.js +0 -68
- package/build-module/page-list/convert-to-links-modal.js.map +0 -1
- package/build-module/page-list/convert-to-navigation-links.js.map +0 -1
- package/build-module/template-part/edit/utils/search.js.map +0 -1
- package/src/page-list/constants.js +0 -8
- package/src/page-list/convert-to-links-modal.js +0 -70
|
@@ -5,10 +5,10 @@ import { useState } from '@wordpress/element';
|
|
|
5
5
|
import { __, sprintf } from '@wordpress/i18n';
|
|
6
6
|
import {
|
|
7
7
|
TextControl,
|
|
8
|
-
Flex,
|
|
9
|
-
FlexItem,
|
|
10
8
|
Button,
|
|
11
9
|
Modal,
|
|
10
|
+
__experimentalHStack as HStack,
|
|
11
|
+
__experimentalVStack as VStack,
|
|
12
12
|
} from '@wordpress/components';
|
|
13
13
|
|
|
14
14
|
export default function TitleModal( { areaLabel, onClose, onSubmit } ) {
|
|
@@ -28,21 +28,18 @@ export default function TitleModal( { areaLabel, onClose, onSubmit } ) {
|
|
|
28
28
|
__( 'Name and create your new %s' ),
|
|
29
29
|
areaLabel.toLowerCase()
|
|
30
30
|
) }
|
|
31
|
-
closeLabel={ __( 'Cancel' ) }
|
|
32
31
|
overlayClassName="wp-block-template-part__placeholder-create-new__title-form"
|
|
33
32
|
onRequestClose={ onClose }
|
|
34
33
|
>
|
|
35
34
|
<form onSubmit={ submitForCreation }>
|
|
36
|
-
<
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
justify="
|
|
44
|
-
>
|
|
45
|
-
<FlexItem>
|
|
35
|
+
<VStack spacing="5">
|
|
36
|
+
<TextControl
|
|
37
|
+
__nextHasNoMarginBottom
|
|
38
|
+
label={ __( 'Name' ) }
|
|
39
|
+
value={ title }
|
|
40
|
+
onChange={ setTitle }
|
|
41
|
+
/>
|
|
42
|
+
<HStack justify="right">
|
|
46
43
|
<Button
|
|
47
44
|
variant="primary"
|
|
48
45
|
type="submit"
|
|
@@ -51,8 +48,8 @@ export default function TitleModal( { areaLabel, onClose, onSubmit } ) {
|
|
|
51
48
|
>
|
|
52
49
|
{ __( 'Create' ) }
|
|
53
50
|
</Button>
|
|
54
|
-
</
|
|
55
|
-
</
|
|
51
|
+
</HStack>
|
|
52
|
+
</VStack>
|
|
56
53
|
</form>
|
|
57
54
|
</Modal>
|
|
58
55
|
);
|
|
@@ -83,15 +83,10 @@ export function useAlternativeBlockPatterns( area, clientId ) {
|
|
|
83
83
|
const blockNameWithArea = area
|
|
84
84
|
? `core/template-part/${ area }`
|
|
85
85
|
: 'core/template-part';
|
|
86
|
-
const {
|
|
87
|
-
|
|
88
|
-
__experimentalGetPatternsByBlockTypes,
|
|
89
|
-
} = select( blockEditorStore );
|
|
86
|
+
const { getBlockRootClientId, getPatternsByBlockTypes } =
|
|
87
|
+
select( blockEditorStore );
|
|
90
88
|
const rootClientId = getBlockRootClientId( clientId );
|
|
91
|
-
return
|
|
92
|
-
blockNameWithArea,
|
|
93
|
-
rootClientId
|
|
94
|
-
);
|
|
89
|
+
return getPatternsByBlockTypes( blockNameWithArea, rootClientId );
|
|
95
90
|
},
|
|
96
91
|
[ area, clientId ]
|
|
97
92
|
);
|
|
@@ -126,6 +126,21 @@ function render_block_core_template_part( $attributes ) {
|
|
|
126
126
|
'';
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
+
// Look up area definition.
|
|
130
|
+
$area_definition = null;
|
|
131
|
+
$defined_areas = get_allowed_block_template_part_areas();
|
|
132
|
+
foreach ( $defined_areas as $defined_area ) {
|
|
133
|
+
if ( $defined_area['area'] === $area ) {
|
|
134
|
+
$area_definition = $defined_area;
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// If $area is not allowed, set it back to the uncategorized default.
|
|
140
|
+
if ( ! $area_definition ) {
|
|
141
|
+
$area = WP_TEMPLATE_PART_AREA_UNCATEGORIZED;
|
|
142
|
+
}
|
|
143
|
+
|
|
129
144
|
// Run through the actions that are typically taken on the_content.
|
|
130
145
|
$seen_ids[ $template_part_id ] = true;
|
|
131
146
|
$content = do_blocks( $content );
|
|
@@ -133,7 +148,7 @@ function render_block_core_template_part( $attributes ) {
|
|
|
133
148
|
$content = wptexturize( $content );
|
|
134
149
|
$content = convert_smilies( $content );
|
|
135
150
|
$content = shortcode_unautop( $content );
|
|
136
|
-
$content = wp_filter_content_tags( $content );
|
|
151
|
+
$content = wp_filter_content_tags( $content, "template_part_{$area}" );
|
|
137
152
|
$content = do_shortcode( $content );
|
|
138
153
|
|
|
139
154
|
// Handle embeds for block template parts.
|
|
@@ -141,12 +156,9 @@ function render_block_core_template_part( $attributes ) {
|
|
|
141
156
|
$content = $wp_embed->autoembed( $content );
|
|
142
157
|
|
|
143
158
|
if ( empty( $attributes['tagName'] ) ) {
|
|
144
|
-
$
|
|
145
|
-
$
|
|
146
|
-
|
|
147
|
-
if ( $defined_area['area'] === $area && isset( $defined_area['area_tag'] ) ) {
|
|
148
|
-
$area_tag = $defined_area['area_tag'];
|
|
149
|
-
}
|
|
159
|
+
$area_tag = 'div';
|
|
160
|
+
if ( $area_definition && isset( $area_definition['area_tag'] ) ) {
|
|
161
|
+
$area_tag = $area_definition['area_tag'];
|
|
150
162
|
}
|
|
151
163
|
$html_tag = $area_tag;
|
|
152
164
|
} else {
|
|
@@ -23,10 +23,14 @@ function render_block_core_term_description( $attributes ) {
|
|
|
23
23
|
return '';
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
$
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
$classes = array();
|
|
27
|
+
if ( isset( $attributes['textAlign'] ) ) {
|
|
28
|
+
$classes[] = 'has-text-align-' . $attributes['textAlign'];
|
|
29
|
+
}
|
|
30
|
+
if ( isset( $attributes['style']['elements']['link']['color']['text'] ) ) {
|
|
31
|
+
$classes[] = 'has-link-color';
|
|
32
|
+
}
|
|
33
|
+
$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => implode( ' ', $classes ) ) );
|
|
30
34
|
|
|
31
35
|
return '<div ' . $wrapper_attributes . '>' . $term_description . '</div>';
|
|
32
36
|
}
|
package/src/utils/init-block.js
CHANGED
|
@@ -8,7 +8,7 @@ import { registerBlockType } from '@wordpress/blocks';
|
|
|
8
8
|
*
|
|
9
9
|
* @param {Object} block The block to be registered.
|
|
10
10
|
*
|
|
11
|
-
* @return {
|
|
11
|
+
* @return {WPBlockType | undefined} The block, if it has been successfully registered;
|
|
12
12
|
* otherwise `undefined`.
|
|
13
13
|
*/
|
|
14
14
|
export default function initBlock( block ) {
|
|
@@ -10,7 +10,7 @@ const ALLOWED_BLOCKS_GRADIENT_SUPPORT = [ 'core/button' ];
|
|
|
10
10
|
*
|
|
11
11
|
* @param {Object} block The block to be registered.
|
|
12
12
|
*
|
|
13
|
-
* @return {
|
|
13
|
+
* @return {WPBlockType | undefined} The block, if it has been successfully registered;
|
|
14
14
|
* otherwise `undefined`.
|
|
15
15
|
*/
|
|
16
16
|
export default function initBlock( block ) {
|
|
@@ -10,7 +10,7 @@ import removeAccents from 'remove-accents';
|
|
|
10
10
|
*
|
|
11
11
|
* @return {string} The normalized search input.
|
|
12
12
|
*/
|
|
13
|
-
function normalizeSearchInput( input = '' ) {
|
|
13
|
+
export function normalizeSearchInput( input = '' ) {
|
|
14
14
|
// Disregard diacritics.
|
|
15
15
|
input = removeAccents( input );
|
|
16
16
|
|
|
@@ -27,7 +27,7 @@ function normalizeSearchInput( input = '' ) {
|
|
|
27
27
|
* @param {string} searchValue Search term
|
|
28
28
|
* @return {number} A pattern search rank
|
|
29
29
|
*/
|
|
30
|
-
function getPatternSearchRank( pattern, searchValue ) {
|
|
30
|
+
export function getPatternSearchRank( pattern, searchValue ) {
|
|
31
31
|
const normalizedSearchValue = normalizeSearchInput( searchValue );
|
|
32
32
|
const normalizedTitle = normalizeSearchInput( pattern.title );
|
|
33
33
|
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import {
|
|
5
|
+
normalizeSearchInput,
|
|
6
|
+
getPatternSearchRank,
|
|
7
|
+
searchPatterns,
|
|
8
|
+
} from '../search-patterns';
|
|
9
|
+
|
|
10
|
+
describe( 'normalizeSearchInput', () => {
|
|
11
|
+
it( 'should remove accents', () => {
|
|
12
|
+
expect( normalizeSearchInput( 'café' ) ).toBe( 'cafe' );
|
|
13
|
+
} );
|
|
14
|
+
|
|
15
|
+
it( 'should trim and lowercase', () => {
|
|
16
|
+
expect( normalizeSearchInput( ' Foo ' ) ).toBe( 'foo' );
|
|
17
|
+
} );
|
|
18
|
+
} );
|
|
19
|
+
|
|
20
|
+
describe( 'getPatternSearchRank', () => {
|
|
21
|
+
it( 'should give a high rank to exact matches', () => {
|
|
22
|
+
const pattern = { title: 'Foo' };
|
|
23
|
+
expect( getPatternSearchRank( pattern, 'Foo' ) ).toBe( 30 );
|
|
24
|
+
} );
|
|
25
|
+
|
|
26
|
+
it( 'should give a high rank to prefix matches', () => {
|
|
27
|
+
const pattern = { title: 'Foo' };
|
|
28
|
+
expect( getPatternSearchRank( pattern, 'Fo' ) ).toBe( 20 );
|
|
29
|
+
} );
|
|
30
|
+
|
|
31
|
+
it( 'should give a low rank to no matches', () => {
|
|
32
|
+
const pattern = { title: 'Foo' };
|
|
33
|
+
expect( getPatternSearchRank( pattern, 'Bar' ) ).toBe( 0 );
|
|
34
|
+
} );
|
|
35
|
+
} );
|
|
36
|
+
|
|
37
|
+
describe( 'searchPatterns', () => {
|
|
38
|
+
it( 'should return all patterns if no search term is provided', () => {
|
|
39
|
+
const patterns = [ { title: 'Foo' }, { title: 'Bar' } ];
|
|
40
|
+
expect( searchPatterns( patterns, '' ) ).toEqual( patterns );
|
|
41
|
+
} );
|
|
42
|
+
|
|
43
|
+
it( 'should return an empty array if no patterns are provided', () => {
|
|
44
|
+
expect( searchPatterns( [], 'Foo' ) ).toEqual( [] );
|
|
45
|
+
} );
|
|
46
|
+
|
|
47
|
+
it( 'should return an empty array if no patterns match', () => {
|
|
48
|
+
const patterns = [ { title: 'Foo' }, { title: 'Bar' } ];
|
|
49
|
+
expect( searchPatterns( patterns, 'Baz' ) ).toEqual( [] );
|
|
50
|
+
} );
|
|
51
|
+
|
|
52
|
+
it( 'should return the matching patterns', () => {
|
|
53
|
+
const patterns = [ { title: 'Foo' }, { title: 'Bar' } ];
|
|
54
|
+
expect( searchPatterns( patterns, 'Foo' ) ).toEqual( [
|
|
55
|
+
patterns[ 0 ],
|
|
56
|
+
] );
|
|
57
|
+
} );
|
|
58
|
+
} );
|
package/src/video/editor.scss
CHANGED
|
@@ -71,36 +71,15 @@
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
.block-library-video-tracks-editor__track-list-track {
|
|
74
|
-
display: flex;
|
|
75
|
-
place-content: space-between;
|
|
76
|
-
align-items: baseline;
|
|
77
74
|
padding-left: $grid-unit-15;
|
|
78
75
|
}
|
|
79
76
|
|
|
80
|
-
.block-library-video-tracks-editor__single-track-editor-label-language {
|
|
81
|
-
display: flex;
|
|
82
|
-
margin-top: $grid-unit-15;
|
|
83
|
-
& > .components-base-control {
|
|
84
|
-
width: 50%;
|
|
85
|
-
}
|
|
86
|
-
& > .components-base-control:first-child {
|
|
87
|
-
margin-right: $grid-unit-20;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
77
|
.block-library-video-tracks-editor__single-track-editor-kind-select {
|
|
92
78
|
max-width: 240px;
|
|
93
79
|
}
|
|
94
80
|
|
|
95
|
-
.block-library-video-tracks-editor__single-track-editor-buttons-container {
|
|
96
|
-
display: flex;
|
|
97
|
-
place-content: space-between;
|
|
98
|
-
margin-top: $grid-unit-40;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
81
|
.block-library-video-tracks-editor__single-track-editor-edit-track-label {
|
|
102
82
|
margin-top: $grid-unit-05;
|
|
103
|
-
margin-bottom: $grid-unit-15;
|
|
104
83
|
color: $gray-700;
|
|
105
84
|
text-transform: uppercase;
|
|
106
85
|
font-size: 11px;
|
|
@@ -126,17 +105,3 @@
|
|
|
126
105
|
padding: $grid-unit-15;
|
|
127
106
|
}
|
|
128
107
|
|
|
129
|
-
.block-library-video-tracks-editor__single-track-editor .components-base-control {
|
|
130
|
-
.components-base-control__label {
|
|
131
|
-
margin-bottom: $grid-unit-05;
|
|
132
|
-
}
|
|
133
|
-
.components-base-control__field {
|
|
134
|
-
margin-bottom: $grid-unit-15;
|
|
135
|
-
}
|
|
136
|
-
.components-text-control__input {
|
|
137
|
-
margin-left: 0;
|
|
138
|
-
}
|
|
139
|
-
.components-input-control__label {
|
|
140
|
-
margin-bottom: $grid-unit-05;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
@@ -13,6 +13,9 @@ import {
|
|
|
13
13
|
Button,
|
|
14
14
|
TextControl,
|
|
15
15
|
SelectControl,
|
|
16
|
+
__experimentalGrid as Grid,
|
|
17
|
+
__experimentalHStack as HStack,
|
|
18
|
+
__experimentalVStack as VStack,
|
|
16
19
|
} from '@wordpress/components';
|
|
17
20
|
import {
|
|
18
21
|
MediaUpload,
|
|
@@ -49,7 +52,7 @@ function TrackList( { tracks, onEditPress } ) {
|
|
|
49
52
|
} else {
|
|
50
53
|
content = tracks.map( ( track, index ) => {
|
|
51
54
|
return (
|
|
52
|
-
<
|
|
55
|
+
<HStack
|
|
53
56
|
key={ index }
|
|
54
57
|
className="block-library-video-tracks-editor__track-list-track"
|
|
55
58
|
>
|
|
@@ -65,7 +68,7 @@ function TrackList( { tracks, onEditPress } ) {
|
|
|
65
68
|
>
|
|
66
69
|
{ __( 'Edit' ) }
|
|
67
70
|
</Button>
|
|
68
|
-
</
|
|
71
|
+
</HStack>
|
|
69
72
|
);
|
|
70
73
|
} );
|
|
71
74
|
}
|
|
@@ -84,15 +87,19 @@ function SingleTrackEditor( { track, onChange, onClose, onRemove } ) {
|
|
|
84
87
|
const fileName = src.startsWith( 'blob:' ) ? '' : getFilename( src ) || '';
|
|
85
88
|
return (
|
|
86
89
|
<NavigableMenu>
|
|
87
|
-
<
|
|
90
|
+
<VStack
|
|
91
|
+
className="block-library-video-tracks-editor__single-track-editor"
|
|
92
|
+
spacing="4"
|
|
93
|
+
>
|
|
88
94
|
<span className="block-library-video-tracks-editor__single-track-editor-edit-track-label">
|
|
89
95
|
{ __( 'Edit track' ) }
|
|
90
96
|
</span>
|
|
91
97
|
<span>
|
|
92
98
|
{ __( 'File' ) }: <b>{ fileName }</b>
|
|
93
99
|
</span>
|
|
94
|
-
<
|
|
100
|
+
<Grid columns={ 2 } gap={ 4 }>
|
|
95
101
|
<TextControl
|
|
102
|
+
__nextHasNoMarginBottom
|
|
96
103
|
/* eslint-disable jsx-a11y/no-autofocus */
|
|
97
104
|
autoFocus
|
|
98
105
|
/* eslint-enable jsx-a11y/no-autofocus */
|
|
@@ -107,6 +114,7 @@ function SingleTrackEditor( { track, onChange, onClose, onRemove } ) {
|
|
|
107
114
|
help={ __( 'Title of track' ) }
|
|
108
115
|
/>
|
|
109
116
|
<TextControl
|
|
117
|
+
__nextHasNoMarginBottom
|
|
110
118
|
onChange={ ( newSrcLang ) =>
|
|
111
119
|
onChange( {
|
|
112
120
|
...track,
|
|
@@ -117,54 +125,60 @@ function SingleTrackEditor( { track, onChange, onClose, onRemove } ) {
|
|
|
117
125
|
value={ srcLang }
|
|
118
126
|
help={ __( 'Language tag (en, fr, etc.)' ) }
|
|
119
127
|
/>
|
|
120
|
-
</
|
|
121
|
-
<
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
onChange( {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
/>
|
|
134
|
-
<div className="block-library-video-tracks-editor__single-track-editor-buttons-container">
|
|
135
|
-
<Button
|
|
136
|
-
variant="secondary"
|
|
137
|
-
onClick={ () => {
|
|
138
|
-
const changes = {};
|
|
139
|
-
let hasChanges = false;
|
|
140
|
-
if ( label === '' ) {
|
|
141
|
-
changes.label = __( 'English' );
|
|
142
|
-
hasChanges = true;
|
|
143
|
-
}
|
|
144
|
-
if ( srcLang === '' ) {
|
|
145
|
-
changes.srcLang = 'en';
|
|
146
|
-
hasChanges = true;
|
|
147
|
-
}
|
|
148
|
-
if ( track.kind === undefined ) {
|
|
149
|
-
changes.kind = DEFAULT_KIND;
|
|
150
|
-
hasChanges = true;
|
|
151
|
-
}
|
|
152
|
-
if ( hasChanges ) {
|
|
153
|
-
onChange( {
|
|
154
|
-
...track,
|
|
155
|
-
...changes,
|
|
156
|
-
} );
|
|
157
|
-
}
|
|
158
|
-
onClose();
|
|
128
|
+
</Grid>
|
|
129
|
+
<VStack spacing="8">
|
|
130
|
+
<SelectControl
|
|
131
|
+
__nextHasNoMarginBottom
|
|
132
|
+
className="block-library-video-tracks-editor__single-track-editor-kind-select"
|
|
133
|
+
options={ KIND_OPTIONS }
|
|
134
|
+
value={ kind }
|
|
135
|
+
label={ __( 'Kind' ) }
|
|
136
|
+
onChange={ ( newKind ) => {
|
|
137
|
+
onChange( {
|
|
138
|
+
...track,
|
|
139
|
+
kind: newKind,
|
|
140
|
+
} );
|
|
159
141
|
} }
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
142
|
+
/>
|
|
143
|
+
<HStack className="block-library-video-tracks-editor__single-track-editor-buttons-container">
|
|
144
|
+
<Button
|
|
145
|
+
variant="secondary"
|
|
146
|
+
onClick={ () => {
|
|
147
|
+
const changes = {};
|
|
148
|
+
let hasChanges = false;
|
|
149
|
+
if ( label === '' ) {
|
|
150
|
+
changes.label = __( 'English' );
|
|
151
|
+
hasChanges = true;
|
|
152
|
+
}
|
|
153
|
+
if ( srcLang === '' ) {
|
|
154
|
+
changes.srcLang = 'en';
|
|
155
|
+
hasChanges = true;
|
|
156
|
+
}
|
|
157
|
+
if ( track.kind === undefined ) {
|
|
158
|
+
changes.kind = DEFAULT_KIND;
|
|
159
|
+
hasChanges = true;
|
|
160
|
+
}
|
|
161
|
+
if ( hasChanges ) {
|
|
162
|
+
onChange( {
|
|
163
|
+
...track,
|
|
164
|
+
...changes,
|
|
165
|
+
} );
|
|
166
|
+
}
|
|
167
|
+
onClose();
|
|
168
|
+
} }
|
|
169
|
+
>
|
|
170
|
+
{ __( 'Close' ) }
|
|
171
|
+
</Button>
|
|
172
|
+
<Button
|
|
173
|
+
isDestructive
|
|
174
|
+
variant="link"
|
|
175
|
+
onClick={ onRemove }
|
|
176
|
+
>
|
|
177
|
+
{ __( 'Remove track' ) }
|
|
178
|
+
</Button>
|
|
179
|
+
</HStack>
|
|
180
|
+
</VStack>
|
|
181
|
+
</VStack>
|
|
168
182
|
</NavigableMenu>
|
|
169
183
|
);
|
|
170
184
|
}
|
package/tsconfig.tsbuildinfo
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","./src/table-of-contents/utils.ts","../element/node_modules/@types/react/global.d.ts","../../node_modules/csstype/index.d.ts","../../node_modules/@types/prop-types/index.d.ts","../../node_modules/@types/scheduler/tracing.d.ts","../element/node_modules/@types/react/index.d.ts","../element/build-types/react.d.ts","../element/build-types/create-interpolate-element.d.ts","../../node_modules/@types/react/index.d.ts","../../node_modules/@types/react-dom/index.d.ts","../../node_modules/@types/react-dom/client.d.ts","../element/build-types/react-platform.d.ts","../element/build-types/utils.d.ts","../element/build-types/platform.d.ts","../element/build-types/serialize.d.ts","../element/build-types/raw-html.d.ts","../element/build-types/index.d.ts","./src/table-of-contents/list.tsx","../../typings/gutenberg-env/index.d.ts","../../node_modules/@types/react/global.d.ts"],"fileInfos":[{"version":"aa9fb4c70f369237c2f45f9d969c9a59e0eae9a192962eb48581fe864aa609db","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","e21c071ca3e1b4a815d5f04a7475adcaeea5d64367e840dd0154096d705c3940","eb75e89d63b3b72dd9ca8b0cac801cecae5be352307c004adeaa60bc9d6df51f","2cc028cd0bdb35b1b5eb723d84666a255933fffbea607f72cbd0c7c7b4bee144",{"version":"e54c8715a4954cfdc66cd69489f2b725c09ebf37492dbd91cff0a1688b1159e8","affectsGlobalScope":true},{"version":"51b8b27c21c066bf877646e320bf6a722b80d1ade65e686923cd9d4494aef1ca","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"2c8c5ee58f30e7c944e04ab1fb5506fdbb4dd507c9efa6972cf4b91cec90c503","affectsGlobalScope":true},{"version":"2bb4b3927299434052b37851a47bf5c39764f2ba88a888a107b32262e9292b7c","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"df9c8a72ca8b0ed62f5470b41208a0587f0f73f0a7db28e5a1272cf92537518e","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"93544ca2f26a48716c1b6c5091842cad63129daac422dfa4bc52460465f22bb1","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"1b3fe904465430e030c93239a348f05e1be80640d91f2f004c3512c2c2c89f34","affectsGlobalScope":true},{"version":"7435b75fdf3509622e79622dbe5091cf4b09688410ee2034e4fc17d0c99d0862","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"9f1817f7c3f02f6d56e0f403b927e90bb133f371dcebc36fa7d6d208ef6899da","affectsGlobalScope":true},{"version":"cd6efb9467a8b6338ece2e2855e37765700f2cd061ca54b01b33878cf5c7677e","affectsGlobalScope":true},{"version":"fb4416144c1bf0323ccbc9afb0ab289c07312214e8820ad17d709498c865a3fe","affectsGlobalScope":true},{"version":"5b0ca94ec819d68d33da516306c15297acec88efeb0ae9e2b39f71dbd9685ef7","affectsGlobalScope":true},{"version":"4632665b87204bb1caa8b44d165bce0c50dfab177df5b561b345a567cabacf9a","affectsGlobalScope":true},{"version":"b748401d3c3ec6955b1d189492122c36b69e2127e2fe2ee515591e463af5cc8b","signature":"c0731df09f48c5ace3ff15a2108e852b6dc99a42f65fae85af7544a80f9407ca"},{"version":"bbdf156fea2fabed31a569445835aeedcc33643d404fcbaa54541f06c109df3f","affectsGlobalScope":true},"381899b8d1d4c1be716f18cb5242ba39f66f4b1e31d45af62a32a99f8edcb39d","f7b46d22a307739c145e5fddf537818038fdfffd580d79ed717f4d4d37249380","f5a8b384f182b3851cec3596ccc96cb7464f8d3469f48c74bf2befb782a19de5",{"version":"5917af4ff931b050dba49a1dedd9c00f15f7b3dc4345ad8491bfacd2ec68ed32","affectsGlobalScope":true},"6fb72c65c5af8c4ed7d41afecd1ebb463d1e074291ae5e8a187d0922fd40f59b","e47b8ec56eb49bc1c53c9012daa9874de14ad0c5da442485aec333571c74b526",{"version":"5917af4ff931b050dba49a1dedd9c00f15f7b3dc4345ad8491bfacd2ec68ed32","affectsGlobalScope":true},"e4dd91dd4789a109aab51d8a0569a282369fcda9ba6f2b2297bc61bacfb1a042","83e27bbd7304ea67f9afa1535f1d4fdb15866089f0d893c784cbb5b1c6fb3386","3f92e5a12ec6b30d7de129e9283a6a3e0e7a988457074950ec1e983812c2f2ff","d2d9e98a2b167079474768593e1e7125fc3db055add8fbdb5977e3d05a8a3696","6462da67490105ba7d98cf312c2faf8794c425781128b161ea8394d66502eec8","62359da52b6c8d00c50c2e50738fac82e902f916fdf458d8159e7edb1c60c3a8","1e0ac21bc775686383ea8c8e48bd98b385e6195b25c85525a7affd08a2cd38b9","0449615e1ed03c7d54fc435a63b7ef0cb4e5cea5ac40c9a63280a46f7eeae0ff",{"version":"6a32e965fda149787817aefc75730a8d028cac8c8f15af547214e009c2c55172","signature":"d83c7f4886a9400a0f94be86990a33283bcb4ae54d7289f548c40a6842623dc7"},{"version":"f254c1abf6bb4c92633159831f924588908da902aa5e04ae45c39bd001f62e2e","affectsGlobalScope":true}],"options":{"allowSyntheticDefaultImports":true,"composite":true,"declaration":true,"declarationDir":"./build-types","declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":false,"importsNotUsedAsValues":2,"jsx":1,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"rootDir":"./src","strict":true,"strictNullChecks":true,"target":99},"fileIdsList":[[50],[47,48,49,64],[45,61],[51],[51,52,56,57,58,59,60],[54,55],[50,51],[46,47,48,49],[53],[51,53]],"referencedMap":[[55,1],[54,1],[53,2],[62,3],[52,4],[61,5],[60,1],[56,6],[51,1],[59,7],[50,8]],"exportedModulesMap":[[55,1],[54,1],[53,2],[62,3],[52,4],[61,5],[60,9],[56,6],[51,1],[59,10],[50,8]],"semanticDiagnosticsPerFile":[48,55,54,53,49,47,10,12,11,2,13,14,15,16,17,18,19,20,3,4,24,21,22,23,25,26,27,5,28,29,30,31,6,32,33,34,35,7,40,36,37,38,39,8,41,42,43,1,9,44,62,45,52,61,58,60,56,51,59,57,46,50,63]},"version":"4.4.2"}
|
|
1
|
+
{"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","./src/table-of-contents/utils.ts","../element/node_modules/@types/react/global.d.ts","../../node_modules/csstype/index.d.ts","../../node_modules/@types/prop-types/index.d.ts","../../node_modules/@types/scheduler/tracing.d.ts","../element/node_modules/@types/react/index.d.ts","../element/build-types/react.d.ts","../element/build-types/create-interpolate-element.d.ts","../../node_modules/@types/react/index.d.ts","../../node_modules/@types/react-dom/index.d.ts","../../node_modules/@types/react-dom/client.d.ts","../element/build-types/react-platform.d.ts","../element/build-types/utils.d.ts","../element/build-types/platform.d.ts","../element/build-types/serialize.d.ts","../element/build-types/raw-html.d.ts","../element/build-types/index.d.ts","./src/table-of-contents/list.tsx","../../typings/gutenberg-env/index.d.ts","../../node_modules/@types/react/global.d.ts"],"fileInfos":[{"version":"aa9fb4c70f369237c2f45f9d969c9a59e0eae9a192962eb48581fe864aa609db","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","e21c071ca3e1b4a815d5f04a7475adcaeea5d64367e840dd0154096d705c3940","eb75e89d63b3b72dd9ca8b0cac801cecae5be352307c004adeaa60bc9d6df51f","2cc028cd0bdb35b1b5eb723d84666a255933fffbea607f72cbd0c7c7b4bee144",{"version":"e54c8715a4954cfdc66cd69489f2b725c09ebf37492dbd91cff0a1688b1159e8","affectsGlobalScope":true},{"version":"51b8b27c21c066bf877646e320bf6a722b80d1ade65e686923cd9d4494aef1ca","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"2c8c5ee58f30e7c944e04ab1fb5506fdbb4dd507c9efa6972cf4b91cec90c503","affectsGlobalScope":true},{"version":"2bb4b3927299434052b37851a47bf5c39764f2ba88a888a107b32262e9292b7c","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"df9c8a72ca8b0ed62f5470b41208a0587f0f73f0a7db28e5a1272cf92537518e","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"93544ca2f26a48716c1b6c5091842cad63129daac422dfa4bc52460465f22bb1","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"1b3fe904465430e030c93239a348f05e1be80640d91f2f004c3512c2c2c89f34","affectsGlobalScope":true},{"version":"7435b75fdf3509622e79622dbe5091cf4b09688410ee2034e4fc17d0c99d0862","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"9f1817f7c3f02f6d56e0f403b927e90bb133f371dcebc36fa7d6d208ef6899da","affectsGlobalScope":true},{"version":"cd6efb9467a8b6338ece2e2855e37765700f2cd061ca54b01b33878cf5c7677e","affectsGlobalScope":true},{"version":"fb4416144c1bf0323ccbc9afb0ab289c07312214e8820ad17d709498c865a3fe","affectsGlobalScope":true},{"version":"5b0ca94ec819d68d33da516306c15297acec88efeb0ae9e2b39f71dbd9685ef7","affectsGlobalScope":true},{"version":"4632665b87204bb1caa8b44d165bce0c50dfab177df5b561b345a567cabacf9a","affectsGlobalScope":true},"b748401d3c3ec6955b1d189492122c36b69e2127e2fe2ee515591e463af5cc8b",{"version":"bbdf156fea2fabed31a569445835aeedcc33643d404fcbaa54541f06c109df3f","affectsGlobalScope":true},"381899b8d1d4c1be716f18cb5242ba39f66f4b1e31d45af62a32a99f8edcb39d","f7b46d22a307739c145e5fddf537818038fdfffd580d79ed717f4d4d37249380","f5a8b384f182b3851cec3596ccc96cb7464f8d3469f48c74bf2befb782a19de5",{"version":"5917af4ff931b050dba49a1dedd9c00f15f7b3dc4345ad8491bfacd2ec68ed32","affectsGlobalScope":true},"6fb72c65c5af8c4ed7d41afecd1ebb463d1e074291ae5e8a187d0922fd40f59b","e47b8ec56eb49bc1c53c9012daa9874de14ad0c5da442485aec333571c74b526",{"version":"5917af4ff931b050dba49a1dedd9c00f15f7b3dc4345ad8491bfacd2ec68ed32","affectsGlobalScope":true},"e4dd91dd4789a109aab51d8a0569a282369fcda9ba6f2b2297bc61bacfb1a042","83e27bbd7304ea67f9afa1535f1d4fdb15866089f0d893c784cbb5b1c6fb3386","3f92e5a12ec6b30d7de129e9283a6a3e0e7a988457074950ec1e983812c2f2ff","d2d9e98a2b167079474768593e1e7125fc3db055add8fbdb5977e3d05a8a3696","6462da67490105ba7d98cf312c2faf8794c425781128b161ea8394d66502eec8","62359da52b6c8d00c50c2e50738fac82e902f916fdf458d8159e7edb1c60c3a8","1e0ac21bc775686383ea8c8e48bd98b385e6195b25c85525a7affd08a2cd38b9","0449615e1ed03c7d54fc435a63b7ef0cb4e5cea5ac40c9a63280a46f7eeae0ff","6a32e965fda149787817aefc75730a8d028cac8c8f15af547214e009c2c55172",{"version":"f254c1abf6bb4c92633159831f924588908da902aa5e04ae45c39bd001f62e2e","affectsGlobalScope":true}],"options":{"allowSyntheticDefaultImports":true,"composite":true,"declaration":true,"declarationDir":"./build-types","declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":false,"importsNotUsedAsValues":2,"jsx":1,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"rootDir":"./src","strict":true,"strictNullChecks":true,"target":99},"fileIdsList":[[50],[47,48,49,64],[45,61],[51],[51,52,56,57,58,59,60],[54,55],[50,51],[46,47,48,49]],"referencedMap":[[55,1],[54,1],[53,2],[62,3],[52,4],[61,5],[60,1],[56,6],[51,1],[59,7],[50,8]],"exportedModulesMap":[[55,1],[54,1],[53,2],[62,3],[52,4],[61,5],[60,1],[56,6],[51,1],[59,7],[50,8]],"semanticDiagnosticsPerFile":[48,55,54,53,49,47,10,12,11,2,13,14,15,16,17,18,19,20,3,4,24,21,22,23,25,26,27,5,28,29,30,31,6,32,33,34,35,7,40,36,37,38,39,8,41,42,43,1,9,44,62,45,52,61,58,60,56,51,59,57,46,50,63]},"version":"4.4.2"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.convertDescription = void 0;
|
|
7
|
-
|
|
8
|
-
var _i18n = require("@wordpress/i18n");
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* WordPress dependencies
|
|
12
|
-
*/
|
|
13
|
-
const convertDescription = (0, _i18n.__)('This menu is automatically kept in sync with pages on your site. You can manage the menu yourself by clicking customize below.');
|
|
14
|
-
exports.convertDescription = convertDescription;
|
|
15
|
-
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/page-list/constants.js"],"names":["convertDescription"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;AAGO,MAAMA,kBAAkB,GAAG,cACjC,gIADiC,CAA3B","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"]}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = ConvertToLinksModal;
|
|
7
|
-
|
|
8
|
-
var _element = require("@wordpress/element");
|
|
9
|
-
|
|
10
|
-
var _components = require("@wordpress/components");
|
|
11
|
-
|
|
12
|
-
var _i18n = require("@wordpress/i18n");
|
|
13
|
-
|
|
14
|
-
var _data = require("@wordpress/data");
|
|
15
|
-
|
|
16
|
-
var _coreData = require("@wordpress/core-data");
|
|
17
|
-
|
|
18
|
-
var _blockEditor = require("@wordpress/block-editor");
|
|
19
|
-
|
|
20
|
-
var _convertToNavigationLinks = require("./convert-to-navigation-links");
|
|
21
|
-
|
|
22
|
-
var _constants = require("./constants");
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* WordPress dependencies
|
|
26
|
-
*/
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Internal dependencies
|
|
30
|
-
*/
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Internal dependencies
|
|
34
|
-
*/
|
|
35
|
-
const PAGE_FIELDS = ['id', 'title', 'link', 'type', 'parent'];
|
|
36
|
-
const MAX_PAGE_COUNT = 100;
|
|
37
|
-
|
|
38
|
-
function ConvertToLinksModal(_ref) {
|
|
39
|
-
let {
|
|
40
|
-
onClose,
|
|
41
|
-
clientId
|
|
42
|
-
} = _ref;
|
|
43
|
-
const {
|
|
44
|
-
records: pages,
|
|
45
|
-
hasResolved: pagesFinished
|
|
46
|
-
} = (0, _coreData.useEntityRecords)('postType', 'page', {
|
|
47
|
-
per_page: MAX_PAGE_COUNT,
|
|
48
|
-
_fields: PAGE_FIELDS,
|
|
49
|
-
// TODO: When https://core.trac.wordpress.org/ticket/39037 REST API support for multiple orderby
|
|
50
|
-
// values is resolved, update 'orderby' to [ 'menu_order', 'post_title' ] to provide a consistent
|
|
51
|
-
// sort.
|
|
52
|
-
orderby: 'menu_order',
|
|
53
|
-
order: 'asc'
|
|
54
|
-
});
|
|
55
|
-
const {
|
|
56
|
-
replaceBlock
|
|
57
|
-
} = (0, _data.useDispatch)(_blockEditor.store);
|
|
58
|
-
return (0, _element.createElement)(_components.Modal, {
|
|
59
|
-
closeLabel: (0, _i18n.__)('Close'),
|
|
60
|
-
onRequestClose: onClose,
|
|
61
|
-
title: (0, _i18n.__)('Customize this menu'),
|
|
62
|
-
className: 'wp-block-page-list-modal',
|
|
63
|
-
aria: {
|
|
64
|
-
describedby: 'wp-block-page-list-modal__description'
|
|
65
|
-
}
|
|
66
|
-
}, (0, _element.createElement)("p", {
|
|
67
|
-
id: 'wp-block-page-list-modal__description'
|
|
68
|
-
}, _constants.convertDescription), (0, _element.createElement)("div", {
|
|
69
|
-
className: "wp-block-page-list-modal-buttons"
|
|
70
|
-
}, (0, _element.createElement)(_components.Button, {
|
|
71
|
-
variant: "tertiary",
|
|
72
|
-
onClick: onClose
|
|
73
|
-
}, (0, _i18n.__)('Cancel')), (0, _element.createElement)(_components.Button, {
|
|
74
|
-
variant: "primary",
|
|
75
|
-
disabled: !pagesFinished,
|
|
76
|
-
onClick: () => {
|
|
77
|
-
const navigationLinks = (0, _convertToNavigationLinks.convertToNavigationLinks)(pages); // Replace the Page List block with the Navigation Links.
|
|
78
|
-
|
|
79
|
-
replaceBlock(clientId, navigationLinks);
|
|
80
|
-
}
|
|
81
|
-
}, (0, _i18n.__)('Customize'))));
|
|
82
|
-
}
|
|
83
|
-
//# sourceMappingURL=convert-to-links-modal.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/page-list/convert-to-links-modal.js"],"names":["PAGE_FIELDS","MAX_PAGE_COUNT","ConvertToLinksModal","onClose","clientId","records","pages","hasResolved","pagesFinished","per_page","_fields","orderby","order","replaceBlock","blockEditorStore","describedby","convertDescription","navigationLinks"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAIA;;AAKA;;AAhBA;AACA;AACA;;AAMA;AACA;AACA;;AAGA;AACA;AACA;AAGA,MAAMA,WAAW,GAAG,CAAE,IAAF,EAAQ,OAAR,EAAiB,MAAjB,EAAyB,MAAzB,EAAiC,QAAjC,CAApB;AACA,MAAMC,cAAc,GAAG,GAAvB;;AAEe,SAASC,mBAAT,OAAsD;AAAA,MAAxB;AAAEC,IAAAA,OAAF;AAAWC,IAAAA;AAAX,GAAwB;AACpE,QAAM;AAAEC,IAAAA,OAAO,EAAEC,KAAX;AAAkBC,IAAAA,WAAW,EAAEC;AAA/B,MAAiD,gCACtD,UADsD,EAEtD,MAFsD,EAGtD;AACCC,IAAAA,QAAQ,EAAER,cADX;AAECS,IAAAA,OAAO,EAAEV,WAFV;AAGC;AACA;AACA;AACAW,IAAAA,OAAO,EAAE,YANV;AAOCC,IAAAA,KAAK,EAAE;AAPR,GAHsD,CAAvD;AAcA,QAAM;AAAEC,IAAAA;AAAF,MAAmB,uBAAaC,kBAAb,CAAzB;AAEA,SACC,4BAAC,iBAAD;AACC,IAAA,UAAU,EAAG,cAAI,OAAJ,CADd;AAEC,IAAA,cAAc,EAAGX,OAFlB;AAGC,IAAA,KAAK,EAAG,cAAI,qBAAJ,CAHT;AAIC,IAAA,SAAS,EAAG,0BAJb;AAKC,IAAA,IAAI,EAAG;AAAEY,MAAAA,WAAW,EAAE;AAAf;AALR,KAOC;AAAG,IAAA,EAAE,EAAG;AAAR,KACGC,6BADH,CAPD,EAUC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,kBAAD;AAAQ,IAAA,OAAO,EAAC,UAAhB;AAA2B,IAAA,OAAO,EAAGb;AAArC,KACG,cAAI,QAAJ,CADH,CADD,EAIC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAC,SADT;AAEC,IAAA,QAAQ,EAAG,CAAEK,aAFd;AAGC,IAAA,OAAO,EAAG,MAAM;AACf,YAAMS,eAAe,GACpB,wDAA0BX,KAA1B,CADD,CADe,CAIf;;AACAO,MAAAA,YAAY,CAAET,QAAF,EAAYa,eAAZ,CAAZ;AACA;AATF,KAWG,cAAI,WAAJ,CAXH,CAJD,CAVD,CADD;AA+BA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button, Modal } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport { useEntityRecords } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n/**\n * Internal dependencies\n */\nimport { convertToNavigationLinks } from './convert-to-navigation-links';\n\n/**\n * Internal dependencies\n */\nimport { convertDescription } from './constants';\n\nconst PAGE_FIELDS = [ 'id', 'title', 'link', 'type', 'parent' ];\nconst MAX_PAGE_COUNT = 100;\n\nexport default function ConvertToLinksModal( { onClose, clientId } ) {\n\tconst { records: pages, hasResolved: pagesFinished } = useEntityRecords(\n\t\t'postType',\n\t\t'page',\n\t\t{\n\t\t\tper_page: MAX_PAGE_COUNT,\n\t\t\t_fields: PAGE_FIELDS,\n\t\t\t// TODO: When https://core.trac.wordpress.org/ticket/39037 REST API support for multiple orderby\n\t\t\t// values is resolved, update 'orderby' to [ 'menu_order', 'post_title' ] to provide a consistent\n\t\t\t// sort.\n\t\t\torderby: 'menu_order',\n\t\t\torder: 'asc',\n\t\t}\n\t);\n\n\tconst { replaceBlock } = useDispatch( blockEditorStore );\n\n\treturn (\n\t\t<Modal\n\t\t\tcloseLabel={ __( 'Close' ) }\n\t\t\tonRequestClose={ onClose }\n\t\t\ttitle={ __( 'Customize this menu' ) }\n\t\t\tclassName={ 'wp-block-page-list-modal' }\n\t\t\taria={ { describedby: 'wp-block-page-list-modal__description' } }\n\t\t>\n\t\t\t<p id={ 'wp-block-page-list-modal__description' }>\n\t\t\t\t{ convertDescription }\n\t\t\t</p>\n\t\t\t<div className=\"wp-block-page-list-modal-buttons\">\n\t\t\t\t<Button variant=\"tertiary\" onClick={ onClose }>\n\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t</Button>\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\tdisabled={ ! pagesFinished }\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tconst navigationLinks =\n\t\t\t\t\t\t\tconvertToNavigationLinks( pages );\n\n\t\t\t\t\t\t// Replace the Page List block with the Navigation Links.\n\t\t\t\t\t\treplaceBlock( clientId, navigationLinks );\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Customize' ) }\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t</Modal>\n\t);\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/page-list/convert-to-navigation-links.js"],"names":["convertToNavigationLinks","pages","linkMap","navigationLinks","forEach","id","title","link","url","type","parent","innerBlocks","label","rendered","kind","push","parentLinkInnerBlocks","transformSubmenus","listOfLinks","block","index","listOfLinksArray","attributes","length","transformedBlock"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;AAGO,MAAMA,wBAAwB,GAAKC,KAAF,IAAa;AACpD,MAAK,CAAEA,KAAP,EAAe;AACd;AACA;;AAED,QAAMC,OAAO,GAAG,EAAhB;AACA,QAAMC,eAAe,GAAG,EAAxB;AACAF,EAAAA,KAAK,CAACG,OAAN,CAAe,QAA8C;AAAA;;AAAA,QAA5C;AAAEC,MAAAA,EAAF;AAAMC,MAAAA,KAAN;AAAaC,MAAAA,IAAI,EAAEC,GAAnB;AAAwBC,MAAAA,IAAxB;AAA8BC,MAAAA;AAA9B,KAA4C;AAC5D;AACA,UAAMC,WAAW,2CAAGT,OAAO,CAAEG,EAAF,CAAV,gDAAG,YAAeM,WAAlB,yEAAiC,EAAlD;AACAT,IAAAA,OAAO,CAAEG,EAAF,CAAP,GAAgB,yBACf,sBADe,EAEf;AACCA,MAAAA,EADD;AAECO,MAAAA,KAAK,EAAEN,KAAK,CAACO,QAFd;AAGCL,MAAAA,GAHD;AAICC,MAAAA,IAJD;AAKCK,MAAAA,IAAI,EAAE;AALP,KAFe,EASfH,WATe,CAAhB;;AAYA,QAAK,CAAED,MAAP,EAAgB;AACfP,MAAAA,eAAe,CAACY,IAAhB,CAAsBb,OAAO,CAAEG,EAAF,CAA7B;AACA,KAFD,MAEO;AACN,UAAK,CAAEH,OAAO,CAAEQ,MAAF,CAAd,EAA2B;AAC1B;AACAR,QAAAA,OAAO,CAAEQ,MAAF,CAAP,GAAoB;AAAEC,UAAAA,WAAW,EAAE;AAAf,SAApB;AACA;;AACD,YAAMK,qBAAqB,GAAGd,OAAO,CAAEQ,MAAF,CAAP,CAAkBC,WAAhD;AACAK,MAAAA,qBAAqB,CAACD,IAAtB,CAA4Bb,OAAO,CAAEG,EAAF,CAAnC;AACA;AACD,GAzBD,EAPoD,CAkCpD;AACA;;AACA,QAAMY,iBAAiB,GAAKC,WAAF,IAAmB;AAC5CA,IAAAA,WAAW,CAACd,OAAZ,CAAqB,CAAEe,KAAF,EAASC,KAAT,EAAgBC,gBAAhB,KAAsC;AAC1D,YAAM;AAAEC,QAAAA,UAAF;AAAcX,QAAAA;AAAd,UAA8BQ,KAApC;;AACA,UAAKR,WAAW,CAACY,MAAZ,KAAuB,CAA5B,EAAgC;AAC/BN,QAAAA,iBAAiB,CAAEN,WAAF,CAAjB;AACA,cAAMa,gBAAgB,GAAG,yBACxB,yBADwB,EAExBF,UAFwB,EAGxBX,WAHwB,CAAzB;AAKAU,QAAAA,gBAAgB,CAAED,KAAF,CAAhB,GAA4BI,gBAA5B;AACA;AACD,KAXD;AAYA,GAbD;;AAeAP,EAAAA,iBAAiB,CAAEd,eAAF,CAAjB;AAEA,SAAOA,eAAP;AACA,CAtDM","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createBlock } from '@wordpress/blocks';\n\nexport const convertToNavigationLinks = ( pages ) => {\n\tif ( ! pages ) {\n\t\treturn;\n\t}\n\n\tconst linkMap = {};\n\tconst navigationLinks = [];\n\tpages.forEach( ( { id, title, link: url, type, parent } ) => {\n\t\t// See if a placeholder exists. This is created if children appear before parents in list.\n\t\tconst innerBlocks = linkMap[ id ]?.innerBlocks ?? [];\n\t\tlinkMap[ id ] = createBlock(\n\t\t\t'core/navigation-link',\n\t\t\t{\n\t\t\t\tid,\n\t\t\t\tlabel: title.rendered,\n\t\t\t\turl,\n\t\t\t\ttype,\n\t\t\t\tkind: 'post-type',\n\t\t\t},\n\t\t\tinnerBlocks\n\t\t);\n\n\t\tif ( ! parent ) {\n\t\t\tnavigationLinks.push( linkMap[ id ] );\n\t\t} else {\n\t\t\tif ( ! linkMap[ parent ] ) {\n\t\t\t\t// Use a placeholder if the child appears before parent in list.\n\t\t\t\tlinkMap[ parent ] = { innerBlocks: [] };\n\t\t\t}\n\t\t\tconst parentLinkInnerBlocks = linkMap[ parent ].innerBlocks;\n\t\t\tparentLinkInnerBlocks.push( linkMap[ id ] );\n\t\t}\n\t} );\n\n\t// Transform all links with innerBlocks into Submenus. This can't be done\n\t// sooner because page objects have no information on their children.\n\tconst transformSubmenus = ( listOfLinks ) => {\n\t\tlistOfLinks.forEach( ( block, index, listOfLinksArray ) => {\n\t\t\tconst { attributes, innerBlocks } = block;\n\t\t\tif ( innerBlocks.length !== 0 ) {\n\t\t\t\ttransformSubmenus( innerBlocks );\n\t\t\t\tconst transformedBlock = createBlock(\n\t\t\t\t\t'core/navigation-submenu',\n\t\t\t\t\tattributes,\n\t\t\t\t\tinnerBlocks\n\t\t\t\t);\n\t\t\t\tlistOfLinksArray[ index ] = transformedBlock;\n\t\t\t}\n\t\t} );\n\t};\n\n\ttransformSubmenus( navigationLinks );\n\n\treturn navigationLinks;\n};\n"]}
|