@wordpress/block-library 8.12.0 → 8.12.1
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/build/archives/edit.js +2 -1
- package/build/archives/edit.js.map +1 -1
- package/build/archives/index.js +0 -1
- package/build/archives/index.js.map +1 -1
- package/build/audio/edit.js +4 -2
- package/build/audio/edit.js.map +1 -1
- package/build/audio/save.js +2 -1
- package/build/audio/save.js.map +1 -1
- package/build/avatar/edit.js +6 -3
- package/build/avatar/edit.js.map +1 -1
- package/build/avatar/index.js +0 -1
- package/build/avatar/index.js.map +1 -1
- package/build/block/edit.js +8 -4
- package/build/block/edit.js.map +1 -1
- package/build/block/index.js +1 -1
- package/build/button/deprecated.js +20 -15
- package/build/button/deprecated.js.map +1 -1
- package/build/button/edit.js +2 -4
- package/build/button/edit.js.map +1 -1
- package/build/button/save.js +4 -3
- package/build/button/save.js.map +1 -1
- package/build/buttons/deprecated.js +6 -5
- package/build/buttons/deprecated.js.map +1 -1
- package/build/buttons/edit.js +2 -1
- package/build/buttons/edit.js.map +1 -1
- package/build/buttons/edit.native.js +6 -6
- package/build/buttons/edit.native.js.map +1 -1
- package/build/buttons/index.js +1 -1
- package/build/buttons/save.js +2 -1
- package/build/buttons/save.js.map +1 -1
- package/build/buttons/transforms.js +1 -1
- package/build/calendar/edit.js +4 -2
- package/build/calendar/edit.js.map +1 -1
- package/build/calendar/index.js +0 -1
- package/build/calendar/index.js.map +1 -1
- package/build/categories/edit.js +2 -1
- package/build/categories/edit.js.map +1 -1
- package/build/categories/index.js +0 -1
- package/build/categories/index.js.map +1 -1
- package/build/code/edit.js +2 -1
- package/build/code/edit.js.map +1 -1
- package/build/code/save.js +2 -1
- package/build/code/save.js.map +1 -1
- package/build/column/edit.js +2 -1
- package/build/column/edit.js.map +1 -1
- package/build/column/edit.native.js +2 -1
- package/build/column/edit.native.js.map +1 -1
- package/build/column/index.js +1 -1
- package/build/column/save.js +2 -1
- package/build/column/save.js.map +1 -1
- package/build/columns/edit.js +6 -3
- package/build/columns/edit.js.map +1 -1
- package/build/columns/edit.native.js +4 -5
- package/build/columns/edit.native.js.map +1 -1
- package/build/columns/index.js +1 -1
- package/build/columns/save.js +2 -1
- package/build/columns/save.js.map +1 -1
- package/build/comment-author-avatar/edit.js +6 -8
- package/build/comment-author-avatar/edit.js.map +1 -1
- package/build/comment-author-avatar/index.js +0 -1
- package/build/comment-author-avatar/index.js.map +1 -1
- package/build/comment-author-name/edit.js +2 -1
- package/build/comment-author-name/edit.js.map +1 -1
- package/build/comment-author-name/index.js +0 -1
- package/build/comment-author-name/index.js.map +1 -1
- package/build/comment-content/edit.js +4 -2
- package/build/comment-content/edit.js.map +1 -1
- package/build/comment-content/index.js +0 -1
- package/build/comment-content/index.js.map +1 -1
- package/build/comment-date/edit.js +2 -1
- package/build/comment-date/edit.js.map +1 -1
- package/build/comment-date/index.js +0 -1
- package/build/comment-date/index.js.map +1 -1
- package/build/comment-edit-link/edit.js +2 -1
- package/build/comment-edit-link/edit.js.map +1 -1
- package/build/comment-edit-link/index.js +0 -1
- package/build/comment-edit-link/index.js.map +1 -1
- package/build/comment-reply-link/edit.js +2 -1
- package/build/comment-reply-link/edit.js.map +1 -1
- package/build/comment-reply-link/index.js +0 -1
- package/build/comment-reply-link/index.js.map +1 -1
- package/build/comment-template/edit.js +10 -10
- package/build/comment-template/edit.js.map +1 -1
- package/build/comment-template/index.js +0 -1
- package/build/comment-template/index.js.map +1 -1
- package/build/comments/deprecated.js +2 -1
- package/build/comments/deprecated.js.map +1 -1
- package/build/comments/edit/comments-legacy.js +2 -1
- package/build/comments/edit/comments-legacy.js.map +1 -1
- package/build/comments/edit/index.js +4 -2
- package/build/comments/edit/index.js.map +1 -1
- package/build/comments/index.js +0 -1
- package/build/comments/index.js.map +1 -1
- package/build/comments/save.js +2 -1
- package/build/comments/save.js.map +1 -1
- package/build/comments-pagination/edit.js +2 -1
- package/build/comments-pagination/edit.js.map +1 -1
- package/build/comments-pagination/index.js +1 -2
- package/build/comments-pagination/index.js.map +1 -1
- package/build/comments-pagination-next/edit.js +4 -7
- package/build/comments-pagination-next/edit.js.map +1 -1
- package/build/comments-pagination-next/index.js +0 -1
- package/build/comments-pagination-next/index.js.map +1 -1
- package/build/comments-pagination-numbers/edit.js +2 -1
- package/build/comments-pagination-numbers/edit.js.map +1 -1
- package/build/comments-pagination-numbers/index.js +0 -1
- package/build/comments-pagination-numbers/index.js.map +1 -1
- package/build/comments-pagination-previous/edit.js +4 -7
- package/build/comments-pagination-previous/edit.js.map +1 -1
- package/build/comments-pagination-previous/index.js +0 -1
- package/build/comments-pagination-previous/index.js.map +1 -1
- package/build/comments-title/edit.js +4 -9
- package/build/comments-title/edit.js.map +1 -1
- package/build/cover/deprecated.js +46 -36
- package/build/cover/deprecated.js.map +1 -1
- package/build/cover/edit/index.js +8 -7
- package/build/cover/edit/index.js.map +1 -1
- package/build/cover/edit/inspector-controls.js +4 -7
- package/build/cover/edit/inspector-controls.js.map +1 -1
- package/build/cover/edit/resizable-cover-popover.js +6 -7
- package/build/cover/edit/resizable-cover-popover.js.map +1 -1
- package/build/cover/edit.native.js +12 -11
- package/build/cover/edit.native.js.map +1 -1
- package/build/cover/index.js +1 -1
- package/build/cover/save.js +9 -7
- package/build/cover/save.js.map +1 -1
- package/build/cover/transforms.js +2 -2
- package/build/cover/transforms.js.map +1 -1
- package/build/details/edit.js +3 -7
- package/build/details/edit.js.map +1 -1
- package/build/details/index.js +1 -1
- package/build/details/init.js +16 -0
- package/build/details/init.js.map +1 -0
- package/build/details/save.js +2 -6
- package/build/details/save.js.map +1 -1
- package/build/embed/deprecated.js +4 -3
- package/build/embed/deprecated.js.map +1 -1
- package/build/embed/edit.js +6 -3
- package/build/embed/edit.js.map +1 -1
- package/build/embed/edit.native.js +6 -3
- package/build/embed/edit.native.js.map +1 -1
- package/build/embed/save.js +4 -3
- package/build/embed/save.js.map +1 -1
- package/build/embed/wp-embed-preview.js +4 -7
- package/build/embed/wp-embed-preview.js.map +1 -1
- package/build/embed/wp-embed-preview.native.js +4 -7
- package/build/embed/wp-embed-preview.native.js.map +1 -1
- package/build/file/deprecated.js +6 -3
- package/build/file/deprecated.js.map +1 -1
- package/build/file/edit.js +4 -2
- package/build/file/edit.js.map +1 -1
- package/build/file/index.js +1 -1
- package/build/file/save.js +2 -1
- package/build/file/save.js.map +1 -1
- package/build/file/view.js +9 -0
- package/build/file/view.js.map +1 -0
- package/build/footnotes/edit.js +57 -0
- package/build/footnotes/edit.js.map +1 -0
- package/build/footnotes/format.js +142 -0
- package/build/footnotes/format.js.map +1 -0
- package/build/footnotes/index.js +67 -0
- package/build/footnotes/index.js.map +1 -0
- package/build/freeform/edit.js +6 -3
- package/build/freeform/edit.js.map +1 -1
- package/build/freeform/edit.native.js +2 -4
- package/build/freeform/edit.native.js.map +1 -1
- package/build/freeform/modal.js +2 -1
- package/build/freeform/modal.js.map +1 -1
- package/build/gallery/deprecated.js +6 -4
- package/build/gallery/deprecated.js.map +1 -1
- package/build/gallery/edit-wrapper.js +4 -2
- package/build/gallery/edit-wrapper.js.map +1 -1
- package/build/gallery/edit.js +16 -13
- package/build/gallery/edit.js.map +1 -1
- package/build/gallery/gallery.js +2 -4
- package/build/gallery/gallery.js.map +1 -1
- package/build/gallery/gallery.native.js +3 -2
- package/build/gallery/gallery.native.js.map +1 -1
- package/build/gallery/index.js +1 -1
- package/build/gallery/save.js +2 -1
- package/build/gallery/save.js.map +1 -1
- package/build/gallery/shared-icon.native.js +4 -5
- package/build/gallery/shared-icon.native.js.map +1 -1
- package/build/gallery/v1/edit.js +8 -9
- package/build/gallery/v1/edit.js.map +1 -1
- package/build/gallery/v1/gallery.js +7 -7
- package/build/gallery/v1/gallery.js.map +1 -1
- package/build/gallery/v1/save.js +4 -3
- package/build/gallery/v1/save.js.map +1 -1
- package/build/group/deprecated.js +5 -3
- package/build/group/deprecated.js.map +1 -1
- package/build/group/edit.js +4 -1
- package/build/group/edit.js.map +1 -1
- package/build/group/index.js +1 -1
- package/build/group/placeholder.js +2 -1
- package/build/group/placeholder.js.map +1 -1
- package/build/group/save.js +2 -1
- package/build/group/save.js.map +1 -1
- package/build/heading/deprecated.js +8 -6
- package/build/heading/deprecated.js.map +1 -1
- package/build/heading/edit.js +9 -11
- package/build/heading/edit.js.map +1 -1
- package/build/heading/save.js +4 -3
- package/build/heading/save.js.map +1 -1
- package/build/home-link/edit.js +2 -1
- package/build/home-link/edit.js.map +1 -1
- package/build/home-link/index.js +0 -1
- package/build/home-link/index.js.map +1 -1
- package/build/html/edit.js +4 -3
- package/build/html/edit.js.map +1 -1
- package/build/image/deprecated.js +14 -12
- package/build/image/deprecated.js.map +1 -1
- package/build/image/edit.js +4 -3
- package/build/image/edit.js.map +1 -1
- package/build/image/edit.native.js +8 -8
- package/build/image/edit.native.js.map +1 -1
- package/build/image/image.js +16 -9
- package/build/image/image.js.map +1 -1
- package/build/image/interactivity.js +119 -6
- package/build/image/interactivity.js.map +1 -1
- package/build/image/save.js +4 -3
- package/build/image/save.js.map +1 -1
- package/build/index.js +3 -1
- package/build/index.js.map +1 -1
- package/build/latest-comments/edit.js +2 -1
- package/build/latest-comments/edit.js.map +1 -1
- package/build/latest-comments/index.js +0 -1
- package/build/latest-comments/index.js.map +1 -1
- package/build/latest-posts/deprecated.js +0 -1
- package/build/latest-posts/deprecated.js.map +1 -1
- package/build/latest-posts/edit.js +14 -7
- package/build/latest-posts/edit.js.map +1 -1
- package/build/latest-posts/edit.native.js +4 -5
- package/build/latest-posts/edit.native.js.map +1 -1
- package/build/latest-posts/index.js +0 -1
- package/build/latest-posts/index.js.map +1 -1
- package/build/list/deprecated.js +12 -10
- package/build/list/deprecated.js.map +1 -1
- package/build/list/edit.js +4 -5
- package/build/list/edit.js.map +1 -1
- package/build/list/ordered-list-settings.js +25 -1
- package/build/list/ordered-list-settings.js.map +1 -1
- package/build/list/save.js +6 -5
- package/build/list/save.js.map +1 -1
- package/build/list/tag-name.js +4 -7
- package/build/list/tag-name.js.map +1 -1
- package/build/list/tag-name.native.js +4 -7
- package/build/list/tag-name.native.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/edit.native.js +2 -1
- package/build/list-item/edit.native.js.map +1 -1
- package/build/list-item/save.js +2 -1
- package/build/list-item/save.js.map +1 -1
- package/build/{private-apis.js → lock-unlock.js} +1 -1
- package/build/lock-unlock.js.map +1 -0
- package/build/loginout/edit.js +4 -3
- package/build/loginout/edit.js.map +1 -1
- package/build/loginout/index.js +0 -1
- package/build/loginout/index.js.map +1 -1
- package/build/media-text/deprecated.js +43 -33
- package/build/media-text/deprecated.js.map +1 -1
- package/build/media-text/edit.js +7 -4
- package/build/media-text/edit.js.map +1 -1
- package/build/media-text/media-container.js +8 -7
- package/build/media-text/media-container.js.map +1 -1
- package/build/media-text/media-container.native.js +8 -8
- package/build/media-text/media-container.native.js.map +1 -1
- package/build/media-text/save.js +17 -13
- package/build/media-text/save.js.map +1 -1
- package/build/missing/edit.js +4 -3
- package/build/missing/edit.js.map +1 -1
- package/build/more/edit.js +2 -1
- package/build/more/edit.js.map +1 -1
- package/build/navigation/constants.js +8 -1
- package/build/navigation/constants.js.map +1 -1
- package/build/navigation/deprecated.js +1 -1
- package/build/navigation/deprecated.js.map +1 -1
- package/build/navigation/edit/index.js +35 -21
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/inner-blocks.js +2 -1
- package/build/navigation/edit/inner-blocks.js.map +1 -1
- package/build/navigation/edit/leaf-more-menu.js +5 -9
- package/build/navigation/edit/leaf-more-menu.js.map +1 -1
- package/build/navigation/edit/menu-inspector-controls.js +12 -16
- package/build/navigation/edit/menu-inspector-controls.js.map +1 -1
- package/build/navigation/edit/navigation-menu-selector.js +15 -7
- package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build/navigation/edit/responsive-wrapper.js +2 -1
- package/build/navigation/edit/responsive-wrapper.js.map +1 -1
- package/build/navigation/edit/unsaved-inner-blocks.js +3 -5
- package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build/navigation/index.js +2 -3
- package/build/navigation/index.js.map +1 -1
- package/build/navigation/use-navigation-menu.js +9 -7
- package/build/navigation/use-navigation-menu.js.map +1 -1
- package/build/navigation/view-modal.js +64 -0
- package/build/navigation/view-modal.js.map +1 -0
- package/build/navigation/view.js +61 -0
- package/build/navigation/view.js.map +1 -0
- package/build/navigation-link/edit.js +4 -2
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-submenu/edit.js +4 -2
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/nextpage/edit.js +2 -1
- package/build/nextpage/edit.js.map +1 -1
- package/build/page-list/edit.js +12 -6
- package/build/page-list/edit.js.map +1 -1
- package/build/page-list/index.js +0 -1
- package/build/page-list/index.js.map +1 -1
- package/build/page-list-item/edit.js +2 -1
- package/build/page-list-item/edit.js.map +1 -1
- package/build/paragraph/deprecated.js +5 -4
- package/build/paragraph/deprecated.js.map +1 -1
- package/build/paragraph/edit.js +4 -6
- package/build/paragraph/edit.js.map +1 -1
- package/build/paragraph/save.js +5 -4
- package/build/paragraph/save.js.map +1 -1
- package/build/pattern/edit.js +7 -32
- package/build/pattern/edit.js.map +1 -1
- package/build/pattern/index.js +3 -11
- package/build/pattern/index.js.map +1 -1
- package/build/post-author/edit.js +4 -2
- package/build/post-author/edit.js.map +1 -1
- package/build/post-author/index.js +0 -1
- package/build/post-author/index.js.map +1 -1
- package/build/post-author-biography/edit.js +2 -4
- package/build/post-author-biography/edit.js.map +1 -1
- package/build/post-author-biography/index.js +0 -1
- package/build/post-author-biography/index.js.map +1 -1
- package/build/post-author-name/edit.js +2 -1
- package/build/post-author-name/edit.js.map +1 -1
- package/build/post-author-name/index.js +0 -1
- package/build/post-author-name/index.js.map +1 -1
- package/build/post-comment/edit.js +4 -2
- package/build/post-comment/edit.js.map +1 -1
- package/build/post-comment/save.js +2 -1
- package/build/post-comment/save.js.map +1 -1
- package/build/post-comments-count/edit.js +2 -4
- package/build/post-comments-count/edit.js.map +1 -1
- package/build/post-comments-count/index.js +0 -1
- package/build/post-comments-count/index.js.map +1 -1
- package/build/post-comments-form/edit.js +2 -1
- package/build/post-comments-form/edit.js.map +1 -1
- package/build/post-comments-form/index.js +0 -1
- package/build/post-comments-form/index.js.map +1 -1
- package/build/post-comments-link/edit.js +2 -1
- package/build/post-comments-link/edit.js.map +1 -1
- package/build/post-comments-link/index.js +0 -1
- package/build/post-comments-link/index.js.map +1 -1
- package/build/post-content/edit.js +11 -10
- package/build/post-content/edit.js.map +1 -1
- package/build/post-content/index.js +1 -2
- package/build/post-content/index.js.map +1 -1
- package/build/post-date/edit.js +2 -1
- package/build/post-date/edit.js.map +1 -1
- package/build/post-date/index.js +0 -1
- package/build/post-date/index.js.map +1 -1
- package/build/post-excerpt/edit.js +6 -3
- package/build/post-excerpt/edit.js.map +1 -1
- package/build/post-excerpt/index.js +0 -1
- package/build/post-excerpt/index.js.map +1 -1
- package/build/post-featured-image/edit.js +4 -2
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/post-featured-image/index.js +0 -1
- package/build/post-featured-image/index.js.map +1 -1
- package/build/post-featured-image/overlay.js +4 -5
- package/build/post-featured-image/overlay.js.map +1 -1
- package/build/post-navigation-link/edit.js +2 -1
- package/build/post-navigation-link/edit.js.map +1 -1
- package/build/post-navigation-link/index.js +0 -1
- package/build/post-navigation-link/index.js.map +1 -1
- package/build/post-template/edit.js +14 -9
- package/build/post-template/edit.js.map +1 -1
- package/build/post-template/index.js +1 -2
- package/build/post-template/index.js.map +1 -1
- package/build/post-terms/edit.js +4 -8
- package/build/post-terms/edit.js.map +1 -1
- package/build/post-terms/hooks.js +9 -5
- package/build/post-terms/hooks.js.map +1 -1
- package/build/post-terms/index.js +0 -1
- package/build/post-terms/index.js.map +1 -1
- package/build/post-time-to-read/edit.js +2 -1
- package/build/post-time-to-read/edit.js.map +1 -1
- package/build/post-time-to-read/init.js +16 -0
- package/build/post-time-to-read/init.js.map +1 -0
- package/build/post-title/edit.js +16 -16
- package/build/post-title/edit.js.map +1 -1
- package/build/post-title/index.js +0 -1
- package/build/post-title/index.js.map +1 -1
- package/build/preformatted/edit.js +4 -8
- package/build/preformatted/edit.js.map +1 -1
- package/build/preformatted/edit.native.js +2 -1
- package/build/preformatted/edit.native.js.map +1 -1
- package/build/preformatted/save.js +2 -1
- package/build/preformatted/save.js.map +1 -1
- package/build/pullquote/deprecated.js +10 -8
- package/build/pullquote/deprecated.js.map +1 -1
- package/build/pullquote/edit.js +2 -1
- package/build/pullquote/edit.js.map +1 -1
- package/build/pullquote/edit.native.js +2 -1
- package/build/pullquote/edit.native.js.map +1 -1
- package/build/pullquote/save.js +5 -4
- package/build/pullquote/save.js.map +1 -1
- package/build/query/deprecated.js +16 -10
- package/build/query/deprecated.js.map +1 -1
- package/build/query/edit/index.js +2 -4
- package/build/query/edit/index.js.map +1 -1
- package/build/query/edit/inspector-controls/index.js +4 -3
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/edit/query-content.js +20 -6
- package/build/query/edit/query-content.js.map +1 -1
- package/build/query/edit/query-placeholder.js +4 -2
- package/build/query/edit/query-placeholder.js.map +1 -1
- package/build/query/index.js +1 -2
- package/build/query/index.js.map +1 -1
- package/build/query/save.js +2 -1
- package/build/query/save.js.map +1 -1
- package/build/query/utils.js +1 -2
- package/build/query/utils.js.map +1 -1
- package/build/query-no-results/edit.js +2 -1
- package/build/query-no-results/edit.js.map +1 -1
- package/build/query-no-results/index.js +0 -1
- package/build/query-no-results/index.js.map +1 -1
- package/build/query-pagination/deprecated.js +2 -1
- package/build/query-pagination/deprecated.js.map +1 -1
- package/build/query-pagination/edit.js +2 -1
- package/build/query-pagination/edit.js.map +1 -1
- package/build/query-pagination/index.js +1 -2
- package/build/query-pagination/index.js.map +1 -1
- package/build/query-pagination-next/edit.js +4 -7
- package/build/query-pagination-next/edit.js.map +1 -1
- package/build/query-pagination-next/index.js +0 -1
- package/build/query-pagination-next/index.js.map +1 -1
- package/build/query-pagination-numbers/edit.js +2 -1
- package/build/query-pagination-numbers/edit.js.map +1 -1
- package/build/query-pagination-numbers/index.js +0 -1
- package/build/query-pagination-numbers/index.js.map +1 -1
- package/build/query-pagination-previous/edit.js +4 -7
- package/build/query-pagination-previous/edit.js.map +1 -1
- package/build/query-pagination-previous/index.js +0 -1
- package/build/query-pagination-previous/index.js.map +1 -1
- package/build/query-title/edit.js +8 -11
- package/build/query-title/edit.js.map +1 -1
- package/build/query-title/index.js +0 -1
- package/build/query-title/index.js.map +1 -1
- package/build/quote/deprecated.js +4 -3
- package/build/quote/deprecated.js.map +1 -1
- package/build/quote/edit.js +7 -7
- package/build/quote/edit.js.map +1 -1
- package/build/quote/save.js +4 -3
- package/build/quote/save.js.map +1 -1
- package/build/read-more/edit.js +4 -7
- package/build/read-more/edit.js.map +1 -1
- package/build/read-more/index.js +0 -1
- package/build/read-more/index.js.map +1 -1
- package/build/rss/edit.js +4 -2
- package/build/rss/edit.js.map +1 -1
- package/build/rss/index.js +0 -1
- package/build/rss/index.js.map +1 -1
- package/build/search/edit.js +4 -3
- package/build/search/edit.js.map +1 -1
- package/build/search/edit.native.js +6 -8
- package/build/search/edit.native.js.map +1 -1
- package/build/search/index.js +0 -1
- package/build/search/index.js.map +1 -1
- package/build/separator/deprecated.js +5 -4
- package/build/separator/deprecated.js.map +1 -1
- package/build/separator/edit.js +5 -4
- package/build/separator/edit.js.map +1 -1
- package/build/separator/save.js +5 -4
- package/build/separator/save.js.map +1 -1
- package/build/shortcode/edit.js +4 -3
- package/build/shortcode/edit.js.map +1 -1
- package/build/site-logo/edit.js +10 -10
- package/build/site-logo/edit.js.map +1 -1
- package/build/site-logo/index.js +0 -1
- package/build/site-logo/index.js.map +1 -1
- package/build/site-tagline/edit.js +5 -5
- package/build/site-tagline/edit.js.map +1 -1
- package/build/site-tagline/icon.js +0 -3
- package/build/site-tagline/icon.js.map +1 -1
- package/build/site-tagline/index.js +0 -1
- package/build/site-tagline/index.js.map +1 -1
- package/build/site-title/edit/index.js +8 -9
- package/build/site-title/edit/index.js.map +1 -1
- package/build/site-title/index.js +0 -1
- package/build/site-title/index.js.map +1 -1
- package/build/social-link/edit.js +2 -1
- package/build/social-link/edit.js.map +1 -1
- package/build/social-link/index.js +0 -1
- package/build/social-link/index.js.map +1 -1
- package/build/social-links/deprecated.js +5 -4
- package/build/social-links/deprecated.js.map +1 -1
- package/build/social-links/edit.js +6 -6
- package/build/social-links/edit.js.map +1 -1
- package/build/social-links/index.js +1 -1
- package/build/social-links/save.js +2 -1
- package/build/social-links/save.js.map +1 -1
- package/build/spacer/deprecated.js +8 -7
- package/build/spacer/deprecated.js.map +1 -1
- package/build/spacer/edit.js +10 -10
- package/build/spacer/edit.js.map +1 -1
- package/build/spacer/edit.native.js +4 -5
- package/build/spacer/edit.native.js.map +1 -1
- package/build/spacer/save.js +21 -11
- package/build/spacer/save.js.map +1 -1
- package/build/spacer/save.native.js +8 -7
- package/build/spacer/save.native.js.map +1 -1
- package/build/table/deprecated.js +4 -2
- package/build/table/deprecated.js.map +1 -1
- package/build/table/edit.js +6 -4
- package/build/table/edit.js.map +1 -1
- package/build/table/save.js +2 -1
- package/build/table/save.js.map +1 -1
- package/build/table-of-contents/edit.js +4 -2
- package/build/table-of-contents/edit.js.map +1 -1
- package/build/table-of-contents/save.js +2 -1
- package/build/table-of-contents/save.js.map +1 -1
- package/build/tag-cloud/edit.js +2 -1
- package/build/tag-cloud/edit.js.map +1 -1
- package/build/tag-cloud/index.js +0 -1
- package/build/tag-cloud/index.js.map +1 -1
- package/build/template-part/edit/index.js +8 -4
- package/build/template-part/edit/index.js.map +1 -1
- package/build/template-part/edit/inner-blocks.js +3 -2
- package/build/template-part/edit/inner-blocks.js.map +1 -1
- package/build/template-part/index.js +0 -1
- package/build/template-part/index.js.map +1 -1
- package/build/term-description/edit.js +2 -1
- package/build/term-description/edit.js.map +1 -1
- package/build/term-description/index.js +0 -1
- package/build/term-description/index.js.map +1 -1
- package/build/text-columns/edit.js +4 -3
- package/build/text-columns/edit.js.map +1 -1
- package/build/text-columns/save.js +4 -3
- package/build/text-columns/save.js.map +1 -1
- package/build/utils/interactivity/directives.js +4 -7
- package/build/utils/interactivity/directives.js.map +1 -1
- package/build/utils/interactivity/index.js +1 -3
- package/build/utils/interactivity/index.js.map +1 -1
- package/build/utils/migrate-font-family.js +2 -2
- package/build/utils/migrate-font-family.js.map +1 -1
- package/build/verse/deprecated.js +4 -3
- package/build/verse/deprecated.js.map +1 -1
- package/build/verse/edit.js +4 -6
- package/build/verse/edit.js.map +1 -1
- package/build/verse/save.js +4 -3
- package/build/verse/save.js.map +1 -1
- package/build/video/deprecated.js +2 -1
- package/build/video/deprecated.js.map +1 -1
- package/build/video/edit.js +4 -2
- package/build/video/edit.js.map +1 -1
- package/build/video/edit.native.js +8 -8
- package/build/video/edit.native.js.map +1 -1
- package/build/video/save.js +2 -1
- package/build/video/save.js.map +1 -1
- package/build/video/tracks.js +4 -7
- package/build/video/tracks.js.map +1 -1
- package/build-module/archives/edit.js +2 -1
- package/build-module/archives/edit.js.map +1 -1
- package/build-module/archives/index.js +0 -1
- package/build-module/archives/index.js.map +1 -1
- package/build-module/audio/edit.js +4 -2
- package/build-module/audio/edit.js.map +1 -1
- package/build-module/audio/save.js +2 -1
- package/build-module/audio/save.js.map +1 -1
- package/build-module/avatar/edit.js +6 -3
- package/build-module/avatar/edit.js.map +1 -1
- package/build-module/avatar/index.js +0 -1
- package/build-module/avatar/index.js.map +1 -1
- package/build-module/block/edit.js +8 -4
- package/build-module/block/edit.js.map +1 -1
- package/build-module/block/index.js +1 -1
- package/build-module/button/deprecated.js +20 -15
- package/build-module/button/deprecated.js.map +1 -1
- package/build-module/button/edit.js +2 -3
- package/build-module/button/edit.js.map +1 -1
- package/build-module/button/save.js +4 -3
- package/build-module/button/save.js.map +1 -1
- package/build-module/buttons/deprecated.js +6 -5
- package/build-module/buttons/deprecated.js.map +1 -1
- package/build-module/buttons/edit.js +2 -1
- package/build-module/buttons/edit.js.map +1 -1
- package/build-module/buttons/edit.native.js +6 -6
- package/build-module/buttons/edit.native.js.map +1 -1
- package/build-module/buttons/index.js +1 -1
- package/build-module/buttons/save.js +2 -1
- package/build-module/buttons/save.js.map +1 -1
- package/build-module/buttons/transforms.js +1 -1
- package/build-module/calendar/edit.js +4 -2
- package/build-module/calendar/edit.js.map +1 -1
- package/build-module/calendar/index.js +0 -1
- package/build-module/calendar/index.js.map +1 -1
- package/build-module/categories/edit.js +2 -1
- package/build-module/categories/edit.js.map +1 -1
- package/build-module/categories/index.js +0 -1
- package/build-module/categories/index.js.map +1 -1
- package/build-module/code/edit.js +2 -1
- package/build-module/code/edit.js.map +1 -1
- package/build-module/code/save.js +2 -1
- package/build-module/code/save.js.map +1 -1
- package/build-module/column/edit.js +2 -1
- package/build-module/column/edit.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/column/index.js +1 -1
- package/build-module/column/save.js +2 -1
- package/build-module/column/save.js.map +1 -1
- package/build-module/columns/edit.js +6 -3
- package/build-module/columns/edit.js.map +1 -1
- package/build-module/columns/edit.native.js +4 -4
- package/build-module/columns/edit.native.js.map +1 -1
- package/build-module/columns/index.js +1 -1
- package/build-module/columns/save.js +2 -1
- package/build-module/columns/save.js.map +1 -1
- package/build-module/comment-author-avatar/edit.js +6 -5
- package/build-module/comment-author-avatar/edit.js.map +1 -1
- package/build-module/comment-author-avatar/index.js +0 -1
- package/build-module/comment-author-avatar/index.js.map +1 -1
- package/build-module/comment-author-name/edit.js +2 -1
- package/build-module/comment-author-name/edit.js.map +1 -1
- package/build-module/comment-author-name/index.js +0 -1
- package/build-module/comment-author-name/index.js.map +1 -1
- package/build-module/comment-content/edit.js +4 -2
- package/build-module/comment-content/edit.js.map +1 -1
- package/build-module/comment-content/index.js +0 -1
- package/build-module/comment-content/index.js.map +1 -1
- package/build-module/comment-date/edit.js +2 -1
- package/build-module/comment-date/edit.js.map +1 -1
- package/build-module/comment-date/index.js +0 -1
- package/build-module/comment-date/index.js.map +1 -1
- package/build-module/comment-edit-link/edit.js +2 -1
- package/build-module/comment-edit-link/edit.js.map +1 -1
- package/build-module/comment-edit-link/index.js +0 -1
- package/build-module/comment-edit-link/index.js.map +1 -1
- package/build-module/comment-reply-link/edit.js +2 -1
- package/build-module/comment-reply-link/edit.js.map +1 -1
- package/build-module/comment-reply-link/index.js +0 -1
- package/build-module/comment-reply-link/index.js.map +1 -1
- package/build-module/comment-template/edit.js +10 -7
- package/build-module/comment-template/edit.js.map +1 -1
- package/build-module/comment-template/index.js +0 -1
- package/build-module/comment-template/index.js.map +1 -1
- package/build-module/comments/deprecated.js +2 -1
- package/build-module/comments/deprecated.js.map +1 -1
- package/build-module/comments/edit/comments-legacy.js +2 -1
- package/build-module/comments/edit/comments-legacy.js.map +1 -1
- package/build-module/comments/edit/index.js +4 -2
- package/build-module/comments/edit/index.js.map +1 -1
- package/build-module/comments/index.js +0 -1
- package/build-module/comments/index.js.map +1 -1
- package/build-module/comments/save.js +2 -1
- package/build-module/comments/save.js.map +1 -1
- package/build-module/comments-pagination/edit.js +2 -1
- package/build-module/comments-pagination/edit.js.map +1 -1
- package/build-module/comments-pagination/index.js +1 -2
- package/build-module/comments-pagination/index.js.map +1 -1
- package/build-module/comments-pagination-next/edit.js +4 -4
- package/build-module/comments-pagination-next/edit.js.map +1 -1
- package/build-module/comments-pagination-next/index.js +0 -1
- package/build-module/comments-pagination-next/index.js.map +1 -1
- package/build-module/comments-pagination-numbers/edit.js +2 -1
- package/build-module/comments-pagination-numbers/edit.js.map +1 -1
- package/build-module/comments-pagination-numbers/index.js +0 -1
- package/build-module/comments-pagination-numbers/index.js.map +1 -1
- package/build-module/comments-pagination-previous/edit.js +4 -4
- package/build-module/comments-pagination-previous/edit.js.map +1 -1
- package/build-module/comments-pagination-previous/index.js +0 -1
- package/build-module/comments-pagination-previous/index.js.map +1 -1
- package/build-module/comments-title/edit.js +4 -8
- package/build-module/comments-title/edit.js.map +1 -1
- package/build-module/cover/deprecated.js +46 -36
- package/build-module/cover/deprecated.js.map +1 -1
- package/build-module/cover/edit/index.js +8 -6
- package/build-module/cover/edit/index.js.map +1 -1
- package/build-module/cover/edit/inspector-controls.js +4 -4
- package/build-module/cover/edit/inspector-controls.js.map +1 -1
- package/build-module/cover/edit/resizable-cover-popover.js +5 -5
- package/build-module/cover/edit/resizable-cover-popover.js.map +1 -1
- package/build-module/cover/edit.native.js +12 -10
- package/build-module/cover/edit.native.js.map +1 -1
- package/build-module/cover/index.js +1 -1
- package/build-module/cover/save.js +9 -7
- package/build-module/cover/save.js.map +1 -1
- package/build-module/cover/transforms.js +1 -1
- package/build-module/cover/transforms.js.map +1 -1
- package/build-module/details/edit.js +3 -4
- package/build-module/details/edit.js.map +1 -1
- package/build-module/details/index.js +1 -1
- package/build-module/details/init.js +6 -0
- package/build-module/details/init.js.map +1 -0
- package/build-module/details/save.js +2 -3
- package/build-module/details/save.js.map +1 -1
- package/build-module/embed/deprecated.js +4 -3
- package/build-module/embed/deprecated.js.map +1 -1
- package/build-module/embed/edit.js +6 -3
- package/build-module/embed/edit.js.map +1 -1
- package/build-module/embed/edit.native.js +6 -3
- package/build-module/embed/edit.native.js.map +1 -1
- package/build-module/embed/save.js +4 -3
- package/build-module/embed/save.js.map +1 -1
- package/build-module/embed/wp-embed-preview.js +4 -4
- package/build-module/embed/wp-embed-preview.js.map +1 -1
- package/build-module/embed/wp-embed-preview.native.js +4 -4
- package/build-module/embed/wp-embed-preview.native.js.map +1 -1
- package/build-module/file/deprecated.js +6 -3
- package/build-module/file/deprecated.js.map +1 -1
- package/build-module/file/edit.js +4 -2
- package/build-module/file/edit.js.map +1 -1
- package/build-module/file/index.js +1 -1
- package/build-module/file/save.js +2 -1
- package/build-module/file/save.js.map +1 -1
- package/build-module/file/view.js +6 -0
- package/build-module/file/view.js.map +1 -0
- package/build-module/footnotes/edit.js +48 -0
- package/build-module/footnotes/edit.js.map +1 -0
- package/build-module/footnotes/format.js +126 -0
- package/build-module/footnotes/format.js.map +1 -0
- package/build-module/footnotes/index.js +48 -0
- package/build-module/footnotes/index.js.map +1 -0
- package/build-module/freeform/edit.js +6 -3
- package/build-module/freeform/edit.js.map +1 -1
- package/build-module/freeform/edit.native.js +2 -3
- package/build-module/freeform/edit.native.js.map +1 -1
- package/build-module/freeform/modal.js +2 -1
- package/build-module/freeform/modal.js.map +1 -1
- package/build-module/gallery/deprecated.js +6 -4
- package/build-module/gallery/deprecated.js.map +1 -1
- package/build-module/gallery/edit-wrapper.js +4 -2
- package/build-module/gallery/edit-wrapper.js.map +1 -1
- package/build-module/gallery/edit.js +16 -12
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/gallery/gallery.js +2 -3
- package/build-module/gallery/gallery.js.map +1 -1
- package/build-module/gallery/gallery.native.js +3 -2
- package/build-module/gallery/gallery.native.js.map +1 -1
- package/build-module/gallery/index.js +1 -1
- package/build-module/gallery/save.js +2 -1
- package/build-module/gallery/save.js.map +1 -1
- package/build-module/gallery/shared-icon.native.js +4 -4
- package/build-module/gallery/shared-icon.native.js.map +1 -1
- package/build-module/gallery/v1/edit.js +8 -8
- package/build-module/gallery/v1/edit.js.map +1 -1
- package/build-module/gallery/v1/gallery.js +7 -6
- package/build-module/gallery/v1/gallery.js.map +1 -1
- package/build-module/gallery/v1/save.js +4 -3
- package/build-module/gallery/v1/save.js.map +1 -1
- package/build-module/group/deprecated.js +5 -3
- package/build-module/group/deprecated.js.map +1 -1
- package/build-module/group/edit.js +4 -1
- package/build-module/group/edit.js.map +1 -1
- package/build-module/group/index.js +1 -1
- package/build-module/group/placeholder.js +2 -1
- package/build-module/group/placeholder.js.map +1 -1
- package/build-module/group/save.js +2 -1
- package/build-module/group/save.js.map +1 -1
- package/build-module/heading/deprecated.js +8 -6
- package/build-module/heading/deprecated.js.map +1 -1
- package/build-module/heading/edit.js +9 -9
- package/build-module/heading/edit.js.map +1 -1
- package/build-module/heading/save.js +4 -3
- package/build-module/heading/save.js.map +1 -1
- package/build-module/home-link/edit.js +2 -1
- package/build-module/home-link/edit.js.map +1 -1
- package/build-module/home-link/index.js +0 -1
- package/build-module/home-link/index.js.map +1 -1
- package/build-module/html/edit.js +4 -3
- package/build-module/html/edit.js.map +1 -1
- package/build-module/image/deprecated.js +14 -11
- package/build-module/image/deprecated.js.map +1 -1
- package/build-module/image/edit.js +3 -2
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/edit.native.js +8 -7
- package/build-module/image/edit.native.js.map +1 -1
- package/build-module/image/image.js +17 -10
- package/build-module/image/image.js.map +1 -1
- package/build-module/image/interactivity.js +119 -6
- package/build-module/image/interactivity.js.map +1 -1
- package/build-module/image/save.js +4 -3
- package/build-module/image/save.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 +2 -1
- package/build-module/latest-comments/edit.js.map +1 -1
- package/build-module/latest-comments/index.js +0 -1
- package/build-module/latest-comments/index.js.map +1 -1
- package/build-module/latest-posts/deprecated.js +0 -1
- package/build-module/latest-posts/deprecated.js.map +1 -1
- package/build-module/latest-posts/edit.js +15 -7
- package/build-module/latest-posts/edit.js.map +1 -1
- package/build-module/latest-posts/edit.native.js +4 -4
- package/build-module/latest-posts/edit.native.js.map +1 -1
- package/build-module/latest-posts/index.js +0 -1
- package/build-module/latest-posts/index.js.map +1 -1
- package/build-module/list/deprecated.js +12 -10
- package/build-module/list/deprecated.js.map +1 -1
- package/build-module/list/edit.js +4 -4
- package/build-module/list/edit.js.map +1 -1
- package/build-module/list/ordered-list-settings.js +26 -2
- package/build-module/list/ordered-list-settings.js.map +1 -1
- package/build-module/list/save.js +6 -5
- package/build-module/list/save.js.map +1 -1
- package/build-module/list/tag-name.js +4 -4
- package/build-module/list/tag-name.js.map +1 -1
- package/build-module/list/tag-name.native.js +4 -4
- package/build-module/list/tag-name.native.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/edit.native.js +2 -1
- package/build-module/list-item/edit.native.js.map +1 -1
- package/build-module/list-item/save.js +2 -1
- package/build-module/list-item/save.js.map +1 -1
- package/build-module/{private-apis.js → lock-unlock.js} +1 -1
- package/build-module/lock-unlock.js.map +1 -0
- package/build-module/loginout/edit.js +4 -3
- package/build-module/loginout/edit.js.map +1 -1
- package/build-module/loginout/index.js +0 -1
- package/build-module/loginout/index.js.map +1 -1
- package/build-module/media-text/deprecated.js +43 -33
- package/build-module/media-text/deprecated.js.map +1 -1
- package/build-module/media-text/edit.js +6 -3
- package/build-module/media-text/edit.js.map +1 -1
- package/build-module/media-text/media-container.js +8 -6
- package/build-module/media-text/media-container.js.map +1 -1
- package/build-module/media-text/media-container.native.js +8 -7
- package/build-module/media-text/media-container.native.js.map +1 -1
- package/build-module/media-text/save.js +17 -13
- package/build-module/media-text/save.js.map +1 -1
- package/build-module/missing/edit.js +4 -3
- package/build-module/missing/edit.js.map +1 -1
- package/build-module/more/edit.js +2 -1
- package/build-module/more/edit.js.map +1 -1
- package/build-module/navigation/constants.js +6 -0
- package/build-module/navigation/constants.js.map +1 -1
- package/build-module/navigation/deprecated.js +1 -1
- package/build-module/navigation/deprecated.js.map +1 -1
- package/build-module/navigation/edit/index.js +34 -21
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/inner-blocks.js +2 -1
- package/build-module/navigation/edit/inner-blocks.js.map +1 -1
- package/build-module/navigation/edit/leaf-more-menu.js +5 -6
- package/build-module/navigation/edit/leaf-more-menu.js.map +1 -1
- package/build-module/navigation/edit/menu-inspector-controls.js +12 -16
- package/build-module/navigation/edit/menu-inspector-controls.js.map +1 -1
- package/build-module/navigation/edit/navigation-menu-selector.js +15 -7
- package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build-module/navigation/edit/responsive-wrapper.js +2 -1
- package/build-module/navigation/edit/responsive-wrapper.js.map +1 -1
- package/build-module/navigation/edit/unsaved-inner-blocks.js +4 -6
- package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build-module/navigation/index.js +2 -3
- package/build-module/navigation/index.js.map +1 -1
- package/build-module/navigation/use-navigation-menu.js +8 -7
- package/build-module/navigation/use-navigation-menu.js.map +1 -1
- package/build-module/navigation/view-modal.js +58 -0
- package/build-module/navigation/view-modal.js.map +1 -0
- package/build-module/navigation/view.js +59 -0
- package/build-module/navigation/view.js.map +1 -0
- package/build-module/navigation-link/edit.js +4 -2
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +4 -2
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/nextpage/edit.js +2 -1
- package/build-module/nextpage/edit.js.map +1 -1
- package/build-module/page-list/edit.js +12 -6
- package/build-module/page-list/edit.js.map +1 -1
- package/build-module/page-list/index.js +0 -1
- package/build-module/page-list/index.js.map +1 -1
- package/build-module/page-list-item/edit.js +2 -1
- package/build-module/page-list-item/edit.js.map +1 -1
- package/build-module/paragraph/deprecated.js +5 -4
- package/build-module/paragraph/deprecated.js.map +1 -1
- package/build-module/paragraph/edit.js +4 -5
- package/build-module/paragraph/edit.js.map +1 -1
- package/build-module/paragraph/save.js +5 -4
- package/build-module/paragraph/save.js.map +1 -1
- package/build-module/pattern/edit.js +8 -33
- package/build-module/pattern/edit.js.map +1 -1
- package/build-module/pattern/index.js +4 -11
- package/build-module/pattern/index.js.map +1 -1
- package/build-module/post-author/edit.js +4 -2
- package/build-module/post-author/edit.js.map +1 -1
- package/build-module/post-author/index.js +0 -1
- package/build-module/post-author/index.js.map +1 -1
- package/build-module/post-author-biography/edit.js +2 -3
- package/build-module/post-author-biography/edit.js.map +1 -1
- package/build-module/post-author-biography/index.js +0 -1
- package/build-module/post-author-biography/index.js.map +1 -1
- package/build-module/post-author-name/edit.js +2 -1
- package/build-module/post-author-name/edit.js.map +1 -1
- package/build-module/post-author-name/index.js +0 -1
- package/build-module/post-author-name/index.js.map +1 -1
- package/build-module/post-comment/edit.js +4 -2
- package/build-module/post-comment/edit.js.map +1 -1
- package/build-module/post-comment/save.js +2 -1
- package/build-module/post-comment/save.js.map +1 -1
- package/build-module/post-comments-count/edit.js +2 -3
- package/build-module/post-comments-count/edit.js.map +1 -1
- package/build-module/post-comments-count/index.js +0 -1
- package/build-module/post-comments-count/index.js.map +1 -1
- package/build-module/post-comments-form/edit.js +2 -1
- package/build-module/post-comments-form/edit.js.map +1 -1
- package/build-module/post-comments-form/index.js +0 -1
- package/build-module/post-comments-form/index.js.map +1 -1
- package/build-module/post-comments-link/edit.js +2 -1
- package/build-module/post-comments-link/edit.js.map +1 -1
- package/build-module/post-comments-link/index.js +0 -1
- package/build-module/post-comments-link/index.js.map +1 -1
- package/build-module/post-content/edit.js +11 -7
- package/build-module/post-content/edit.js.map +1 -1
- package/build-module/post-content/index.js +1 -2
- package/build-module/post-content/index.js.map +1 -1
- package/build-module/post-date/edit.js +2 -1
- package/build-module/post-date/edit.js.map +1 -1
- package/build-module/post-date/index.js +0 -1
- package/build-module/post-date/index.js.map +1 -1
- package/build-module/post-excerpt/edit.js +6 -3
- package/build-module/post-excerpt/edit.js.map +1 -1
- package/build-module/post-excerpt/index.js +0 -1
- package/build-module/post-excerpt/index.js.map +1 -1
- package/build-module/post-featured-image/edit.js +4 -2
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/post-featured-image/index.js +0 -1
- package/build-module/post-featured-image/index.js.map +1 -1
- package/build-module/post-featured-image/overlay.js +4 -4
- package/build-module/post-featured-image/overlay.js.map +1 -1
- package/build-module/post-navigation-link/edit.js +2 -1
- package/build-module/post-navigation-link/edit.js.map +1 -1
- package/build-module/post-navigation-link/index.js +0 -1
- package/build-module/post-navigation-link/index.js.map +1 -1
- package/build-module/post-template/edit.js +14 -8
- package/build-module/post-template/edit.js.map +1 -1
- package/build-module/post-template/index.js +1 -2
- package/build-module/post-template/index.js.map +1 -1
- package/build-module/post-terms/edit.js +4 -8
- package/build-module/post-terms/edit.js.map +1 -1
- package/build-module/post-terms/hooks.js +9 -5
- package/build-module/post-terms/hooks.js.map +1 -1
- package/build-module/post-terms/index.js +0 -1
- package/build-module/post-terms/index.js.map +1 -1
- package/build-module/post-time-to-read/edit.js +2 -1
- package/build-module/post-time-to-read/edit.js.map +1 -1
- package/build-module/post-time-to-read/init.js +6 -0
- package/build-module/post-time-to-read/init.js.map +1 -0
- package/build-module/post-title/edit.js +15 -13
- package/build-module/post-title/edit.js.map +1 -1
- package/build-module/post-title/index.js +0 -1
- package/build-module/post-title/index.js.map +1 -1
- package/build-module/preformatted/edit.js +4 -5
- package/build-module/preformatted/edit.js.map +1 -1
- package/build-module/preformatted/edit.native.js +2 -1
- package/build-module/preformatted/edit.native.js.map +1 -1
- package/build-module/preformatted/save.js +2 -1
- package/build-module/preformatted/save.js.map +1 -1
- package/build-module/pullquote/deprecated.js +10 -8
- package/build-module/pullquote/deprecated.js.map +1 -1
- package/build-module/pullquote/edit.js +2 -1
- package/build-module/pullquote/edit.js.map +1 -1
- package/build-module/pullquote/edit.native.js +2 -1
- package/build-module/pullquote/edit.native.js.map +1 -1
- package/build-module/pullquote/save.js +5 -4
- package/build-module/pullquote/save.js.map +1 -1
- package/build-module/query/deprecated.js +15 -9
- package/build-module/query/deprecated.js.map +1 -1
- package/build-module/query/edit/index.js +2 -3
- package/build-module/query/edit/index.js.map +1 -1
- package/build-module/query/edit/inspector-controls/index.js +3 -2
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/query/edit/query-content.js +19 -6
- package/build-module/query/edit/query-content.js.map +1 -1
- package/build-module/query/edit/query-placeholder.js +4 -2
- package/build-module/query/edit/query-placeholder.js.map +1 -1
- package/build-module/query/index.js +1 -2
- package/build-module/query/index.js.map +1 -1
- package/build-module/query/save.js +2 -1
- package/build-module/query/save.js.map +1 -1
- package/build-module/query/utils.js +1 -2
- package/build-module/query/utils.js.map +1 -1
- package/build-module/query-no-results/edit.js +2 -1
- package/build-module/query-no-results/edit.js.map +1 -1
- package/build-module/query-no-results/index.js +0 -1
- package/build-module/query-no-results/index.js.map +1 -1
- package/build-module/query-pagination/deprecated.js +2 -1
- package/build-module/query-pagination/deprecated.js.map +1 -1
- package/build-module/query-pagination/edit.js +2 -1
- package/build-module/query-pagination/edit.js.map +1 -1
- package/build-module/query-pagination/index.js +1 -2
- package/build-module/query-pagination/index.js.map +1 -1
- package/build-module/query-pagination-next/edit.js +4 -4
- package/build-module/query-pagination-next/edit.js.map +1 -1
- package/build-module/query-pagination-next/index.js +0 -1
- package/build-module/query-pagination-next/index.js.map +1 -1
- package/build-module/query-pagination-numbers/edit.js +2 -1
- package/build-module/query-pagination-numbers/edit.js.map +1 -1
- package/build-module/query-pagination-numbers/index.js +0 -1
- package/build-module/query-pagination-numbers/index.js.map +1 -1
- package/build-module/query-pagination-previous/edit.js +4 -4
- package/build-module/query-pagination-previous/edit.js.map +1 -1
- package/build-module/query-pagination-previous/index.js +0 -1
- package/build-module/query-pagination-previous/index.js.map +1 -1
- package/build-module/query-title/edit.js +8 -10
- package/build-module/query-title/edit.js.map +1 -1
- package/build-module/query-title/index.js +0 -1
- package/build-module/query-title/index.js.map +1 -1
- package/build-module/quote/deprecated.js +4 -3
- package/build-module/quote/deprecated.js.map +1 -1
- package/build-module/quote/edit.js +7 -6
- package/build-module/quote/edit.js.map +1 -1
- package/build-module/quote/save.js +4 -3
- package/build-module/quote/save.js.map +1 -1
- package/build-module/read-more/edit.js +4 -4
- package/build-module/read-more/edit.js.map +1 -1
- package/build-module/read-more/index.js +0 -1
- package/build-module/read-more/index.js.map +1 -1
- package/build-module/rss/edit.js +4 -2
- package/build-module/rss/edit.js.map +1 -1
- package/build-module/rss/index.js +0 -1
- package/build-module/rss/index.js.map +1 -1
- package/build-module/search/edit.js +4 -3
- package/build-module/search/edit.js.map +1 -1
- package/build-module/search/edit.native.js +6 -7
- package/build-module/search/edit.native.js.map +1 -1
- package/build-module/search/index.js +0 -1
- package/build-module/search/index.js.map +1 -1
- package/build-module/separator/deprecated.js +5 -4
- package/build-module/separator/deprecated.js.map +1 -1
- package/build-module/separator/edit.js +5 -4
- package/build-module/separator/edit.js.map +1 -1
- package/build-module/separator/save.js +5 -4
- package/build-module/separator/save.js.map +1 -1
- package/build-module/shortcode/edit.js +4 -3
- package/build-module/shortcode/edit.js.map +1 -1
- package/build-module/site-logo/edit.js +10 -9
- package/build-module/site-logo/edit.js.map +1 -1
- package/build-module/site-logo/index.js +0 -1
- package/build-module/site-logo/index.js.map +1 -1
- package/build-module/site-tagline/edit.js +5 -4
- package/build-module/site-tagline/edit.js.map +1 -1
- package/build-module/site-tagline/icon.js +0 -3
- package/build-module/site-tagline/icon.js.map +1 -1
- package/build-module/site-tagline/index.js +0 -1
- package/build-module/site-tagline/index.js.map +1 -1
- package/build-module/site-title/edit/index.js +9 -10
- package/build-module/site-title/edit/index.js.map +1 -1
- package/build-module/site-title/index.js +0 -1
- package/build-module/site-title/index.js.map +1 -1
- package/build-module/social-link/edit.js +2 -1
- package/build-module/social-link/edit.js.map +1 -1
- package/build-module/social-link/index.js +0 -1
- package/build-module/social-link/index.js.map +1 -1
- package/build-module/social-links/deprecated.js +5 -4
- package/build-module/social-links/deprecated.js.map +1 -1
- package/build-module/social-links/edit.js +6 -5
- package/build-module/social-links/edit.js.map +1 -1
- package/build-module/social-links/index.js +1 -1
- package/build-module/social-links/save.js +2 -1
- package/build-module/social-links/save.js.map +1 -1
- package/build-module/spacer/deprecated.js +8 -7
- package/build-module/spacer/deprecated.js.map +1 -1
- package/build-module/spacer/edit.js +10 -9
- package/build-module/spacer/edit.js.map +1 -1
- package/build-module/spacer/edit.native.js +4 -4
- package/build-module/spacer/edit.native.js.map +1 -1
- package/build-module/spacer/save.js +21 -11
- package/build-module/spacer/save.js.map +1 -1
- package/build-module/spacer/save.native.js +8 -7
- package/build-module/spacer/save.native.js.map +1 -1
- package/build-module/table/deprecated.js +4 -2
- package/build-module/table/deprecated.js.map +1 -1
- package/build-module/table/edit.js +6 -4
- package/build-module/table/edit.js.map +1 -1
- package/build-module/table/save.js +2 -1
- package/build-module/table/save.js.map +1 -1
- package/build-module/table-of-contents/edit.js +4 -2
- package/build-module/table-of-contents/edit.js.map +1 -1
- package/build-module/table-of-contents/save.js +2 -1
- package/build-module/table-of-contents/save.js.map +1 -1
- package/build-module/tag-cloud/edit.js +2 -1
- package/build-module/tag-cloud/edit.js.map +1 -1
- package/build-module/tag-cloud/index.js +0 -1
- package/build-module/tag-cloud/index.js.map +1 -1
- package/build-module/template-part/edit/index.js +8 -4
- package/build-module/template-part/edit/index.js.map +1 -1
- package/build-module/template-part/edit/inner-blocks.js +3 -2
- package/build-module/template-part/edit/inner-blocks.js.map +1 -1
- package/build-module/template-part/index.js +0 -1
- package/build-module/template-part/index.js.map +1 -1
- package/build-module/term-description/edit.js +2 -1
- package/build-module/term-description/edit.js.map +1 -1
- package/build-module/term-description/index.js +0 -1
- package/build-module/term-description/index.js.map +1 -1
- package/build-module/text-columns/edit.js +4 -3
- package/build-module/text-columns/edit.js.map +1 -1
- package/build-module/text-columns/save.js +4 -3
- package/build-module/text-columns/save.js.map +1 -1
- package/build-module/utils/interactivity/directives.js +4 -4
- package/build-module/utils/interactivity/directives.js.map +1 -1
- package/build-module/utils/interactivity/index.js +1 -3
- package/build-module/utils/interactivity/index.js.map +1 -1
- package/build-module/utils/migrate-font-family.js +1 -1
- package/build-module/utils/migrate-font-family.js.map +1 -1
- package/build-module/verse/deprecated.js +4 -3
- package/build-module/verse/deprecated.js.map +1 -1
- package/build-module/verse/edit.js +4 -5
- package/build-module/verse/edit.js.map +1 -1
- package/build-module/verse/save.js +4 -3
- package/build-module/verse/save.js.map +1 -1
- package/build-module/video/deprecated.js +2 -1
- package/build-module/video/deprecated.js.map +1 -1
- package/build-module/video/edit.js +4 -2
- package/build-module/video/edit.js.map +1 -1
- package/build-module/video/edit.native.js +8 -7
- package/build-module/video/edit.native.js.map +1 -1
- package/build-module/video/save.js +2 -1
- package/build-module/video/save.js.map +1 -1
- package/build-module/video/tracks.js +4 -4
- package/build-module/video/tracks.js.map +1 -1
- package/build-style/avatar/style-rtl.css +1 -0
- package/build-style/avatar/style.css +1 -0
- package/build-style/editor-rtl.css +0 -17
- package/build-style/editor.css +0 -17
- package/build-style/footnotes/style-rtl.css +106 -0
- package/build-style/footnotes/style.css +106 -0
- package/build-style/image/style-rtl.css +71 -11
- package/build-style/image/style.css +71 -11
- package/build-style/navigation/editor-rtl.css +0 -17
- package/build-style/navigation/editor.css +0 -17
- package/build-style/style-rtl.css +91 -12
- package/build-style/style.css +91 -12
- package/package.json +33 -32
- package/src/archives/block.json +0 -1
- package/src/avatar/block.json +0 -1
- package/src/avatar/style.scss +1 -0
- package/src/block/block.json +1 -1
- package/src/block/edit.js +1 -0
- package/src/block/test/__snapshots__/transforms.native.js.snap +2 -2
- package/src/block/test/edit.native.js +5 -7
- package/src/block/test/transforms.native.js +1 -1
- package/src/buttons/block.json +1 -1
- package/src/buttons/edit.native.js +7 -6
- package/src/buttons/test/__snapshots__/edit.native.js.snap +6 -0
- package/src/buttons/test/edit.native.js +30 -2
- package/src/calendar/block.json +0 -1
- package/src/categories/block.json +0 -1
- package/src/column/block.json +1 -1
- package/src/columns/block.json +1 -1
- package/src/columns/test/edit.native.js +36 -32
- package/src/comment-author-avatar/block.json +0 -1
- package/src/comment-author-name/block.json +0 -1
- package/src/comment-content/block.json +0 -1
- package/src/comment-date/block.json +0 -1
- package/src/comment-edit-link/block.json +0 -1
- package/src/comment-reply-link/block.json +0 -1
- package/src/comment-template/block.json +0 -1
- package/src/comments/block.json +0 -1
- package/src/comments-pagination/block.json +1 -2
- package/src/comments-pagination-next/block.json +0 -1
- package/src/comments-pagination-numbers/block.json +0 -1
- package/src/comments-pagination-previous/block.json +0 -1
- package/src/comments-title/edit.js +2 -6
- package/src/cover/block.json +1 -1
- package/src/cover/edit/resizable-cover-popover.js +1 -1
- package/src/cover/test/edit.native.js +45 -31
- package/src/cover/transforms.js +1 -1
- package/src/details/block.json +1 -1
- package/src/details/edit.js +12 -9
- package/src/details/init.js +6 -0
- package/src/embed/test/index.native.js +38 -44
- package/src/file/block.json +1 -1
- package/src/file/index.php +18 -1
- package/src/file/view.js +9 -0
- package/src/footnotes/block.json +18 -0
- package/src/footnotes/edit.js +52 -0
- package/src/footnotes/format.js +112 -0
- package/src/footnotes/index.js +29 -0
- package/src/footnotes/index.php +78 -0
- package/src/footnotes/style.scss +18 -0
- package/src/gallery/block.json +1 -1
- package/src/gallery/edit.js +4 -1
- package/src/gallery/gallery.native.js +1 -1
- package/src/gallery/test/__snapshots__/index.native.js.snap +6 -0
- package/src/gallery/test/index.native.js +23 -1
- package/src/group/block.json +1 -1
- package/src/group/deprecated.js +1 -1
- package/src/group/test/edit.native.js +2 -4
- package/src/heading/edit.js +2 -2
- package/src/home-link/block.json +0 -1
- package/src/image/edit.js +1 -1
- package/src/image/image.js +23 -11
- package/src/image/interactivity.js +155 -13
- package/src/image/style.scss +79 -9
- package/src/image/test/edit.native.js +3 -13
- package/src/index.js +2 -0
- package/src/latest-comments/block.json +0 -1
- package/src/latest-posts/block.json +0 -1
- package/src/latest-posts/edit.js +17 -9
- package/src/latest-posts/index.php +8 -0
- package/src/list/ordered-list-settings.js +20 -2
- package/src/list/test/edit.native.js +5 -0
- package/src/loginout/block.json +0 -1
- package/src/media-text/edit.js +1 -1
- package/src/navigation/block.json +2 -3
- package/src/navigation/constants.js +11 -0
- package/src/navigation/deprecated.js +1 -1
- package/src/navigation/edit/index.js +15 -6
- package/src/navigation/edit/leaf-more-menu.js +1 -2
- package/src/navigation/edit/menu-inspector-controls.js +24 -26
- package/src/navigation/edit/navigation-menu-selector.js +17 -7
- package/src/navigation/edit/unsaved-inner-blocks.js +6 -6
- package/src/navigation/editor.scss +0 -24
- package/src/navigation/index.php +85 -70
- package/src/navigation/test/use-navigation-menu.js +15 -3
- package/src/navigation/use-navigation-menu.js +11 -8
- package/src/navigation/view-modal.js +78 -0
- package/src/navigation/view.js +74 -0
- package/src/page-list/block.json +0 -1
- package/src/paragraph/test/__snapshots__/edit.native.js.snap +39 -0
- package/src/paragraph/test/edit.native.js +3 -3
- package/src/pattern/block.json +1 -5
- package/src/pattern/edit.js +14 -40
- package/src/pattern/index.js +4 -5
- package/src/pattern/index.php +1 -13
- package/src/post-author/block.json +0 -1
- package/src/post-author/edit.js +3 -3
- package/src/post-author-biography/block.json +0 -1
- package/src/post-author-name/block.json +0 -1
- package/src/post-comments-count/block.json +0 -1
- package/src/post-comments-form/block.json +0 -1
- package/src/post-comments-link/block.json +0 -1
- package/src/post-content/block.json +1 -2
- package/src/post-date/block.json +0 -1
- package/src/post-excerpt/block.json +0 -1
- package/src/post-featured-image/block.json +0 -1
- package/src/post-navigation-link/block.json +0 -1
- package/src/post-template/block.json +1 -2
- package/src/post-template/edit.js +4 -1
- package/src/post-template/index.php +5 -0
- package/src/post-terms/block.json +0 -1
- package/src/post-terms/edit.js +8 -7
- package/src/post-terms/hooks.js +3 -3
- package/src/post-time-to-read/init.js +6 -0
- package/src/post-title/block.json +0 -1
- package/src/post-title/edit.js +4 -4
- package/src/post-title/index.php +1 -1
- package/src/preformatted/test/edit.native.js +1 -13
- package/src/query/block.json +1 -2
- package/src/query/deprecated.js +7 -5
- package/src/query/edit/inspector-controls/index.js +1 -1
- package/src/query/edit/query-content.js +13 -4
- package/src/query-no-results/block.json +0 -1
- package/src/query-pagination/block.json +1 -2
- package/src/query-pagination-next/block.json +0 -1
- package/src/query-pagination-numbers/block.json +0 -1
- package/src/query-pagination-previous/block.json +0 -1
- package/src/query-title/block.json +0 -1
- package/src/query-title/edit.js +2 -6
- package/src/read-more/block.json +0 -1
- package/src/rss/block.json +0 -1
- package/src/search/block.json +0 -1
- package/src/search/edit.js +3 -3
- package/src/site-logo/block.json +0 -1
- package/src/site-tagline/block.json +0 -1
- package/src/site-tagline/icon.js +0 -1
- package/src/site-title/block.json +0 -1
- package/src/site-title/edit/index.js +5 -6
- package/src/social-link/block.json +0 -1
- package/src/social-links/block.json +1 -1
- package/src/spacer/save.js +7 -2
- package/src/spacer/test/index.native.js +33 -29
- package/src/style.scss +1 -0
- package/src/tag-cloud/block.json +0 -1
- package/src/template-part/block.json +0 -1
- package/src/template-part/edit/inner-blocks.js +1 -1
- package/src/template-part/index.php +18 -11
- package/src/term-description/block.json +0 -1
- package/src/utils/interactivity/index.js +0 -2
- package/src/utils/migrate-font-family.js +1 -1
- package/build/heading/heading-level-dropdown.js +0 -81
- package/build/heading/heading-level-dropdown.js.map +0 -1
- package/build/heading/heading-level-dropdown.native.js +0 -72
- package/build/heading/heading-level-dropdown.native.js.map +0 -1
- package/build/pattern/v1/edit.js +0 -56
- package/build/pattern/v1/edit.js.map +0 -1
- package/build/private-apis.js.map +0 -1
- package/build/site-title/edit/level-icon.js +0 -40
- package/build/site-title/edit/level-icon.js.map +0 -1
- package/build/site-title/edit/level-toolbar.js +0 -51
- package/build/site-title/edit/level-toolbar.js.map +0 -1
- package/build-module/heading/heading-level-dropdown.js +0 -69
- package/build-module/heading/heading-level-dropdown.js.map +0 -1
- package/build-module/heading/heading-level-dropdown.native.js +0 -60
- package/build-module/heading/heading-level-dropdown.native.js.map +0 -1
- package/build-module/pattern/v1/edit.js +0 -47
- package/build-module/pattern/v1/edit.js.map +0 -1
- package/build-module/private-apis.js.map +0 -1
- package/build-module/site-title/edit/level-icon.js +0 -31
- package/build-module/site-title/edit/level-icon.js.map +0 -1
- package/build-module/site-title/edit/level-toolbar.js +0 -39
- package/build-module/site-title/edit/level-toolbar.js.map +0 -1
- package/src/heading/heading-level-dropdown.js +0 -69
- package/src/heading/heading-level-dropdown.native.js +0 -63
- package/src/pattern/v1/edit.js +0 -57
- package/src/site-title/edit/level-icon.js +0 -28
- package/src/site-title/edit/level-toolbar.js +0 -34
- /package/src/{private-apis.js → lock-unlock.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/query/edit/inspector-controls/index.js"],"names":["PanelBody","TextControl","SelectControl","RangeControl","ToggleControl","Notice","__experimentalToolsPanel","ToolsPanel","__experimentalToolsPanelItem","ToolsPanelItem","__","InspectorControls","privateApis","blockEditorPrivateApis","debounce","useEffect","useState","useCallback","OrderControl","AuthorControl","ParentControl","TaxonomyControls","StickyControl","CreateNewPostLink","unlock","usePostTypes","useIsPostTypeHierarchical","useAllowedControls","isControlAllowed","useTaxonomies","BlockInfo","QueryInspectorControls","props","attributes","setQuery","setDisplayLayout","query","displayLayout","order","orderBy","author","authorIds","postType","sticky","inherit","taxQuery","parents","allowedControls","showSticky","setShowSticky","postTypesTaxonomiesMap","postTypesSelectOptions","taxonomies","isPostTypeHierarchical","onPostTypeChange","newValue","updateQuery","supportedTaxonomies","updatedTaxQuery","Object","entries","reduce","accumulator","taxonomySlug","terms","includes","keys","length","undefined","querySearch","setQuerySearch","search","onChangeDebounced","cancel","showInheritControl","showPostTypeControl","showColumnsControl","showOrderControl","showStickyControl","showSettingsPanel","showTaxControl","showAuthorControl","showSearchControl","showParentControl","showFiltersPanel","value","columns","Math","max","values","some"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,SADD,EAECC,WAFD,EAGCC,aAHD,EAICC,YAJD,EAKCC,aALD,EAMCC,MAND,EAOCC,wBAAwB,IAAIC,UAP7B,EAQCC,4BAA4B,IAAIC,cARjC,QASO,uBATP;AAUA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SACCC,iBADD,EAECC,WAAW,IAAIC,sBAFhB,QAGO,yBAHP;AAIA,SAASC,QAAT,QAAyB,oBAAzB;AACA,SAASC,SAAT,EAAoBC,QAApB,EAA8BC,WAA9B,QAAiD,oBAAjD;AAEA;AACA;AACA;;AACA,OAAOC,YAAP,MAAyB,iBAAzB;AACA,OAAOC,aAAP,MAA0B,kBAA1B;AACA,OAAOC,aAAP,MAA0B,kBAA1B;AACA,SAASC,gBAAT,QAAiC,qBAAjC;AACA,OAAOC,aAAP,MAA0B,kBAA1B;AACA,OAAOC,iBAAP,MAA8B,wB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Q,EAAG,MAAM,CAAC,CAAEb,WADrB;AAEC,IAAA,KAAK,EAAG3D,EAAE,CAAE,SAAF,CAFX;AAGC,IAAA,UAAU,EAAG,MAAM4D,cAAc,CAAE,EAAF;AAHlC,KAKC,cAAC,WAAD;AACC,IAAA,uBAAuB,MADxB;AAEC,IAAA,KAAK,EAAG5D,EAAE,CAAE,SAAF,CAFX;AAGC,IAAA,KAAK,EAAG2D,WAHT;AAIC,IAAA,QAAQ,EAAGC;AAJZ,IALD,CA5CF,EAyDGa,iBAAiB,IAClB,cAAC,cAAD;AACC,IAAA,QAAQ,EAAG,MAAM,CAAC,CAAErC,OAAO,EAAEqB,MAD9B;AAEC,IAAA,KAAK,EAAGzD,EAAE,CAAE,SAAF,CAFX;AAGC,IAAA,UAAU,EAAG,MAAMwB,QAAQ,CAAE;AAAEY,MAAAA,OAAO,EAAE;AAAX,KAAF;AAH5B,KAKC,cAAC,aAAD;AACC,IAAA,OAAO,EAAGA,OADX;AAEC,IAAA,QAAQ,EAAGJ,QAFZ;AAGC,IAAA,QAAQ,EAAGR;AAHZ,IALD,CA1DF,CADD,CA5EF,CADD;AAyJA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tPanelBody,\n\tTextControl,\n\tSelectControl,\n\tRangeControl,\n\tToggleControl,\n\tNotice,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tInspectorControls,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { debounce } from '@wordpress/compose';\nimport { useEffect, useState, useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport OrderControl from './order-control';\nimport AuthorControl from './author-control';\nimport ParentControl from './parent-control';\nimport { TaxonomyControls } from './taxonomy-controls';\nimport StickyControl from './sticky-control';\nimport CreateNewPostLink from './create-new-post-link';\nimport { unlock } from '../../../private-apis';\nimport {\n\tusePostTypes,\n\tuseIsPostTypeHierarchical,\n\tuseAllowedControls,\n\tisControlAllowed,\n\tuseTaxonomies,\n} from '../../utils';\n\nconst { BlockInfo } = unlock( blockEditorPrivateApis );\n\nexport default function QueryInspectorControls( props ) {\n\tconst { attributes, setQuery, setDisplayLayout } = props;\n\tconst { query, displayLayout } = attributes;\n\tconst {\n\t\torder,\n\t\torderBy,\n\t\tauthor: authorIds,\n\t\tpostType,\n\t\tsticky,\n\t\tinherit,\n\t\ttaxQuery,\n\t\tparents,\n\t} = query;\n\tconst allowedControls = useAllowedControls( attributes );\n\tconst [ showSticky, setShowSticky ] = useState( postType === 'post' );\n\tconst { postTypesTaxonomiesMap, postTypesSelectOptions } = usePostTypes();\n\tconst taxonomies = useTaxonomies( postType );\n\tconst isPostTypeHierarchical = useIsPostTypeHierarchical( postType );\n\tuseEffect( () => {\n\t\tsetShowSticky( postType === 'post' );\n\t}, [ postType ] );\n\tconst onPostTypeChange = ( newValue ) => {\n\t\tconst updateQuery = { postType: newValue };\n\t\t// We need to dynamically update the `taxQuery` property,\n\t\t// by removing any not supported taxonomy from the query.\n\t\tconst supportedTaxonomies = postTypesTaxonomiesMap[ newValue ];\n\t\tconst updatedTaxQuery = Object.entries( taxQuery || {} ).reduce(\n\t\t\t( accumulator, [ taxonomySlug, terms ] ) => {\n\t\t\t\tif ( supportedTaxonomies.includes( taxonomySlug ) ) {\n\t\t\t\t\taccumulator[ taxonomySlug ] = terms;\n\t\t\t\t}\n\t\t\t\treturn accumulator;\n\t\t\t},\n\t\t\t{}\n\t\t);\n\t\tupdateQuery.taxQuery = !! Object.keys( updatedTaxQuery ).length\n\t\t\t? updatedTaxQuery\n\t\t\t: undefined;\n\n\t\tif ( newValue !== 'post' ) {\n\t\t\tupdateQuery.sticky = '';\n\t\t}\n\t\t// We need to reset `parents` because they are tied to each post type.\n\t\tupdateQuery.parents = [];\n\t\tsetQuery( updateQuery );\n\t};\n\tconst [ querySearch, setQuerySearch ] = useState( query.search );\n\tconst onChangeDebounced = useCallback(\n\t\tdebounce( () => {\n\t\t\tif ( query.search !== querySearch ) {\n\t\t\t\tsetQuery( { search: querySearch } );\n\t\t\t}\n\t\t}, 250 ),\n\t\t[ querySearch, query.search ]\n\t);\n\tuseEffect( () => {\n\t\tonChangeDebounced();\n\t\treturn onChangeDebounced.cancel;\n\t}, [ querySearch, onChangeDebounced ] );\n\tconst showInheritControl = isControlAllowed( allowedControls, 'inherit' );\n\tconst showPostTypeControl =\n\t\t! inherit && isControlAllowed( allowedControls, 'postType' );\n\tconst showColumnsControl = false;\n\tconst showOrderControl =\n\t\t! inherit && isControlAllowed( allowedControls, 'order' );\n\tconst showStickyControl =\n\t\t! inherit &&\n\t\tshowSticky &&\n\t\tisControlAllowed( allowedControls, 'sticky' );\n\tconst showSettingsPanel =\n\t\tshowInheritControl ||\n\t\tshowPostTypeControl ||\n\t\tshowColumnsControl ||\n\t\tshowOrderControl ||\n\t\tshowStickyControl;\n\tconst showTaxControl =\n\t\t!! taxonomies?.length &&\n\t\tisControlAllowed( allowedControls, 'taxQuery' );\n\tconst showAuthorControl = isControlAllowed( allowedControls, 'author' );\n\tconst showSearchControl = isControlAllowed( allowedControls, 'search' );\n\tconst showParentControl =\n\t\tisControlAllowed( allowedControls, 'parents' ) &&\n\t\tisPostTypeHierarchical;\n\n\tconst showFiltersPanel =\n\t\tshowTaxControl ||\n\t\tshowAuthorControl ||\n\t\tshowSearchControl ||\n\t\tshowParentControl;\n\n\treturn (\n\t\t<>\n\t\t\t<BlockInfo>\n\t\t\t\t<CreateNewPostLink { ...props } />\n\t\t\t</BlockInfo>\n\t\t\t{ showSettingsPanel && (\n\t\t\t\t<InspectorControls>\n\t\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t\t{ showInheritControl && (\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Inherit query from template' ) }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Toggle to use the global query context that is set with the current template, such as an archive or search. Disable to customize the settings independently.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tchecked={ !! inherit }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tsetQuery( { inherit: !! value } )\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\t{ showPostTypeControl && (\n\t\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\toptions={ postTypesSelectOptions }\n\t\t\t\t\t\t\t\tvalue={ postType }\n\t\t\t\t\t\t\t\tlabel={ __( 'Post type' ) }\n\t\t\t\t\t\t\t\tonChange={ onPostTypeChange }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'WordPress contains different types of content and they are divided into collections called “Post types”. By default there are a few different ones such as blog posts and pages, but plugins could add more.'\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\t{ showColumnsControl && (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Columns' ) }\n\t\t\t\t\t\t\t\t\tvalue={ displayLayout.columns }\n\t\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\t\tsetDisplayLayout( {\n\t\t\t\t\t\t\t\t\t\t\tcolumns: value,\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\tmin={ 2 }\n\t\t\t\t\t\t\t\t\tmax={ Math.max( 6, displayLayout.columns ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t{ displayLayout.columns > 6 && (\n\t\t\t\t\t\t\t\t\t<Notice\n\t\t\t\t\t\t\t\t\t\tstatus=\"warning\"\n\t\t\t\t\t\t\t\t\t\tisDismissible={ false }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t'This column count exceeds the recommended amount and may cause visual breakage.'\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t</Notice>\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\t{ showOrderControl && (\n\t\t\t\t\t\t\t<OrderControl\n\t\t\t\t\t\t\t\t{ ...{ order, orderBy } }\n\t\t\t\t\t\t\t\tonChange={ setQuery }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ showStickyControl && (\n\t\t\t\t\t\t\t<StickyControl\n\t\t\t\t\t\t\t\tvalue={ sticky }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tsetQuery( { sticky: value } )\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</PanelBody>\n\t\t\t\t</InspectorControls>\n\t\t\t) }\n\t\t\t{ ! inherit && showFiltersPanel && (\n\t\t\t\t<InspectorControls>\n\t\t\t\t\t<ToolsPanel\n\t\t\t\t\t\tclassName=\"block-library-query-toolspanel__filters\"\n\t\t\t\t\t\tlabel={ __( 'Filters' ) }\n\t\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\t\tsetQuery( {\n\t\t\t\t\t\t\t\tauthor: '',\n\t\t\t\t\t\t\t\tparents: [],\n\t\t\t\t\t\t\t\tsearch: '',\n\t\t\t\t\t\t\t\ttaxQuery: null,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\tsetQuerySearch( '' );\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ showTaxControl && (\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\tlabel={ __( 'Taxonomies' ) }\n\t\t\t\t\t\t\t\thasValue={ () =>\n\t\t\t\t\t\t\t\t\tObject.values( taxQuery || {} ).some(\n\t\t\t\t\t\t\t\t\t\t( terms ) => !! terms.length\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\tonDeselect={ () =>\n\t\t\t\t\t\t\t\t\tsetQuery( { taxQuery: null } )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<TaxonomyControls\n\t\t\t\t\t\t\t\t\tonChange={ setQuery }\n\t\t\t\t\t\t\t\t\tquery={ query }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ showAuthorControl && (\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\thasValue={ () => !! authorIds }\n\t\t\t\t\t\t\t\tlabel={ __( 'Authors' ) }\n\t\t\t\t\t\t\t\tonDeselect={ () => setQuery( { author: '' } ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<AuthorControl\n\t\t\t\t\t\t\t\t\tvalue={ authorIds }\n\t\t\t\t\t\t\t\t\tonChange={ setQuery }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ showSearchControl && (\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\thasValue={ () => !! querySearch }\n\t\t\t\t\t\t\t\tlabel={ __( 'Keyword' ) }\n\t\t\t\t\t\t\t\tonDeselect={ () => setQuerySearch( '' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Keyword' ) }\n\t\t\t\t\t\t\t\t\tvalue={ querySearch }\n\t\t\t\t\t\t\t\t\tonChange={ setQuerySearch }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ showParentControl && (\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\thasValue={ () => !! parents?.length }\n\t\t\t\t\t\t\t\tlabel={ __( 'Parents' ) }\n\t\t\t\t\t\t\t\tonDeselect={ () => setQuery( { parents: [] } ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<ParentControl\n\t\t\t\t\t\t\t\t\tparents={ parents }\n\t\t\t\t\t\t\t\t\tpostType={ postType }\n\t\t\t\t\t\t\t\t\tonChange={ setQuery }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</ToolsPanel>\n\t\t\t\t</InspectorControls>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/query/edit/inspector-controls/index.js"],"names":["PanelBody","TextControl","SelectControl","RangeControl","ToggleControl","Notice","__experimentalToolsPanel","ToolsPanel","__experimentalToolsPanelItem","ToolsPanelItem","__","InspectorControls","privateApis","blockEditorPrivateApis","debounce","useEffect","useState","useCallback","OrderControl","AuthorControl","ParentControl","TaxonomyControls","StickyControl","CreateNewPostLink","unlock","usePostTypes","useIsPostTypeHierarchical","useAllowedControls","isControlAllowed","useTaxonomies","BlockInfo","QueryInspectorControls","props","attributes","setQuery","setDisplayLayout","query","displayLayout","order","orderBy","author","authorIds","postType","sticky","inherit","taxQuery","parents","allowedControls","showSticky","setShowSticky","postTypesTaxonomiesMap","postTypesSelectOptions","taxonomies","isPostTypeHierarchical","onPostTypeChange","newValue","updateQuery","supportedTaxonomies","updatedTaxQuery","Object","entries","reduce","accumulator","taxonomySlug","terms","includes","keys","length","undefined","querySearch","setQuerySearch","search","onChangeDebounced","cancel","showInheritControl","showPostTypeControl","showColumnsControl","showOrderControl","showStickyControl","showSettingsPanel","showTaxControl","showAuthorControl","showSearchControl","showParentControl","showFiltersPanel","value","columns","Math","max","values","some"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,SADD,EAECC,WAFD,EAGCC,aAHD,EAICC,YAJD,EAKCC,aALD,EAMCC,MAND,EAOCC,wBAAwB,IAAIC,UAP7B,EAQCC,4BAA4B,IAAIC,cARjC,QASO,uBATP;AAUA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SACCC,iBADD,EAECC,WAAW,IAAIC,sBAFhB,QAGO,yBAHP;AAIA,SAASC,QAAT,QAAyB,oBAAzB;AACA,SAASC,SAAT,EAAoBC,QAApB,EAA8BC,WAA9B,QAAiD,oBAAjD;AAEA;AACA;AACA;;AACA,OAAOC,YAAP,MAAyB,iBAAzB;AACA,OAAOC,aAAP,MAA0B,kBAA1B;AACA,OAAOC,aAAP,MAA0B,kBAA1B;AACA,SAASC,gBAAT,QAAiC,qBAAjC;AACA,OAAOC,aAAP,MAA0B,kBAA1B;AACA,OAAOC,iBAAP,MAA8B,wBAA9B;AACA,SAASC,MAAT,QAAuB,sBAAvB;AACA,SACCC,YADD,EAECC,yBAFD,EAGCC,kBAHD,EAICC,gBAJD,EAKCC,aALD,QAMO,aANP;AAQA,MAAM;AAAEC,EAAAA;AAAF,IAAgBN,MAAM,CAAEX,sBAAF,CAA5B;AAEA,eAAe,SAASkB,sBAAT,CAAiCC,KAAjC,EAAyC;AACvD,QAAM;AAAEC,IAAAA,UAAF;AAAcC,IAAAA,QAAd;AAAwBC,IAAAA;AAAxB,MAA6CH,KAAnD;AACA,QAAM;AAAEI,IAAAA,KAAF;AAASC,IAAAA;AAAT,MAA2BJ,UAAjC;AACA,QAAM;AACLK,IAAAA,KADK;AAELC,IAAAA,OAFK;AAGLC,IAAAA,MAAM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FX;AAGC,IAAA,UAAU,EAAG,MAAMwB,QAAQ,CAAE;AAAEY,MAAAA,OAAO,EAAE;AAAX,KAAF;AAH5B,KAKC,cAAC,aAAD;AACC,IAAA,OAAO,EAAGA,OADX;AAEC,IAAA,QAAQ,EAAGJ,QAFZ;AAGC,IAAA,QAAQ,EAAGR;AAHZ,IALD,CA1DF,CADD,CA5EF,CADD;AAyJA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tPanelBody,\n\tTextControl,\n\tSelectControl,\n\tRangeControl,\n\tToggleControl,\n\tNotice,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tInspectorControls,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { debounce } from '@wordpress/compose';\nimport { useEffect, useState, useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport OrderControl from './order-control';\nimport AuthorControl from './author-control';\nimport ParentControl from './parent-control';\nimport { TaxonomyControls } from './taxonomy-controls';\nimport StickyControl from './sticky-control';\nimport CreateNewPostLink from './create-new-post-link';\nimport { unlock } from '../../../lock-unlock';\nimport {\n\tusePostTypes,\n\tuseIsPostTypeHierarchical,\n\tuseAllowedControls,\n\tisControlAllowed,\n\tuseTaxonomies,\n} from '../../utils';\n\nconst { BlockInfo } = unlock( blockEditorPrivateApis );\n\nexport default function QueryInspectorControls( props ) {\n\tconst { attributes, setQuery, setDisplayLayout } = props;\n\tconst { query, displayLayout } = attributes;\n\tconst {\n\t\torder,\n\t\torderBy,\n\t\tauthor: authorIds,\n\t\tpostType,\n\t\tsticky,\n\t\tinherit,\n\t\ttaxQuery,\n\t\tparents,\n\t} = query;\n\tconst allowedControls = useAllowedControls( attributes );\n\tconst [ showSticky, setShowSticky ] = useState( postType === 'post' );\n\tconst { postTypesTaxonomiesMap, postTypesSelectOptions } = usePostTypes();\n\tconst taxonomies = useTaxonomies( postType );\n\tconst isPostTypeHierarchical = useIsPostTypeHierarchical( postType );\n\tuseEffect( () => {\n\t\tsetShowSticky( postType === 'post' );\n\t}, [ postType ] );\n\tconst onPostTypeChange = ( newValue ) => {\n\t\tconst updateQuery = { postType: newValue };\n\t\t// We need to dynamically update the `taxQuery` property,\n\t\t// by removing any not supported taxonomy from the query.\n\t\tconst supportedTaxonomies = postTypesTaxonomiesMap[ newValue ];\n\t\tconst updatedTaxQuery = Object.entries( taxQuery || {} ).reduce(\n\t\t\t( accumulator, [ taxonomySlug, terms ] ) => {\n\t\t\t\tif ( supportedTaxonomies.includes( taxonomySlug ) ) {\n\t\t\t\t\taccumulator[ taxonomySlug ] = terms;\n\t\t\t\t}\n\t\t\t\treturn accumulator;\n\t\t\t},\n\t\t\t{}\n\t\t);\n\t\tupdateQuery.taxQuery = !! Object.keys( updatedTaxQuery ).length\n\t\t\t? updatedTaxQuery\n\t\t\t: undefined;\n\n\t\tif ( newValue !== 'post' ) {\n\t\t\tupdateQuery.sticky = '';\n\t\t}\n\t\t// We need to reset `parents` because they are tied to each post type.\n\t\tupdateQuery.parents = [];\n\t\tsetQuery( updateQuery );\n\t};\n\tconst [ querySearch, setQuerySearch ] = useState( query.search );\n\tconst onChangeDebounced = useCallback(\n\t\tdebounce( () => {\n\t\t\tif ( query.search !== querySearch ) {\n\t\t\t\tsetQuery( { search: querySearch } );\n\t\t\t}\n\t\t}, 250 ),\n\t\t[ querySearch, query.search ]\n\t);\n\tuseEffect( () => {\n\t\tonChangeDebounced();\n\t\treturn onChangeDebounced.cancel;\n\t}, [ querySearch, onChangeDebounced ] );\n\tconst showInheritControl = isControlAllowed( allowedControls, 'inherit' );\n\tconst showPostTypeControl =\n\t\t! inherit && isControlAllowed( allowedControls, 'postType' );\n\tconst showColumnsControl = false;\n\tconst showOrderControl =\n\t\t! inherit && isControlAllowed( allowedControls, 'order' );\n\tconst showStickyControl =\n\t\t! inherit &&\n\t\tshowSticky &&\n\t\tisControlAllowed( allowedControls, 'sticky' );\n\tconst showSettingsPanel =\n\t\tshowInheritControl ||\n\t\tshowPostTypeControl ||\n\t\tshowColumnsControl ||\n\t\tshowOrderControl ||\n\t\tshowStickyControl;\n\tconst showTaxControl =\n\t\t!! taxonomies?.length &&\n\t\tisControlAllowed( allowedControls, 'taxQuery' );\n\tconst showAuthorControl = isControlAllowed( allowedControls, 'author' );\n\tconst showSearchControl = isControlAllowed( allowedControls, 'search' );\n\tconst showParentControl =\n\t\tisControlAllowed( allowedControls, 'parents' ) &&\n\t\tisPostTypeHierarchical;\n\n\tconst showFiltersPanel =\n\t\tshowTaxControl ||\n\t\tshowAuthorControl ||\n\t\tshowSearchControl ||\n\t\tshowParentControl;\n\n\treturn (\n\t\t<>\n\t\t\t<BlockInfo>\n\t\t\t\t<CreateNewPostLink { ...props } />\n\t\t\t</BlockInfo>\n\t\t\t{ showSettingsPanel && (\n\t\t\t\t<InspectorControls>\n\t\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t\t{ showInheritControl && (\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Inherit query from template' ) }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Toggle to use the global query context that is set with the current template, such as an archive or search. Disable to customize the settings independently.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tchecked={ !! inherit }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tsetQuery( { inherit: !! value } )\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\t{ showPostTypeControl && (\n\t\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\toptions={ postTypesSelectOptions }\n\t\t\t\t\t\t\t\tvalue={ postType }\n\t\t\t\t\t\t\t\tlabel={ __( 'Post type' ) }\n\t\t\t\t\t\t\t\tonChange={ onPostTypeChange }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'WordPress contains different types of content and they are divided into collections called “Post types”. By default there are a few different ones such as blog posts and pages, but plugins could add more.'\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\t{ showColumnsControl && (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Columns' ) }\n\t\t\t\t\t\t\t\t\tvalue={ displayLayout.columns }\n\t\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\t\tsetDisplayLayout( {\n\t\t\t\t\t\t\t\t\t\t\tcolumns: value,\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\tmin={ 2 }\n\t\t\t\t\t\t\t\t\tmax={ Math.max( 6, displayLayout.columns ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t{ displayLayout.columns > 6 && (\n\t\t\t\t\t\t\t\t\t<Notice\n\t\t\t\t\t\t\t\t\t\tstatus=\"warning\"\n\t\t\t\t\t\t\t\t\t\tisDismissible={ false }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t'This column count exceeds the recommended amount and may cause visual breakage.'\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t</Notice>\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\t{ showOrderControl && (\n\t\t\t\t\t\t\t<OrderControl\n\t\t\t\t\t\t\t\t{ ...{ order, orderBy } }\n\t\t\t\t\t\t\t\tonChange={ setQuery }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ showStickyControl && (\n\t\t\t\t\t\t\t<StickyControl\n\t\t\t\t\t\t\t\tvalue={ sticky }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tsetQuery( { sticky: value } )\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</PanelBody>\n\t\t\t\t</InspectorControls>\n\t\t\t) }\n\t\t\t{ ! inherit && showFiltersPanel && (\n\t\t\t\t<InspectorControls>\n\t\t\t\t\t<ToolsPanel\n\t\t\t\t\t\tclassName=\"block-library-query-toolspanel__filters\"\n\t\t\t\t\t\tlabel={ __( 'Filters' ) }\n\t\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\t\tsetQuery( {\n\t\t\t\t\t\t\t\tauthor: '',\n\t\t\t\t\t\t\t\tparents: [],\n\t\t\t\t\t\t\t\tsearch: '',\n\t\t\t\t\t\t\t\ttaxQuery: null,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\tsetQuerySearch( '' );\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ showTaxControl && (\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\tlabel={ __( 'Taxonomies' ) }\n\t\t\t\t\t\t\t\thasValue={ () =>\n\t\t\t\t\t\t\t\t\tObject.values( taxQuery || {} ).some(\n\t\t\t\t\t\t\t\t\t\t( terms ) => !! terms.length\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\tonDeselect={ () =>\n\t\t\t\t\t\t\t\t\tsetQuery( { taxQuery: null } )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<TaxonomyControls\n\t\t\t\t\t\t\t\t\tonChange={ setQuery }\n\t\t\t\t\t\t\t\t\tquery={ query }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ showAuthorControl && (\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\thasValue={ () => !! authorIds }\n\t\t\t\t\t\t\t\tlabel={ __( 'Authors' ) }\n\t\t\t\t\t\t\t\tonDeselect={ () => setQuery( { author: '' } ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<AuthorControl\n\t\t\t\t\t\t\t\t\tvalue={ authorIds }\n\t\t\t\t\t\t\t\t\tonChange={ setQuery }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ showSearchControl && (\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\thasValue={ () => !! querySearch }\n\t\t\t\t\t\t\t\tlabel={ __( 'Keyword' ) }\n\t\t\t\t\t\t\t\tonDeselect={ () => setQuerySearch( '' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Keyword' ) }\n\t\t\t\t\t\t\t\t\tvalue={ querySearch }\n\t\t\t\t\t\t\t\t\tonChange={ setQuerySearch }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ showParentControl && (\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\thasValue={ () => !! parents?.length }\n\t\t\t\t\t\t\t\tlabel={ __( 'Parents' ) }\n\t\t\t\t\t\t\t\tonDeselect={ () => setQuery( { parents: [] } ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<ParentControl\n\t\t\t\t\t\t\t\t\tparents={ parents }\n\t\t\t\t\t\t\t\t\tpostType={ postType }\n\t\t\t\t\t\t\t\t\tonChange={ setQuery }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</ToolsPanel>\n\t\t\t\t</InspectorControls>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"]}
|
|
@@ -9,6 +9,7 @@ import { useEffect } from '@wordpress/element';
|
|
|
9
9
|
import { BlockControls, InspectorControls, useBlockProps, store as blockEditorStore, useInnerBlocksProps } from '@wordpress/block-editor';
|
|
10
10
|
import { SelectControl } from '@wordpress/components';
|
|
11
11
|
import { __ } from '@wordpress/i18n';
|
|
12
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
12
13
|
/**
|
|
13
14
|
* Internal dependencies
|
|
14
15
|
*/
|
|
@@ -28,7 +29,10 @@ export default function QueryContent({
|
|
|
28
29
|
queryId,
|
|
29
30
|
query,
|
|
30
31
|
displayLayout,
|
|
31
|
-
tagName: TagName = 'div'
|
|
32
|
+
tagName: TagName = 'div',
|
|
33
|
+
query: {
|
|
34
|
+
inherit
|
|
35
|
+
} = {}
|
|
32
36
|
} = attributes;
|
|
33
37
|
const {
|
|
34
38
|
__unstableMarkNextChangeAsNotPersistent
|
|
@@ -44,8 +48,13 @@ export default function QueryContent({
|
|
|
44
48
|
const {
|
|
45
49
|
getSettings
|
|
46
50
|
} = select(blockEditorStore);
|
|
51
|
+
const {
|
|
52
|
+
getEntityRecord,
|
|
53
|
+
canUser
|
|
54
|
+
} = select(coreStore);
|
|
55
|
+
const settingPerPage = canUser('read', 'settings') ? +getEntityRecord('root', 'site')?.posts_per_page : +getSettings().postsPerPage;
|
|
47
56
|
return {
|
|
48
|
-
postsPerPage:
|
|
57
|
+
postsPerPage: settingPerPage || DEFAULTS_POSTS_PER_PAGE
|
|
49
58
|
};
|
|
50
59
|
}, []); // There are some effects running where some initialization logic is
|
|
51
60
|
// happening and setting some values to some attributes (ex. queryId).
|
|
@@ -57,9 +66,12 @@ export default function QueryContent({
|
|
|
57
66
|
// would cause to override previous wanted changes.
|
|
58
67
|
|
|
59
68
|
useEffect(() => {
|
|
60
|
-
const newQuery = {};
|
|
69
|
+
const newQuery = {}; // When we inherit from global query always need to set the `perPage`
|
|
70
|
+
// based on the reading settings.
|
|
61
71
|
|
|
62
|
-
if (
|
|
72
|
+
if (inherit && query.perPage !== postsPerPage) {
|
|
73
|
+
newQuery.perPage = postsPerPage;
|
|
74
|
+
} else if (!query.perPage && postsPerPage) {
|
|
63
75
|
newQuery.perPage = postsPerPage;
|
|
64
76
|
}
|
|
65
77
|
|
|
@@ -68,7 +80,7 @@ export default function QueryContent({
|
|
|
68
80
|
|
|
69
81
|
updateQuery(newQuery);
|
|
70
82
|
}
|
|
71
|
-
}, [query.perPage]); // We need this for multi-query block pagination.
|
|
83
|
+
}, [query.perPage, postsPerPage, inherit]); // We need this for multi-query block pagination.
|
|
72
84
|
// Query parameters for each block are scoped to their ID.
|
|
73
85
|
|
|
74
86
|
useEffect(() => {
|
|
@@ -131,6 +143,7 @@ export default function QueryContent({
|
|
|
131
143
|
tagName: value
|
|
132
144
|
}),
|
|
133
145
|
help: htmlElementMessages[TagName]
|
|
134
|
-
})), createElement(TagName, innerBlocksProps
|
|
146
|
+
})), createElement(TagName, { ...innerBlocksProps
|
|
147
|
+
}));
|
|
135
148
|
}
|
|
136
149
|
//# sourceMappingURL=query-content.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/query/edit/query-content.js"],"names":["useSelect","useDispatch","useInstanceId","useEffect","BlockControls","InspectorControls","useBlockProps","store","blockEditorStore","useInnerBlocksProps","SelectControl","__","QueryToolbar","QueryInspectorControls","DEFAULTS_POSTS_PER_PAGE","TEMPLATE","QueryContent","attributes","setAttributes","openPatternSelectionModal","name","clientId","queryId","query","displayLayout","tagName","TagName","__unstableMarkNextChangeAsNotPersistent","instanceId","blockProps","innerBlocksProps","template","postsPerPage","select","getSettings","newQuery","perPage","Object","keys","length","updateQuery","Number","isFinite","updateDisplayLayout","newDisplayLayout","htmlElementMessages","main","section","aside","label","value"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,aAAT,QAA8B,oBAA9B;AACA,SAASC,SAAT,QAA0B,oBAA1B;AACA,SACCC,aADD,EAECC,iBAFD,EAGCC,aAHD,EAICC,KAAK,IAAIC,gBAJV,EAKCC,mBALD,QAMO,yBANP;AAOA,SAASC,aAAT,QAA8B,uBAA9B;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,OAAOC,YAAP,MAAyB,iBAAzB;AACA,OAAOC,sBAAP,MAAmC,sBAAnC;AAEA,MAAMC,uBAAuB,GAAG,CAAhC;AAEA,MAAMC,QAAQ,GAAG,CAAE,CAAE,oBAAF,CAAF,CAAjB;AACA,eAAe,SAASC,YAAT,CAAuB;AACrCC,EAAAA,UADqC;AAErCC,EAAAA,aAFqC;AAGrCC,EAAAA,yBAHqC;AAIrCC,EAAAA,IAJqC;AAKrCC,EAAAA;AALqC,CAAvB,EAMX;AACH,QAAM;AACLC,IAAAA,OADK;AAELC,IAAAA,KAFK;AAGLC,IAAAA,aAHK;AAILC,IAAAA,OAAO,EAAEC,OAAO,GAAG;
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/query/edit/query-content.js"],"names":["useSelect","useDispatch","useInstanceId","useEffect","BlockControls","InspectorControls","useBlockProps","store","blockEditorStore","useInnerBlocksProps","SelectControl","__","coreStore","QueryToolbar","QueryInspectorControls","DEFAULTS_POSTS_PER_PAGE","TEMPLATE","QueryContent","attributes","setAttributes","openPatternSelectionModal","name","clientId","queryId","query","displayLayout","tagName","TagName","inherit","__unstableMarkNextChangeAsNotPersistent","instanceId","blockProps","innerBlocksProps","template","postsPerPage","select","getSettings","getEntityRecord","canUser","settingPerPage","posts_per_page","newQuery","perPage","Object","keys","length","updateQuery","Number","isFinite","updateDisplayLayout","newDisplayLayout","htmlElementMessages","main","section","aside","label","value"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,aAAT,QAA8B,oBAA9B;AACA,SAASC,SAAT,QAA0B,oBAA1B;AACA,SACCC,aADD,EAECC,iBAFD,EAGCC,aAHD,EAICC,KAAK,IAAIC,gBAJV,EAKCC,mBALD,QAMO,yBANP;AAOA,SAASC,aAAT,QAA8B,uBAA9B;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASJ,KAAK,IAAIK,SAAlB,QAAmC,sBAAnC;AAEA;AACA;AACA;;AACA,OAAOC,YAAP,MAAyB,iBAAzB;AACA,OAAOC,sBAAP,MAAmC,sBAAnC;AAEA,MAAMC,uBAAuB,GAAG,CAAhC;AAEA,MAAMC,QAAQ,GAAG,CAAE,CAAE,oBAAF,CAAF,CAAjB;AACA,eAAe,SAASC,YAAT,CAAuB;AACrCC,EAAAA,UADqC;AAErCC,EAAAA,aAFqC;AAGrCC,EAAAA,yBAHqC;AAIrCC,EAAAA,IAJqC;AAKrCC,EAAAA;AALqC,CAAvB,EAMX;AACH,QAAM;AACLC,IAAAA,OADK;AAELC,IAAAA,KAFK;AAGLC,IAAAA,aAHK;AAILC,IAAAA,OAAO,EAAEC,OAAO,GAAG,KAJd;AAKLH,IAAAA,KAAK,EAAE;AAAEI,MAAAA;AAAF,QAAc;AALhB,MAMFV,UANJ;AAOA,QAAM;AAAEW,IAAAA;AAAF,MACL5B,WAAW,CAAEO,gBAAF,CADZ;AAEA,QAAMsB,UAAU,GAAG5B,aAAa,CAAEe,YAAF,CAAhC;AACA,QAAMc,UAAU,GAAGzB,aAAa,EAAhC;AACA,QAAM0B,gBAAgB,GAAGvB,mBAAmB,CAAEsB,UAAF,EAAc;AACzDE,IAAAA,QAAQ,EAAEjB;AAD+C,GAAd,CAA5C;AAGA,QAAM;AAAEkB,IAA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AED,MAAAA,KAAK,EAAE,QAAT;AAAmBC,MAAAA,KAAK,EAAE;AAA1B,KAFS,EAGT;AAAED,MAAAA,KAAK,EAAE,WAAT;AAAsBC,MAAAA,KAAK,EAAE;AAA7B,KAHS,EAIT;AAAED,MAAAA,KAAK,EAAE,SAAT;AAAoBC,MAAAA,KAAK,EAAE;AAA3B,KAJS,CAHX;AASC,IAAA,KAAK,EAAG7B,OATT;AAUC,IAAA,QAAQ,EAAK6B,KAAF,IACVrC,aAAa,CAAE;AAAEO,MAAAA,OAAO,EAAE8B;AAAX,KAAF,CAXf;AAaC,IAAA,IAAI,EAAGL,mBAAmB,CAAExB,OAAF;AAb3B,IADD,CAfD,EAgCC,cAAC,OAAD,OAAcK;AAAd,IAhCD,CADD;AAoCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useInstanceId } from '@wordpress/compose';\nimport { useEffect } from '@wordpress/element';\nimport {\n\tBlockControls,\n\tInspectorControls,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n\tuseInnerBlocksProps,\n} from '@wordpress/block-editor';\nimport { SelectControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport QueryToolbar from './query-toolbar';\nimport QueryInspectorControls from './inspector-controls';\n\nconst DEFAULTS_POSTS_PER_PAGE = 3;\n\nconst TEMPLATE = [ [ 'core/post-template' ] ];\nexport default function QueryContent( {\n\tattributes,\n\tsetAttributes,\n\topenPatternSelectionModal,\n\tname,\n\tclientId,\n} ) {\n\tconst {\n\t\tqueryId,\n\t\tquery,\n\t\tdisplayLayout,\n\t\ttagName: TagName = 'div',\n\t\tquery: { inherit } = {},\n\t} = attributes;\n\tconst { __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\tconst instanceId = useInstanceId( QueryContent );\n\tconst blockProps = useBlockProps();\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\ttemplate: TEMPLATE,\n\t} );\n\tconst { postsPerPage } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst { getEntityRecord, canUser } = select( coreStore );\n\t\tconst settingPerPage = canUser( 'read', 'settings' )\n\t\t\t? +getEntityRecord( 'root', 'site' )?.posts_per_page\n\t\t\t: +getSettings().postsPerPage;\n\t\treturn {\n\t\t\tpostsPerPage: settingPerPage || DEFAULTS_POSTS_PER_PAGE,\n\t\t};\n\t}, [] );\n\t// There are some effects running where some initialization logic is\n\t// happening and setting some values to some attributes (ex. queryId).\n\t// These updates can cause an `undo trap` where undoing will result in\n\t// resetting again, so we need to mark these changes as not persistent\n\t// with `__unstableMarkNextChangeAsNotPersistent`.\n\n\t// Changes in query property (which is an object) need to be in the same callback,\n\t// because updates are batched after the render and changes in different query properties\n\t// would cause to override previous wanted changes.\n\tuseEffect( () => {\n\t\tconst newQuery = {};\n\t\t// When we inherit from global query always need to set the `perPage`\n\t\t// based on the reading settings.\n\t\tif ( inherit && query.perPage !== postsPerPage ) {\n\t\t\tnewQuery.perPage = postsPerPage;\n\t\t} else if ( ! query.perPage && postsPerPage ) {\n\t\t\tnewQuery.perPage = postsPerPage;\n\t\t}\n\t\tif ( !! Object.keys( newQuery ).length ) {\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tupdateQuery( newQuery );\n\t\t}\n\t}, [ query.perPage, postsPerPage, inherit ] );\n\t// We need this for multi-query block pagination.\n\t// Query parameters for each block are scoped to their ID.\n\tuseEffect( () => {\n\t\tif ( ! Number.isFinite( queryId ) ) {\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( { queryId: instanceId } );\n\t\t}\n\t}, [ queryId, instanceId ] );\n\tconst updateQuery = ( newQuery ) =>\n\t\tsetAttributes( { query: { ...query, ...newQuery } } );\n\tconst updateDisplayLayout = ( newDisplayLayout ) =>\n\t\tsetAttributes( {\n\t\t\tdisplayLayout: { ...displayLayout, ...newDisplayLayout },\n\t\t} );\n\tconst htmlElementMessages = {\n\t\tmain: __(\n\t\t\t'The <main> element should be used for the primary content of your document only. '\n\t\t),\n\t\tsection: __(\n\t\t\t\"The <section> element should represent a standalone portion of the document that can't be better represented by another element.\"\n\t\t),\n\t\taside: __(\n\t\t\t\"The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content.\"\n\t\t),\n\t};\n\treturn (\n\t\t<>\n\t\t\t<QueryInspectorControls\n\t\t\t\tattributes={ attributes }\n\t\t\t\tsetQuery={ updateQuery }\n\t\t\t\tsetDisplayLayout={ updateDisplayLayout }\n\t\t\t/>\n\t\t\t<BlockControls>\n\t\t\t\t<QueryToolbar\n\t\t\t\t\tname={ name }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetQuery={ updateQuery }\n\t\t\t\t\topenPatternSelectionModal={ openPatternSelectionModal }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t<SelectControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'HTML element' ) }\n\t\t\t\t\toptions={ [\n\t\t\t\t\t\t{ label: __( 'Default (<div>)' ), value: 'div' },\n\t\t\t\t\t\t{ label: '<main>', value: 'main' },\n\t\t\t\t\t\t{ label: '<section>', value: 'section' },\n\t\t\t\t\t\t{ label: '<aside>', value: 'aside' },\n\t\t\t\t\t] }\n\t\t\t\t\tvalue={ TagName }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { tagName: value } )\n\t\t\t\t\t}\n\t\t\t\t\thelp={ htmlElementMessages[ TagName ] }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t<TagName { ...innerBlocksProps } />\n\t\t</>\n\t);\n}\n"]}
|
|
@@ -58,7 +58,8 @@ export default function QueryPlaceholder({
|
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
return createElement("div", blockProps
|
|
61
|
+
return createElement("div", { ...blockProps
|
|
62
|
+
}, createElement(Placeholder, {
|
|
62
63
|
icon: icon,
|
|
63
64
|
label: label,
|
|
64
65
|
instructions: __('Choose a pattern for the query loop or start blank.')
|
|
@@ -85,7 +86,8 @@ function QueryVariationPicker({
|
|
|
85
86
|
replaceInnerBlocks
|
|
86
87
|
} = useDispatch(blockEditorStore);
|
|
87
88
|
const blockProps = useBlockProps();
|
|
88
|
-
return createElement("div", blockProps
|
|
89
|
+
return createElement("div", { ...blockProps
|
|
90
|
+
}, createElement(__experimentalBlockVariationPicker, {
|
|
89
91
|
icon: icon,
|
|
90
92
|
label: label,
|
|
91
93
|
variations: scopeVariations,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/query/edit/query-placeholder.js"],"names":["useSelect","useDispatch","createBlocksFromInnerBlocksTemplate","store","blocksStore","useState","useBlockProps","blockEditorStore","__experimentalBlockVariationPicker","__experimentalGetMatchingVariation","getMatchingVariation","Button","Placeholder","__","useScopedBlockVariations","useBlockNameForPatterns","QueryPlaceholder","attributes","clientId","name","openPatternSelectionModal","setAttributes","isStartingBlank","setIsStartingBlank","blockProps","blockNameForPatterns","blockType","allVariations","hasPatterns","select","getBlockVariations","getBlockType","getBlockRootClientId","getPatternsByBlockTypes","rootClientId","length","matchingVariation","icon","src","label","title","QueryVariationPicker","scopeVariations","replaceInnerBlocks","variation","query","postType","namespace","innerBlocks"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SACCC,mCADD,EAECC,KAAK,IAAIC,WAFV,QAGO,mBAHP;AAIA,SAASC,QAAT,QAAyB,oBAAzB;AACA,SACCC,aADD,EAECH,KAAK,IAAII,gBAFV,EAGCC,kCAHD,EAICC,kCAAkC,IAAIC,oBAJvC,QAKO,yBALP;AAMA,SAASC,MAAT,EAAiBC,WAA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IAAnB,EAAyBC,GAAzB,IACAF,iBAAiB,EAAEC,IADnB,IAEAX,SAAS,EAAEW,IAAX,EAAiBC,GAHlB;AAIA,QAAMC,KAAK,GAAGH,iBAAiB,EAAEI,KAAnB,IAA4Bd,SAAS,EAAEc,KAArD;;AACA,MAAKlB,eAAL,EAAuB;AACtB,WACC,cAAC,oBAAD;AACC,MAAA,QAAQ,EAAGJ,QADZ;AAEC,MAAA,UAAU,EAAGD,UAFd;AAGC,MAAA,aAAa,EAAGI,aAHjB;AAIC,MAAA,IAAI,EAAGgB,IAJR;AAKC,MAAA,KAAK,EAAGE;AALT,MADD;AASA;;AACD,SACC,
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/query/edit/query-placeholder.js"],"names":["useSelect","useDispatch","createBlocksFromInnerBlocksTemplate","store","blocksStore","useState","useBlockProps","blockEditorStore","__experimentalBlockVariationPicker","__experimentalGetMatchingVariation","getMatchingVariation","Button","Placeholder","__","useScopedBlockVariations","useBlockNameForPatterns","QueryPlaceholder","attributes","clientId","name","openPatternSelectionModal","setAttributes","isStartingBlank","setIsStartingBlank","blockProps","blockNameForPatterns","blockType","allVariations","hasPatterns","select","getBlockVariations","getBlockType","getBlockRootClientId","getPatternsByBlockTypes","rootClientId","length","matchingVariation","icon","src","label","title","QueryVariationPicker","scopeVariations","replaceInnerBlocks","variation","query","postType","namespace","innerBlocks"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SACCC,mCADD,EAECC,KAAK,IAAIC,WAFV,QAGO,mBAHP;AAIA,SAASC,QAAT,QAAyB,oBAAzB;AACA,SACCC,aADD,EAECH,KAAK,IAAII,gBAFV,EAGCC,kCAHD,EAICC,kCAAkC,IAAIC,oBAJvC,QAKO,yBALP;AAMA,SAASC,MAAT,EAAiBC,WAAjB,QAAoC,uBAApC;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,SAASC,wBAAT,E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G,eAHd;AAIC,IAAA,QAAQ,EAAKE,SAAF,IAAiB;AAC3B,UAAKA,SAAS,CAAC3B,UAAf,EAA4B;AAC3BI,QAAAA,aAAa,CAAE,EACd,GAAGuB,SAAS,CAAC3B,UADC;AAEd4B,UAAAA,KAAK,EAAE,EACN,GAAGD,SAAS,CAAC3B,UAAV,CAAqB4B,KADlB;AAENC,YAAAA,QAAQ,EACP7B,UAAU,CAAC4B,KAAX,CAAiBC,QAAjB,IACAF,SAAS,CAAC3B,UAAV,CAAqB4B,KAArB,CAA2BC;AAJtB,WAFO;AAQdC,UAAAA,SAAS,EAAE9B,UAAU,CAAC8B;AARR,SAAF,CAAb;AAUA;;AACD,UAAKH,SAAS,CAACI,WAAf,EAA6B;AAC5BL,QAAAA,kBAAkB,CACjBzB,QADiB,EAEjBhB,mCAAmC,CAClC0C,SAAS,CAACI,WADwB,CAFlB,EAKjB,KALiB,CAAlB;AAOA;AACD;AA1BF,IADD,CADD;AAgCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tcreateBlocksFromInnerBlocksTemplate,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\nimport { useState } from '@wordpress/element';\nimport {\n\tuseBlockProps,\n\tstore as blockEditorStore,\n\t__experimentalBlockVariationPicker,\n\t__experimentalGetMatchingVariation as getMatchingVariation,\n} from '@wordpress/block-editor';\nimport { Button, Placeholder } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useScopedBlockVariations, useBlockNameForPatterns } from '../utils';\n\nexport default function QueryPlaceholder( {\n\tattributes,\n\tclientId,\n\tname,\n\topenPatternSelectionModal,\n\tsetAttributes,\n} ) {\n\tconst [ isStartingBlank, setIsStartingBlank ] = useState( false );\n\tconst blockProps = useBlockProps();\n\tconst blockNameForPatterns = useBlockNameForPatterns(\n\t\tclientId,\n\t\tattributes\n\t);\n\n\tconst { blockType, allVariations, hasPatterns } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockVariations, getBlockType } = select( blocksStore );\n\t\t\tconst { getBlockRootClientId, getPatternsByBlockTypes } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\t\t\treturn {\n\t\t\t\tblockType: getBlockType( name ),\n\t\t\t\tallVariations: getBlockVariations( name ),\n\t\t\t\thasPatterns: !! getPatternsByBlockTypes(\n\t\t\t\t\tblockNameForPatterns,\n\t\t\t\t\trootClientId\n\t\t\t\t).length,\n\t\t\t};\n\t\t},\n\t\t[ name, blockNameForPatterns, clientId ]\n\t);\n\n\tconst matchingVariation = getMatchingVariation( attributes, allVariations );\n\tconst icon =\n\t\tmatchingVariation?.icon?.src ||\n\t\tmatchingVariation?.icon ||\n\t\tblockType?.icon?.src;\n\tconst label = matchingVariation?.title || blockType?.title;\n\tif ( isStartingBlank ) {\n\t\treturn (\n\t\t\t<QueryVariationPicker\n\t\t\t\tclientId={ clientId }\n\t\t\t\tattributes={ attributes }\n\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\ticon={ icon }\n\t\t\t\tlabel={ label }\n\t\t\t/>\n\t\t);\n\t}\n\treturn (\n\t\t<div { ...blockProps }>\n\t\t\t<Placeholder\n\t\t\t\ticon={ icon }\n\t\t\t\tlabel={ label }\n\t\t\t\tinstructions={ __(\n\t\t\t\t\t'Choose a pattern for the query loop or start blank.'\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t{ !! hasPatterns && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\tonClick={ openPatternSelectionModal }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Choose' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t) }\n\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tsetIsStartingBlank( true );\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Start blank' ) }\n\t\t\t\t</Button>\n\t\t\t</Placeholder>\n\t\t</div>\n\t);\n}\n\nfunction QueryVariationPicker( {\n\tclientId,\n\tattributes,\n\tsetAttributes,\n\ticon,\n\tlabel,\n} ) {\n\tconst scopeVariations = useScopedBlockVariations( attributes );\n\tconst { replaceInnerBlocks } = useDispatch( blockEditorStore );\n\tconst blockProps = useBlockProps();\n\treturn (\n\t\t<div { ...blockProps }>\n\t\t\t<__experimentalBlockVariationPicker\n\t\t\t\ticon={ icon }\n\t\t\t\tlabel={ label }\n\t\t\t\tvariations={ scopeVariations }\n\t\t\t\tonSelect={ ( variation ) => {\n\t\t\t\t\tif ( variation.attributes ) {\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t...variation.attributes,\n\t\t\t\t\t\t\tquery: {\n\t\t\t\t\t\t\t\t...variation.attributes.query,\n\t\t\t\t\t\t\t\tpostType:\n\t\t\t\t\t\t\t\t\tattributes.query.postType ||\n\t\t\t\t\t\t\t\t\tvariation.attributes.query.postType,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tnamespace: attributes.namespace,\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t\tif ( variation.innerBlocks ) {\n\t\t\t\t\t\treplaceInnerBlocks(\n\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\tcreateBlocksFromInnerBlocksTemplate(\n\t\t\t\t\t\t\t\tvariation.innerBlocks\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} }\n\t\t\t/>\n\t\t</div>\n\t);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/query/index.js"],"names":["loop","icon","initBlock","edit","save","variations","deprecated","name","metadata","settings","init"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAI,IAAIC,IAAjB,QAA6B,kBAA7B;AAEA;AACA;AACA;;AACA,OAAOC,SAAP,MAAsB,qBAAtB
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/query/index.js"],"names":["loop","icon","initBlock","edit","save","variations","deprecated","name","metadata","settings","init"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAI,IAAIC,IAAjB,QAA6B,kBAA7B;AAEA;AACA;AACA;;AACA,OAAOC,SAAP,MAAsB,qBAAtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAOC,IAAP,MAAiB,QAAjB;AACA,OAAOC,IAAP,MAAiB,QAAjB;AACA,OAAOC,UAAP,MAAuB,cAAvB;AACA,OAAOC,UAAP,MAAuB,cAAvB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAWC,QAAjB;AACA,SAASA,QAAT,EAAmBD,IAAnB;AAEA,OAAO,MAAME,QAAQ,GAAG;AACvBR,EAAAA,IADuB;AAEvBE,EAAAA,IAFuB;AAGvBC,EAAAA,IAHuB;AAIvBC,EAAAA,UAJuB;AAKvBC,EAAAA;AALuB,CAAjB;AAQP,OAAO,MAAMI,IAAI,GAAG,MAAMR,SAAS,CAAE;AAAEK,EAAAA,IAAF;AAAQC,EAAAA,QAAR;AAAkBC,EAAAA;AAAlB,CAAF,CAA5B","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { loop as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport save from './save';\nimport variations from './variations';\nimport deprecated from './deprecated';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\tsave,\n\tvariations,\n\tdeprecated,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"]}
|
|
@@ -11,6 +11,7 @@ export default function QuerySave({
|
|
|
11
11
|
}) {
|
|
12
12
|
const blockProps = useBlockProps.save();
|
|
13
13
|
const innerBlocksProps = useInnerBlocksProps.save(blockProps);
|
|
14
|
-
return createElement(Tag, innerBlocksProps
|
|
14
|
+
return createElement(Tag, { ...innerBlocksProps
|
|
15
|
+
});
|
|
15
16
|
}
|
|
16
17
|
//# sourceMappingURL=save.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/query/save.js"],"names":["useInnerBlocksProps","useBlockProps","QuerySave","attributes","tagName","Tag","blockProps","save","innerBlocksProps"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,mBAAT,EAA8BC,aAA9B,QAAmD,yBAAnD;AAEA,eAAe,SAASC,SAAT,CAAoB;AAAEC,EAAAA,UAAU,EAAE;AAAEC,IAAAA,OAAO,EAAEC,GAAG,GAAG;AAAjB;AAAd,CAApB,EAA+D;AAC7E,QAAMC,UAAU,GAAGL,aAAa,CAACM,IAAd,EAAnB;AACA,QAAMC,gBAAgB,GAAGR,mBAAmB,CAACO,IAApB,CAA0BD,UAA1B,CAAzB;AACA,SAAO,cAAC,GAAD,
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/query/save.js"],"names":["useInnerBlocksProps","useBlockProps","QuerySave","attributes","tagName","Tag","blockProps","save","innerBlocksProps"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,mBAAT,EAA8BC,aAA9B,QAAmD,yBAAnD;AAEA,eAAe,SAASC,SAAT,CAAoB;AAAEC,EAAAA,UAAU,EAAE;AAAEC,IAAAA,OAAO,EAAEC,GAAG,GAAG;AAAjB;AAAd,CAApB,EAA+D;AAC7E,QAAMC,UAAU,GAAGL,aAAa,CAACM,IAAd,EAAnB;AACA,QAAMC,gBAAgB,GAAGR,mBAAmB,CAACO,IAApB,CAA0BD,UAA1B,CAAzB;AACA,SAAO,cAAC,GAAD,OAAUE;AAAV,IAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInnerBlocksProps, useBlockProps } from '@wordpress/block-editor';\n\nexport default function QuerySave( { attributes: { tagName: Tag = 'div' } } ) {\n\tconst blockProps = useBlockProps.save();\n\tconst innerBlocksProps = useInnerBlocksProps.save( blockProps );\n\treturn <Tag { ...innerBlocksProps } />;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/query/utils.js"],"names":["useSelect","useMemo","store","coreStore","blockEditorStore","decodeEntities","cloneBlock","blocksStore","getEntitiesInfo","entities","mapping","reduce","accumulator","entity","mapById","mapByName","names","id","name","push","getValueFromObjectPath","object","path","normalizedPath","split","value","forEach","fieldName","mapToIHasNameAndId","map","usePostTypes","postTypes","select","getPostTypes","excludedPostTypes","filteredPostTypes","per_page","filter","viewable","slug","includes","postTypesTaxonomiesMap","length","type","taxonomies","postTypesSelectOptions","labels","label","singular_name","useTaxonomies","postType","getTaxonomies","filteredTaxonomies","context","useIsPostTypeHierarchical","getPostType","hierarchical","useAllowedControls","attributes","getActiveBlockVariation","queryLoopName","allowedControls","isControlAllowed","key","getTransformedBlocksFromPattern","blocks","queryBlockAttributes","query","inherit","clonedBlocks","block","queryClientIds","blocksQueue","shift","clientId","innerBlocks","innerBlock","newBlocks","useBlockNameForPatterns","activeVariationName","blockName","activeVariationPatterns","getBlockRootClientId","getPatternsByBlockTypes","rootClientId","useScopedBlockVariations","blockVariations","getBlockVariations","variations","isNotConnected","variation","namespace","connectedVariations","usePatterns"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,iBAA1B;AACA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AACA,SAASD,KAAK,IAAIE,gBAAlB,QAA0C,yBAA1C;AACA,SAASC,cAAT,QAA+B,0BAA/B;AACA,SAASC,UAAT,EAAqBJ,KAAK,IAAIK,WAA9B,QAAiD,mBAAjD;AAEA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;;A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data';\nimport { useMemo } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { cloneBlock, store as blocksStore } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { name as queryLoopName } from './block.json';\n\n/** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */\n\n/**\n * @typedef IHasNameAndId\n * @property {string|number} id The entity's id.\n * @property {string} name The entity's name.\n */\n\n/**\n * The object used in Query block that contains info and helper mappings\n * from an array of IHasNameAndId objects.\n *\n * @typedef {Object} QueryEntitiesInfo\n * @property {IHasNameAndId[]} entities The array of entities.\n * @property {Object<string, IHasNameAndId>} mapById Object mapping with the id as key and the entity as value.\n * @property {Object<string, IHasNameAndId>} mapByName Object mapping with the name as key and the entity as value.\n * @property {string[]} names Array with the entities' names.\n */\n\n/**\n * Returns a helper object with mapping from Objects that implement\n * the `IHasNameAndId` interface. The returned object is used for\n * integration with `FormTokenField` component.\n *\n * @param {IHasNameAndId[]} entities The entities to extract of helper object.\n * @return {QueryEntitiesInfo} The object with the entities information.\n */\nexport const getEntitiesInfo = ( entities ) => {\n\tconst mapping = entities?.reduce(\n\t\t( accumulator, entity ) => {\n\t\t\tconst { mapById, mapByName, names } = accumulator;\n\t\t\tmapById[ entity.id ] = entity;\n\t\t\tmapByName[ entity.name ] = entity;\n\t\t\tnames.push( entity.name );\n\t\t\treturn accumulator;\n\t\t},\n\t\t{ mapById: {}, mapByName: {}, names: [] }\n\t);\n\treturn {\n\t\tentities,\n\t\t...mapping,\n\t};\n};\n\n/**\n * Helper util to return a value from a certain path of the object.\n * Path is specified as a string of properties, separated by dots,\n * for example: \"parent.child\".\n *\n * @param {Object} object Input object.\n * @param {string} path Path to the object property.\n * @return {*} Value of the object property at the specified path.\n */\nexport const getValueFromObjectPath = ( object, path ) => {\n\tconst normalizedPath = path.split( '.' );\n\tlet value = object;\n\tnormalizedPath.forEach( ( fieldName ) => {\n\t\tvalue = value?.[ fieldName ];\n\t} );\n\treturn value;\n};\n\n/**\n * Helper util to map records to add a `name` prop from a\n * provided path, in order to handle all entities in the same\n * fashion(implementing`IHasNameAndId` interface).\n *\n * @param {Object[]} entities The array of entities.\n * @param {string} path The path to map a `name` property from the entity.\n * @return {IHasNameAndId[]} An array of enitities that now implement the `IHasNameAndId` interface.\n */\nexport const mapToIHasNameAndId = ( entities, path ) => {\n\treturn ( entities || [] ).map( ( entity ) => ( {\n\t\t...entity,\n\t\tname: decodeEntities( getValueFromObjectPath( entity, path ) ),\n\t} ) );\n};\n\n/**\n * Returns a helper object that contains:\n * 1. An `options` object from the available post types, to be passed to a `SelectControl`.\n * 2. A helper map with available taxonomies per post type.\n *\n * @return {Object} The helper object related to post types.\n */\nexport const usePostTypes = () => {\n\tconst postTypes = useSelect( ( select ) => {\n\t\tconst { getPostTypes } = select( coreStore );\n\t\tconst excludedPostTypes = [ 'attachment' ];\n\t\tconst filteredPostTypes = getPostTypes( { per_page: -1 } )?.filter(\n\t\t\t( { viewable, slug } ) =>\n\t\t\t\tviewable && ! excludedPostTypes.includes( slug )\n\t\t);\n\t\treturn filteredPostTypes;\n\t}, [] );\n\tconst postTypesTaxonomiesMap = useMemo( () => {\n\t\tif ( ! postTypes?.length ) return;\n\t\treturn postTypes.reduce( ( accumulator, type ) => {\n\t\t\taccumulator[ type.slug ] = type.taxonomies;\n\t\t\treturn accumulator;\n\t\t}, {} );\n\t}, [ postTypes ] );\n\tconst postTypesSelectOptions = useMemo(\n\t\t() =>\n\t\t\t( postTypes || [] ).map( ( { labels, slug } ) => ( {\n\t\t\t\tlabel: labels.singular_name,\n\t\t\t\tvalue: slug,\n\t\t\t} ) ),\n\t\t[ postTypes ]\n\t);\n\treturn { postTypesTaxonomiesMap, postTypesSelectOptions };\n};\n\n/**\n * Hook that returns the taxonomies associated with a specific post type.\n *\n * @param {string} postType The post type from which to retrieve the associated taxonomies.\n * @return {Object[]} An array of the associated taxonomies.\n */\nexport const useTaxonomies = ( postType ) => {\n\tconst taxonomies = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getTaxonomies } = select( coreStore );\n\t\t\tconst filteredTaxonomies = getTaxonomies( {\n\t\t\t\ttype: postType,\n\t\t\t\tper_page: -1,\n\t\t\t\tcontext: 'view',\n\t\t\t} );\n\t\t\treturn filteredTaxonomies;\n\t\t},\n\t\t[ postType ]\n\t);\n\treturn taxonomies;\n};\n\n/**\n * Hook that returns whether a specific post type is hierarchical.\n *\n * @param {string} postType The post type to check.\n * @return {boolean} Whether a specific post type is hierarchical.\n */\nexport function useIsPostTypeHierarchical( postType ) {\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst type = select( coreStore ).getPostType( postType );\n\t\t\treturn type?.viewable && type?.hierarchical;\n\t\t},\n\t\t[ postType ]\n\t);\n}\n\n/**\n * Hook that returns the query properties' names defined by the active\n * block variation, to determine which block's filters to show.\n *\n * @param {Object} attributes Block attributes.\n * @return {string[]} An array of the query attributes.\n */\nexport function useAllowedControls( attributes ) {\n\treturn useSelect(\n\t\t( select ) =>\n\t\t\tselect( blocksStore ).getActiveBlockVariation(\n\t\t\t\tqueryLoopName,\n\t\t\t\tattributes\n\t\t\t)?.allowedControls,\n\n\t\t[ attributes ]\n\t);\n}\nexport function isControlAllowed( allowedControls, key ) {\n\t// Every controls is allowed if the list is not defined.\n\tif ( ! allowedControls ) {\n\t\treturn true;\n\t}\n\treturn allowedControls.includes( key );\n}\n\n/**\n * Clones a pattern's blocks and then recurses over that list of blocks,\n * transforming them to retain some `query` attribute properties.\n * For now we retain the `postType` and `inherit` properties as they are\n * fundamental for the expected functionality of the block and don't affect\n * its design and presentation.\n *\n * Returns the cloned/transformed blocks and array of existing Query Loop\n * client ids for further manipulation, in order to avoid multiple recursions.\n *\n * @param {WPBlock[]} blocks The list of blocks to look through and transform(mutate).\n * @param {Record<string,*>} queryBlockAttributes The existing Query Loop's attributes.\n * @return {{ newBlocks: WPBlock[], queryClientIds: string[] }} An object with the cloned/transformed blocks and all the Query Loop clients from these blocks.\n */\nexport const getTransformedBlocksFromPattern = (\n\tblocks,\n\tqueryBlockAttributes\n) => {\n\tconst {\n\t\tquery: { postType, inherit },\n\t} = queryBlockAttributes;\n\tconst clonedBlocks = blocks.map( ( block ) => cloneBlock( block ) );\n\tconst queryClientIds = [];\n\tconst blocksQueue = [ ...clonedBlocks ];\n\twhile ( blocksQueue.length > 0 ) {\n\t\tconst block = blocksQueue.shift();\n\t\tif ( block.name === 'core/query' ) {\n\t\t\tblock.attributes.query = {\n\t\t\t\t...block.attributes.query,\n\t\t\t\tpostType,\n\t\t\t\tinherit,\n\t\t\t};\n\t\t\tqueryClientIds.push( block.clientId );\n\t\t}\n\t\tblock.innerBlocks?.forEach( ( innerBlock ) => {\n\t\t\tblocksQueue.push( innerBlock );\n\t\t} );\n\t}\n\treturn { newBlocks: clonedBlocks, queryClientIds };\n};\n\n/**\n * Helper hook that determines if there is an active variation of the block\n * and if there are available specific patterns for this variation.\n * If there are, these patterns are going to be the only ones suggested to\n * the user in setup and replace flow, without including the default ones\n * for Query Loop.\n *\n * If there are no such patterns, the default ones for Query Loop are going\n * to be suggested.\n *\n * @param {string} clientId The block's client ID.\n * @param {Object} attributes The block's attributes.\n * @return {string} The block name to be used in the patterns suggestions.\n */\nexport function useBlockNameForPatterns( clientId, attributes ) {\n\tconst activeVariationName = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blocksStore ).getActiveBlockVariation(\n\t\t\t\tqueryLoopName,\n\t\t\t\tattributes\n\t\t\t)?.name,\n\t\t[ attributes ]\n\t);\n\tconst blockName = `${ queryLoopName }/${ activeVariationName }`;\n\tconst activeVariationPatterns = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! activeVariationName ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst { getBlockRootClientId, getPatternsByBlockTypes } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\t\t\treturn getPatternsByBlockTypes( blockName, rootClientId );\n\t\t},\n\t\t[ clientId, activeVariationName ]\n\t);\n\treturn activeVariationPatterns?.length ? blockName : queryLoopName;\n}\n\n/**\n * Helper hook that determines if there is an active variation of the block\n * and if there are available specific scoped `block` variations connected with\n * this variation.\n *\n * If there are, these variations are going to be the only ones suggested\n * to the user in setup flow when clicking to `start blank`, without including\n * the default ones for Query Loop.\n *\n * If there are no such scoped `block` variations, the default ones for Query\n * Loop are going to be suggested.\n *\n * The way we determine such variations is with the convention that they have the `namespace`\n * attribute defined as an array. This array should contain the names(`name` property) of any\n * variations they want to be connected to.\n * For example, if we have a `Query Loop` scoped `inserter` variation with the name `products`,\n * we can connect a scoped `block` variation by setting its `namespace` attribute to `['products']`.\n * If the user selects this variation, the `namespace` attribute will be overridden by the\n * main `inserter` variation.\n *\n * @param {Object} attributes The block's attributes.\n * @return {WPBlockVariation[]} The block variations to be suggested in setup flow, when clicking to `start blank`.\n */\nexport function useScopedBlockVariations( attributes ) {\n\tconst { activeVariationName, blockVariations } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getActiveBlockVariation, getBlockVariations } =\n\t\t\t\tselect( blocksStore );\n\t\t\treturn {\n\t\t\t\tactiveVariationName: getActiveBlockVariation(\n\t\t\t\t\tqueryLoopName,\n\t\t\t\t\tattributes\n\t\t\t\t)?.name,\n\t\t\t\tblockVariations: getBlockVariations( queryLoopName, 'block' ),\n\t\t\t};\n\t\t},\n\t\t[ attributes ]\n\t);\n\tconst variations = useMemo( () => {\n\t\t// Filter out the variations that have defined a `namespace` attribute,\n\t\t// which means they are 'connected' to specific variations of the block.\n\t\tconst isNotConnected = ( variation ) =>\n\t\t\t! variation.attributes?.namespace;\n\t\tif ( ! activeVariationName ) {\n\t\t\treturn blockVariations.filter( isNotConnected );\n\t\t}\n\t\tconst connectedVariations = blockVariations.filter( ( variation ) =>\n\t\t\tvariation.attributes?.namespace?.includes( activeVariationName )\n\t\t);\n\t\tif ( !! connectedVariations.length ) {\n\t\t\treturn connectedVariations;\n\t\t}\n\t\treturn blockVariations.filter( isNotConnected );\n\t}, [ activeVariationName, blockVariations ] );\n\treturn variations;\n}\n\n/**\n * Hook that returns the block patterns for a specific block type.\n *\n * @param {string} clientId The block's client ID.\n * @param {string} name The block type name.\n * @return {Object[]} An array of valid block patterns.\n */\nexport const usePatterns = ( clientId, name ) => {\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockRootClientId, getPatternsByBlockTypes } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\t\t\treturn getPatternsByBlockTypes( name, rootClientId );\n\t\t},\n\t\t[ name, clientId ]\n\t);\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/query/utils.js"],"names":["useSelect","useMemo","store","coreStore","blockEditorStore","decodeEntities","cloneBlock","blocksStore","getEntitiesInfo","entities","mapping","reduce","accumulator","entity","mapById","mapByName","names","id","name","push","getValueFromObjectPath","object","path","normalizedPath","split","value","forEach","fieldName","mapToIHasNameAndId","map","usePostTypes","postTypes","select","getPostTypes","excludedPostTypes","filteredPostTypes","per_page","filter","viewable","slug","includes","postTypesTaxonomiesMap","length","type","taxonomies","postTypesSelectOptions","labels","label","singular_name","useTaxonomies","postType","getTaxonomies","filteredTaxonomies","context","useIsPostTypeHierarchical","getPostType","hierarchical","useAllowedControls","attributes","getActiveBlockVariation","queryLoopName","allowedControls","isControlAllowed","key","getTransformedBlocksFromPattern","blocks","queryBlockAttributes","query","inherit","clonedBlocks","block","queryClientIds","blocksQueue","shift","clientId","innerBlocks","innerBlock","newBlocks","useBlockNameForPatterns","activeVariationName","blockName","activeVariationPatterns","getBlockRootClientId","getPatternsByBlockTypes","rootClientId","useScopedBlockVariations","blockVariations","getBlockVariations","variations","isNotConnected","variation","namespace","connectedVariations","usePatterns"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,iBAA1B;AACA,SAASC,OA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Ac;AACb,UAAM;AAAEkD,MAAAA,oBAAF;AAAwBC,MAAAA;AAAxB,QACLnD,MAAM,CAAE5B,gBAAF,CADP;AAEA,UAAMgF,YAAY,GAAGF,oBAAoB,CAAER,QAAF,CAAzC;AACA,WAAOS,uBAAuB,CAAEjE,IAAF,EAAQkE,YAAR,CAA9B;AACA,GANc,EAOf,CAAElE,IAAF,EAAQwD,QAAR,CAPe,CAAhB;AASA,CAVM","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { cloneBlock, store as blocksStore } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { name as queryLoopName } from './block.json';\n\n/** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */\n\n/**\n * @typedef IHasNameAndId\n * @property {string|number} id The entity's id.\n * @property {string} name The entity's name.\n */\n\n/**\n * The object used in Query block that contains info and helper mappings\n * from an array of IHasNameAndId objects.\n *\n * @typedef {Object} QueryEntitiesInfo\n * @property {IHasNameAndId[]} entities The array of entities.\n * @property {Object<string, IHasNameAndId>} mapById Object mapping with the id as key and the entity as value.\n * @property {Object<string, IHasNameAndId>} mapByName Object mapping with the name as key and the entity as value.\n * @property {string[]} names Array with the entities' names.\n */\n\n/**\n * Returns a helper object with mapping from Objects that implement\n * the `IHasNameAndId` interface. The returned object is used for\n * integration with `FormTokenField` component.\n *\n * @param {IHasNameAndId[]} entities The entities to extract of helper object.\n * @return {QueryEntitiesInfo} The object with the entities information.\n */\nexport const getEntitiesInfo = ( entities ) => {\n\tconst mapping = entities?.reduce(\n\t\t( accumulator, entity ) => {\n\t\t\tconst { mapById, mapByName, names } = accumulator;\n\t\t\tmapById[ entity.id ] = entity;\n\t\t\tmapByName[ entity.name ] = entity;\n\t\t\tnames.push( entity.name );\n\t\t\treturn accumulator;\n\t\t},\n\t\t{ mapById: {}, mapByName: {}, names: [] }\n\t);\n\treturn {\n\t\tentities,\n\t\t...mapping,\n\t};\n};\n\n/**\n * Helper util to return a value from a certain path of the object.\n * Path is specified as a string of properties, separated by dots,\n * for example: \"parent.child\".\n *\n * @param {Object} object Input object.\n * @param {string} path Path to the object property.\n * @return {*} Value of the object property at the specified path.\n */\nexport const getValueFromObjectPath = ( object, path ) => {\n\tconst normalizedPath = path.split( '.' );\n\tlet value = object;\n\tnormalizedPath.forEach( ( fieldName ) => {\n\t\tvalue = value?.[ fieldName ];\n\t} );\n\treturn value;\n};\n\n/**\n * Helper util to map records to add a `name` prop from a\n * provided path, in order to handle all entities in the same\n * fashion(implementing`IHasNameAndId` interface).\n *\n * @param {Object[]} entities The array of entities.\n * @param {string} path The path to map a `name` property from the entity.\n * @return {IHasNameAndId[]} An array of enitities that now implement the `IHasNameAndId` interface.\n */\nexport const mapToIHasNameAndId = ( entities, path ) => {\n\treturn ( entities || [] ).map( ( entity ) => ( {\n\t\t...entity,\n\t\tname: decodeEntities( getValueFromObjectPath( entity, path ) ),\n\t} ) );\n};\n\n/**\n * Returns a helper object that contains:\n * 1. An `options` object from the available post types, to be passed to a `SelectControl`.\n * 2. A helper map with available taxonomies per post type.\n *\n * @return {Object} The helper object related to post types.\n */\nexport const usePostTypes = () => {\n\tconst postTypes = useSelect( ( select ) => {\n\t\tconst { getPostTypes } = select( coreStore );\n\t\tconst excludedPostTypes = [ 'attachment' ];\n\t\tconst filteredPostTypes = getPostTypes( { per_page: -1 } )?.filter(\n\t\t\t( { viewable, slug } ) =>\n\t\t\t\tviewable && ! excludedPostTypes.includes( slug )\n\t\t);\n\t\treturn filteredPostTypes;\n\t}, [] );\n\tconst postTypesTaxonomiesMap = useMemo( () => {\n\t\tif ( ! postTypes?.length ) return;\n\t\treturn postTypes.reduce( ( accumulator, type ) => {\n\t\t\taccumulator[ type.slug ] = type.taxonomies;\n\t\t\treturn accumulator;\n\t\t}, {} );\n\t}, [ postTypes ] );\n\tconst postTypesSelectOptions = useMemo(\n\t\t() =>\n\t\t\t( postTypes || [] ).map( ( { labels, slug } ) => ( {\n\t\t\t\tlabel: labels.singular_name,\n\t\t\t\tvalue: slug,\n\t\t\t} ) ),\n\t\t[ postTypes ]\n\t);\n\treturn { postTypesTaxonomiesMap, postTypesSelectOptions };\n};\n\n/**\n * Hook that returns the taxonomies associated with a specific post type.\n *\n * @param {string} postType The post type from which to retrieve the associated taxonomies.\n * @return {Object[]} An array of the associated taxonomies.\n */\nexport const useTaxonomies = ( postType ) => {\n\tconst taxonomies = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getTaxonomies } = select( coreStore );\n\t\t\tconst filteredTaxonomies = getTaxonomies( {\n\t\t\t\ttype: postType,\n\t\t\t\tper_page: -1,\n\t\t\t\tcontext: 'view',\n\t\t\t} );\n\t\t\treturn filteredTaxonomies;\n\t\t},\n\t\t[ postType ]\n\t);\n\treturn taxonomies;\n};\n\n/**\n * Hook that returns whether a specific post type is hierarchical.\n *\n * @param {string} postType The post type to check.\n * @return {boolean} Whether a specific post type is hierarchical.\n */\nexport function useIsPostTypeHierarchical( postType ) {\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst type = select( coreStore ).getPostType( postType );\n\t\t\treturn type?.viewable && type?.hierarchical;\n\t\t},\n\t\t[ postType ]\n\t);\n}\n\n/**\n * Hook that returns the query properties' names defined by the active\n * block variation, to determine which block's filters to show.\n *\n * @param {Object} attributes Block attributes.\n * @return {string[]} An array of the query attributes.\n */\nexport function useAllowedControls( attributes ) {\n\treturn useSelect(\n\t\t( select ) =>\n\t\t\tselect( blocksStore ).getActiveBlockVariation(\n\t\t\t\tqueryLoopName,\n\t\t\t\tattributes\n\t\t\t)?.allowedControls,\n\n\t\t[ attributes ]\n\t);\n}\nexport function isControlAllowed( allowedControls, key ) {\n\t// Every controls is allowed if the list is not defined.\n\tif ( ! allowedControls ) {\n\t\treturn true;\n\t}\n\treturn allowedControls.includes( key );\n}\n\n/**\n * Clones a pattern's blocks and then recurses over that list of blocks,\n * transforming them to retain some `query` attribute properties.\n * For now we retain the `postType` and `inherit` properties as they are\n * fundamental for the expected functionality of the block and don't affect\n * its design and presentation.\n *\n * Returns the cloned/transformed blocks and array of existing Query Loop\n * client ids for further manipulation, in order to avoid multiple recursions.\n *\n * @param {WPBlock[]} blocks The list of blocks to look through and transform(mutate).\n * @param {Record<string,*>} queryBlockAttributes The existing Query Loop's attributes.\n * @return {{ newBlocks: WPBlock[], queryClientIds: string[] }} An object with the cloned/transformed blocks and all the Query Loop clients from these blocks.\n */\nexport const getTransformedBlocksFromPattern = (\n\tblocks,\n\tqueryBlockAttributes\n) => {\n\tconst {\n\t\tquery: { postType, inherit },\n\t} = queryBlockAttributes;\n\tconst clonedBlocks = blocks.map( ( block ) => cloneBlock( block ) );\n\tconst queryClientIds = [];\n\tconst blocksQueue = [ ...clonedBlocks ];\n\twhile ( blocksQueue.length > 0 ) {\n\t\tconst block = blocksQueue.shift();\n\t\tif ( block.name === 'core/query' ) {\n\t\t\tblock.attributes.query = {\n\t\t\t\t...block.attributes.query,\n\t\t\t\tpostType,\n\t\t\t\tinherit,\n\t\t\t};\n\t\t\tqueryClientIds.push( block.clientId );\n\t\t}\n\t\tblock.innerBlocks?.forEach( ( innerBlock ) => {\n\t\t\tblocksQueue.push( innerBlock );\n\t\t} );\n\t}\n\treturn { newBlocks: clonedBlocks, queryClientIds };\n};\n\n/**\n * Helper hook that determines if there is an active variation of the block\n * and if there are available specific patterns for this variation.\n * If there are, these patterns are going to be the only ones suggested to\n * the user in setup and replace flow, without including the default ones\n * for Query Loop.\n *\n * If there are no such patterns, the default ones for Query Loop are going\n * to be suggested.\n *\n * @param {string} clientId The block's client ID.\n * @param {Object} attributes The block's attributes.\n * @return {string} The block name to be used in the patterns suggestions.\n */\nexport function useBlockNameForPatterns( clientId, attributes ) {\n\tconst activeVariationName = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blocksStore ).getActiveBlockVariation(\n\t\t\t\tqueryLoopName,\n\t\t\t\tattributes\n\t\t\t)?.name,\n\t\t[ attributes ]\n\t);\n\tconst blockName = `${ queryLoopName }/${ activeVariationName }`;\n\tconst activeVariationPatterns = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! activeVariationName ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst { getBlockRootClientId, getPatternsByBlockTypes } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\t\t\treturn getPatternsByBlockTypes( blockName, rootClientId );\n\t\t},\n\t\t[ clientId, activeVariationName ]\n\t);\n\treturn activeVariationPatterns?.length ? blockName : queryLoopName;\n}\n\n/**\n * Helper hook that determines if there is an active variation of the block\n * and if there are available specific scoped `block` variations connected with\n * this variation.\n *\n * If there are, these variations are going to be the only ones suggested\n * to the user in setup flow when clicking to `start blank`, without including\n * the default ones for Query Loop.\n *\n * If there are no such scoped `block` variations, the default ones for Query\n * Loop are going to be suggested.\n *\n * The way we determine such variations is with the convention that they have the `namespace`\n * attribute defined as an array. This array should contain the names(`name` property) of any\n * variations they want to be connected to.\n * For example, if we have a `Query Loop` scoped `inserter` variation with the name `products`,\n * we can connect a scoped `block` variation by setting its `namespace` attribute to `['products']`.\n * If the user selects this variation, the `namespace` attribute will be overridden by the\n * main `inserter` variation.\n *\n * @param {Object} attributes The block's attributes.\n * @return {WPBlockVariation[]} The block variations to be suggested in setup flow, when clicking to `start blank`.\n */\nexport function useScopedBlockVariations( attributes ) {\n\tconst { activeVariationName, blockVariations } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getActiveBlockVariation, getBlockVariations } =\n\t\t\t\tselect( blocksStore );\n\t\t\treturn {\n\t\t\t\tactiveVariationName: getActiveBlockVariation(\n\t\t\t\t\tqueryLoopName,\n\t\t\t\t\tattributes\n\t\t\t\t)?.name,\n\t\t\t\tblockVariations: getBlockVariations( queryLoopName, 'block' ),\n\t\t\t};\n\t\t},\n\t\t[ attributes ]\n\t);\n\tconst variations = useMemo( () => {\n\t\t// Filter out the variations that have defined a `namespace` attribute,\n\t\t// which means they are 'connected' to specific variations of the block.\n\t\tconst isNotConnected = ( variation ) =>\n\t\t\t! variation.attributes?.namespace;\n\t\tif ( ! activeVariationName ) {\n\t\t\treturn blockVariations.filter( isNotConnected );\n\t\t}\n\t\tconst connectedVariations = blockVariations.filter( ( variation ) =>\n\t\t\tvariation.attributes?.namespace?.includes( activeVariationName )\n\t\t);\n\t\tif ( !! connectedVariations.length ) {\n\t\t\treturn connectedVariations;\n\t\t}\n\t\treturn blockVariations.filter( isNotConnected );\n\t}, [ activeVariationName, blockVariations ] );\n\treturn variations;\n}\n\n/**\n * Hook that returns the block patterns for a specific block type.\n *\n * @param {string} clientId The block's client ID.\n * @param {string} name The block type name.\n * @return {Object[]} An array of valid block patterns.\n */\nexport const usePatterns = ( clientId, name ) => {\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockRootClientId, getPatternsByBlockTypes } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\t\t\treturn getPatternsByBlockTypes( name, rootClientId );\n\t\t},\n\t\t[ name, clientId ]\n\t);\n};\n"]}
|
|
@@ -13,6 +13,7 @@ export default function QueryNoResultsEdit() {
|
|
|
13
13
|
const innerBlocksProps = useInnerBlocksProps(blockProps, {
|
|
14
14
|
template: TEMPLATE
|
|
15
15
|
});
|
|
16
|
-
return createElement("div", innerBlocksProps
|
|
16
|
+
return createElement("div", { ...innerBlocksProps
|
|
17
|
+
});
|
|
17
18
|
}
|
|
18
19
|
//# sourceMappingURL=edit.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/query-no-results/edit.js"],"names":["useBlockProps","useInnerBlocksProps","__","TEMPLATE","placeholder","QueryNoResultsEdit","blockProps","innerBlocksProps","template"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,aAAT,EAAwBC,mBAAxB,QAAmD,yBAAnD;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA,MAAMC,QAAQ,GAAG,CAChB,CACC,gBADD,EAEC;AACCC,EAAAA,WAAW,EAAEF,EAAE,CACd,uEADc;AADhB,CAFD,CADgB,CAAjB;AAWA,eAAe,SAASG,kBAAT,GAA8B;AAC5C,QAAMC,UAAU,GAAGN,aAAa,EAAhC;AACA,QAAMO,gBAAgB,GAAGN,mBAAmB,CAAEK,UAAF,EAAc;AACzDE,IAAAA,QAAQ,EAAEL;AAD+C,GAAd,CAA5C;AAIA,SAAO,
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/query-no-results/edit.js"],"names":["useBlockProps","useInnerBlocksProps","__","TEMPLATE","placeholder","QueryNoResultsEdit","blockProps","innerBlocksProps","template"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,aAAT,EAAwBC,mBAAxB,QAAmD,yBAAnD;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA,MAAMC,QAAQ,GAAG,CAChB,CACC,gBADD,EAEC;AACCC,EAAAA,WAAW,EAAEF,EAAE,CACd,uEADc;AADhB,CAFD,CADgB,CAAjB;AAWA,eAAe,SAASG,kBAAT,GAA8B;AAC5C,QAAMC,UAAU,GAAGN,aAAa,EAAhC;AACA,QAAMO,gBAAgB,GAAGN,mBAAmB,CAAEK,UAAF,EAAc;AACzDE,IAAAA,QAAQ,EAAEL;AAD+C,GAAd,CAA5C;AAIA,SAAO,0BAAUI;AAAV,IAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useBlockProps, useInnerBlocksProps } from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\n\nconst TEMPLATE = [\n\t[\n\t\t'core/paragraph',\n\t\t{\n\t\t\tplaceholder: __(\n\t\t\t\t'Add text or blocks that will display when a query returns no results.'\n\t\t\t),\n\t\t},\n\t],\n];\n\nexport default function QueryNoResultsEdit() {\n\tconst blockProps = useBlockProps();\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\ttemplate: TEMPLATE,\n\t} );\n\n\treturn <div { ...innerBlocksProps } />;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/query-no-results/index.js"],"names":["loop","icon","initBlock","edit","save","name","metadata","settings","init"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAI,IAAIC,IAAjB,QAA6B,kBAA7B;AAEA;AACA;AACA;;AACA,OAAOC,SAAP,MAAsB,qBAAtB
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/query-no-results/index.js"],"names":["loop","icon","initBlock","edit","save","name","metadata","settings","init"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAI,IAAIC,IAAjB,QAA6B,kBAA7B;AAEA;AACA;AACA;;AACA,OAAOC,SAAP,MAAsB,qBAAtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAOC,IAAP,MAAiB,QAAjB;AACA,OAAOC,IAAP,MAAiB,QAAjB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAWC,QAAjB;AACA,SAASA,QAAT,EAAmBD,IAAnB;AAEA,OAAO,MAAME,QAAQ,GAAG;AACvBN,EAAAA,IADuB;AAEvBE,EAAAA,IAFuB;AAGvBC,EAAAA;AAHuB,CAAjB;AAMP,OAAO,MAAMI,IAAI,GAAG,MAAMN,SAAS,CAAE;AAAEG,EAAAA,IAAF;AAAQC,EAAAA,QAAR;AAAkBC,EAAAA;AAAlB,CAAF,CAA5B","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { loop as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport save from './save';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\tsave,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"]}
|
|
@@ -7,7 +7,8 @@ import { InnerBlocks, useBlockProps } from '@wordpress/block-editor';
|
|
|
7
7
|
const deprecated = [// Version with wrapper `div` element.
|
|
8
8
|
{
|
|
9
9
|
save() {
|
|
10
|
-
return createElement("div", useBlockProps.save()
|
|
10
|
+
return createElement("div", { ...useBlockProps.save()
|
|
11
|
+
}, createElement(InnerBlocks.Content, null));
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/query-pagination/deprecated.js"],"names":["InnerBlocks","useBlockProps","deprecated","save"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,WAAT,EAAsBC,aAAtB,QAA2C,yBAA3C;AAEA,MAAMC,UAAU,GAAG,CAClB;AACA;AACCC,EAAAA,IAAI,GAAG;AACN,WACC,
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/query-pagination/deprecated.js"],"names":["InnerBlocks","useBlockProps","deprecated","save"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,WAAT,EAAsBC,aAAtB,QAA2C,yBAA3C;AAEA,MAAMC,UAAU,GAAG,CAClB;AACA;AACCC,EAAAA,IAAI,GAAG;AACN,WACC,0BAAUF,aAAa,CAACE,IAAd;AAAV,OACC,cAAC,WAAD,CAAa,OAAb,OADD,CADD;AAKA;;AAPF,CAFkB,CAAnB;AAaA,eAAeD,UAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { InnerBlocks, useBlockProps } from '@wordpress/block-editor';\n\nconst deprecated = [\n\t// Version with wrapper `div` element.\n\t{\n\t\tsave() {\n\t\t\treturn (\n\t\t\t\t<div { ...useBlockProps.save() }>\n\t\t\t\t\t<InnerBlocks.Content />\n\t\t\t\t</div>\n\t\t\t);\n\t\t},\n\t},\n];\n\nexport default deprecated;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/query-pagination/edit.js"],"names":["__","InspectorControls","useBlockProps","useInnerBlocksProps","store","blockEditorStore","useSelect","PanelBody","useEffect","QueryPaginationArrowControls","QueryPaginationLabelControl","TEMPLATE","ALLOWED_BLOCKS","QueryPaginationEdit","attributes","paginationArrow","showLabel","setAttributes","clientId","hasNextPreviousBlocks","select","getBlocks","innerBlocks","find","innerBlock","includes","name","blockProps","innerBlocksProps","template","allowedBlocks","value"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SACCC,iBADD,EAECC,aAFD,EAGCC,mBAHD,EAICC,KAAK,IAAIC,gBAJV,QAKO,yBALP;AAMA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,SAAT,QAA0B,uBAA1B;AACA,SAASC,SAAT,QAA0B,oBAA1B;AAEA;AACA;AACA;;AACA,SAASC,4BAAT,QAA6C,mCAA7C;AACA,SAASC,2BAAT,QAA4C,kCAA5C;AAEA,MAAMC,QAAQ,GAAG,CAChB,CAAE,gCAAF,CADgB,EAEhB,CAAE,+BAAF,CAFgB,EAGhB,CAAE,4BAAF,CAHgB,CAAjB;AAKA,MAAMC,cAAc,GAAG,CACtB,gCADsB,EAEtB,+BAFsB,EAGtB,4BAHsB,CAAvB;AAMA,eAAe,SAASC,mBAAT,CAA8B;AAC5CC,EAAAA,UAAU,EAAE;AAAEC,IAAAA,eAAF;AAAmBC,IAAAA;AAAnB,GADgC;AAE5CC,EAAAA,aAF4C;AAG5CC,EAAAA;AAH4C,CAA9B,EAIX;AACH,QAAMC,qBAAqB,GAAGb,SAAS,CAAIc,MAAF,IAAc;AACtD,UAAM;AAAEC,MAAAA;AAAF,QAAgBD,MAAM,CAAEf,gBAAF,CAA5B;AACA,UAAMiB,WAAW,GAAGD,SAAS,CAAEH,QAAF,CAA7B;AACA;AACF;AACA;AACA;;AACE,WAAOI,WAAW,EAAEC,IAAb,CAAqBC,UAAF,IAAkB;AAC3C,aAAO,CACN,4BADM,EAEN,gCAFM,EAGLC,QAHK,CAGKD,UAAU,CAACE,IAHhB,CAAP;AAIA,KALM,CAAP;AAMA,GAbsC,EAapC,EAboC,CAAvC;AAcA,QAAMC,UAAU,GAAGzB,aAAa,EAAhC;AACA,QAAM0B,gBAAgB,GAAGzB,mBAAmB,CAAEwB,UAAF,EAAc;AACzDE,IAAAA,QAAQ,EAAElB,QAD+C;AAEzDmB,IAAAA,aAAa,EAAElB;AAF0C,GAAd,CAA5C,CAhBG,CAoBH;;AACAJ,EAAAA,SAAS,CAAE,MAAM;AAChB,QAAKO,eAAe,KAAK,MAApB,IAA8B,CAAEC,SAArC,EAAiD;AAChDC,MAAAA,aAAa,CAAE;AAAED,QAAAA,SAAS,EAAE;AAAb,OAAF,CAAb;AACA;AACD,GAJQ,EAIN,CAAED,eAAF,EAAmBE,aAAnB,EAAkCD,SAAlC,CAJM,CAAT;AAKA,SACC,8BACGG,qBAAqB,IACtB,cAAC,iBAAD,QACC,cAAC,SAAD;AAAW,IAAA,KAAK,EAAGnB,EAAE,CAAE,UAAF;AAArB,KACC,cAAC,4BAAD;AACC,IAAA,KAAK,EAAGe,eADT;AAEC,IAAA,QAAQ,EAAKgB,KAAF,IAAa;AACvBd,MAAAA,aAAa,CAAE;AAAEF,QAAAA,eAAe,EAAEgB;AAAnB,OAAF,CAAb;AACA;AAJF,IADD,EAOGhB,eAAe,KAAK,MAApB,IACD,cAAC,2BAAD;AACC,IAAA,KAAK,EAAGC,SADT;AAEC,IAAA,QAAQ,EAAKe,KAAF,IAAa;AACvBd,MAAAA,aAAa,CAAE;AAAED,QAAAA,SAAS,EAAEe;AAAb,OAAF,CAAb;AACA;AAJF,IARF,CADD,CAFF,EAqBC,
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/query-pagination/edit.js"],"names":["__","InspectorControls","useBlockProps","useInnerBlocksProps","store","blockEditorStore","useSelect","PanelBody","useEffect","QueryPaginationArrowControls","QueryPaginationLabelControl","TEMPLATE","ALLOWED_BLOCKS","QueryPaginationEdit","attributes","paginationArrow","showLabel","setAttributes","clientId","hasNextPreviousBlocks","select","getBlocks","innerBlocks","find","innerBlock","includes","name","blockProps","innerBlocksProps","template","allowedBlocks","value"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SACCC,iBADD,EAECC,aAFD,EAGCC,mBAHD,EAICC,KAAK,IAAIC,gBAJV,QAKO,yBALP;AAMA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,SAAT,QAA0B,uBAA1B;AACA,SAASC,SAAT,QAA0B,oBAA1B;AAEA;AACA;AACA;;AACA,SAASC,4BAAT,QAA6C,mCAA7C;AACA,SAASC,2BAAT,QAA4C,kCAA5C;AAEA,MAAMC,QAAQ,GAAG,CAChB,CAAE,gCAAF,CADgB,EAEhB,CAAE,+BAAF,CAFgB,EAGhB,CAAE,4BAAF,CAHgB,CAAjB;AAKA,MAAMC,cAAc,GAAG,CACtB,gCADsB,EAEtB,+BAFsB,EAGtB,4BAHsB,CAAvB;AAMA,eAAe,SAASC,mBAAT,CAA8B;AAC5CC,EAAAA,UAAU,EAAE;AAAEC,IAAAA,eAAF;AAAmBC,IAAAA;AAAnB,GADgC;AAE5CC,EAAAA,aAF4C;AAG5CC,EAAAA;AAH4C,CAA9B,EAIX;AACH,QAAMC,qBAAqB,GAAGb,SAAS,CAAIc,MAAF,IAAc;AACtD,UAAM;AAAEC,MAAAA;AAAF,QAAgBD,MAAM,CAAEf,gBAAF,CAA5B;AACA,UAAMiB,WAAW,GAAGD,SAAS,CAAEH,QAAF,CAA7B;AACA;AACF;AACA;AACA;;AACE,WAAOI,WAAW,EAAEC,IAAb,CAAqBC,UAAF,IAAkB;AAC3C,aAAO,CACN,4BADM,EAEN,gCAFM,EAGLC,QAHK,CAGKD,UAAU,CAACE,IAHhB,CAAP;AAIA,KALM,CAAP;AAMA,GAbsC,EAapC,EAboC,CAAvC;AAcA,QAAMC,UAAU,GAAGzB,aAAa,EAAhC;AACA,QAAM0B,gBAAgB,GAAGzB,mBAAmB,CAAEwB,UAAF,EAAc;AACzDE,IAAAA,QAAQ,EAAElB,QAD+C;AAEzDmB,IAAAA,aAAa,EAAElB;AAF0C,GAAd,CAA5C,CAhBG,CAoBH;;AACAJ,EAAAA,SAAS,CAAE,MAAM;AAChB,QAAKO,eAAe,KAAK,MAApB,IAA8B,CAAEC,SAArC,EAAiD;AAChDC,MAAAA,aAAa,CAAE;AAAED,QAAAA,SAAS,EAAE;AAAb,OAAF,CAAb;AACA;AACD,GAJQ,EAIN,CAAED,eAAF,EAAmBE,aAAnB,EAAkCD,SAAlC,CAJM,CAAT;AAKA,SACC,8BACGG,qBAAqB,IACtB,cAAC,iBAAD,QACC,cAAC,SAAD;AAAW,IAAA,KAAK,EAAGnB,EAAE,CAAE,UAAF;AAArB,KACC,cAAC,4BAAD;AACC,IAAA,KAAK,EAAGe,eADT;AAEC,IAAA,QAAQ,EAAKgB,KAAF,IAAa;AACvBd,MAAAA,aAAa,CAAE;AAAEF,QAAAA,eAAe,EAAEgB;AAAnB,OAAF,CAAb;AACA;AAJF,IADD,EAOGhB,eAAe,KAAK,MAApB,IACD,cAAC,2BAAD;AACC,IAAA,KAAK,EAAGC,SADT;AAEC,IAAA,QAAQ,EAAKe,KAAF,IAAa;AACvBd,MAAAA,aAAa,CAAE;AAAED,QAAAA,SAAS,EAAEe;AAAb,OAAF,CAAb;AACA;AAJF,IARF,CADD,CAFF,EAqBC,0BAAUH;AAAV,IArBD,CADD;AAyBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tInspectorControls,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { PanelBody } from '@wordpress/components';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { QueryPaginationArrowControls } from './query-pagination-arrow-controls';\nimport { QueryPaginationLabelControl } from './query-pagination-label-control';\n\nconst TEMPLATE = [\n\t[ 'core/query-pagination-previous' ],\n\t[ 'core/query-pagination-numbers' ],\n\t[ 'core/query-pagination-next' ],\n];\nconst ALLOWED_BLOCKS = [\n\t'core/query-pagination-previous',\n\t'core/query-pagination-numbers',\n\t'core/query-pagination-next',\n];\n\nexport default function QueryPaginationEdit( {\n\tattributes: { paginationArrow, showLabel },\n\tsetAttributes,\n\tclientId,\n} ) {\n\tconst hasNextPreviousBlocks = useSelect( ( select ) => {\n\t\tconst { getBlocks } = select( blockEditorStore );\n\t\tconst innerBlocks = getBlocks( clientId );\n\t\t/**\n\t\t * Show the `paginationArrow` and `showLabel` controls only if a\n\t\t * `QueryPaginationNext/Previous` block exists.\n\t\t */\n\t\treturn innerBlocks?.find( ( innerBlock ) => {\n\t\t\treturn [\n\t\t\t\t'core/query-pagination-next',\n\t\t\t\t'core/query-pagination-previous',\n\t\t\t].includes( innerBlock.name );\n\t\t} );\n\t}, [] );\n\tconst blockProps = useBlockProps();\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\ttemplate: TEMPLATE,\n\t\tallowedBlocks: ALLOWED_BLOCKS,\n\t} );\n\t// Always show label text if paginationArrow is set to 'none'.\n\tuseEffect( () => {\n\t\tif ( paginationArrow === 'none' && ! showLabel ) {\n\t\t\tsetAttributes( { showLabel: true } );\n\t\t}\n\t}, [ paginationArrow, setAttributes, showLabel ] );\n\treturn (\n\t\t<>\n\t\t\t{ hasNextPreviousBlocks && (\n\t\t\t\t<InspectorControls>\n\t\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t\t<QueryPaginationArrowControls\n\t\t\t\t\t\t\tvalue={ paginationArrow }\n\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\tsetAttributes( { paginationArrow: value } );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ paginationArrow !== 'none' && (\n\t\t\t\t\t\t\t<QueryPaginationLabelControl\n\t\t\t\t\t\t\t\tvalue={ showLabel }\n\t\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\t\tsetAttributes( { showLabel: value } );\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</PanelBody>\n\t\t\t\t</InspectorControls>\n\t\t\t) }\n\t\t\t<nav { ...innerBlocksProps } />\n\t\t</>\n\t);\n}\n"]}
|
|
@@ -32,7 +32,6 @@ const metadata = {
|
|
|
32
32
|
showLabel: "showLabel"
|
|
33
33
|
},
|
|
34
34
|
supports: {
|
|
35
|
-
anchor: true,
|
|
36
35
|
align: true,
|
|
37
36
|
reusable: false,
|
|
38
37
|
html: false,
|
|
@@ -45,7 +44,7 @@ const metadata = {
|
|
|
45
44
|
link: true
|
|
46
45
|
}
|
|
47
46
|
},
|
|
48
|
-
|
|
47
|
+
layout: {
|
|
49
48
|
allowSwitching: false,
|
|
50
49
|
allowInheriting: false,
|
|
51
50
|
"default": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/query-pagination/index.js"],"names":["queryPagination","icon","initBlock","edit","save","deprecated","name","metadata","settings","init"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAe,IAAIC,IAA5B,QAAwC,kBAAxC;AAEA;AACA;AACA;;AACA,OAAOC,SAAP,MAAsB,qBAAtB
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/query-pagination/index.js"],"names":["queryPagination","icon","initBlock","edit","save","deprecated","name","metadata","settings","init"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAe,IAAIC,IAA5B,QAAwC,kBAAxC;AAEA;AACA;AACA;;AACA,OAAOC,SAAP,MAAsB,qBAAtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAOC,IAAP,MAAiB,QAAjB;AACA,OAAOC,IAAP,MAAiB,QAAjB;AACA,OAAOC,UAAP,MAAuB,cAAvB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAWC,QAAjB;AACA,SAASA,QAAT,EAAmBD,IAAnB;AAEA,OAAO,MAAME,QAAQ,GAAG;AACvBP,EAAAA,IADuB;AAEvBE,EAAAA,IAFuB;AAGvBC,EAAAA,IAHuB;AAIvBC,EAAAA;AAJuB,CAAjB;AAOP,OAAO,MAAMI,IAAI,GAAG,MAAMP,SAAS,CAAE;AAAEI,EAAAA,IAAF;AAAQC,EAAAA,QAAR;AAAkBC,EAAAA;AAAlB,CAAF,CAA5B","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { queryPagination as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport save from './save';\nimport deprecated from './deprecated';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\tsave,\n\tdeprecated,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
1
|
import { createElement } from "@wordpress/element";
|
|
3
2
|
|
|
4
3
|
/**
|
|
@@ -22,10 +21,11 @@ export default function QueryPaginationNextEdit({
|
|
|
22
21
|
}
|
|
23
22
|
}) {
|
|
24
23
|
const displayArrow = arrowMap[paginationArrow];
|
|
25
|
-
return createElement("a",
|
|
24
|
+
return createElement("a", {
|
|
26
25
|
href: "#pagination-next-pseudo-link",
|
|
27
|
-
onClick: event => event.preventDefault()
|
|
28
|
-
|
|
26
|
+
onClick: event => event.preventDefault(),
|
|
27
|
+
...useBlockProps()
|
|
28
|
+
}, showLabel && createElement(PlainText, {
|
|
29
29
|
__experimentalVersion: 2,
|
|
30
30
|
tagName: "span",
|
|
31
31
|
"aria-label": __('Next page link'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/query-pagination-next/edit.js"],"names":["__","useBlockProps","PlainText","arrowMap","none","arrow","chevron","QueryPaginationNextEdit","attributes","label","setAttributes","context","paginationArrow","showLabel","displayArrow","event","preventDefault","newLabel"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/query-pagination-next/edit.js"],"names":["__","useBlockProps","PlainText","arrowMap","none","arrow","chevron","QueryPaginationNextEdit","attributes","label","setAttributes","context","paginationArrow","showLabel","displayArrow","event","preventDefault","newLabel"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,aAAT,EAAwBC,SAAxB,QAAyC,yBAAzC;AAEA,MAAMC,QAAQ,GAAG;AAChBC,EAAAA,IAAI,EAAE,EADU;AAEhBC,EAAAA,KAAK,EAAE,GAFS;AAGhBC,EAAAA,OAAO,EAAE;AAHO,CAAjB;AAMA,eAAe,SAASC,uBAAT,CAAkC;AAChDC,EAAAA,UAAU,EAAE;AAAEC,IAAAA;AAAF,GADoC;AAEhDC,EAAAA,aAFgD;AAGhDC,EAAAA,OAAO,EAAE;AAAEC,IAAAA,eAAF;AAAmBC,IAAAA;AAAnB;AAHuC,CAAlC,EAIX;AACH,QAAMC,YAAY,GAAGX,QAAQ,CAAES,eAAF,CAA7B;AACA,SACC;AACC,IAAA,IAAI,EAAC,8BADN;AAEC,IAAA,OAAO,EAAKG,KAAF,IAAaA,KAAK,CAACC,cAAN,EAFxB;AAAA,OAGMf,aAAa;AAHnB,KAKGY,SAAS,IACV,cAAC,SAAD;AACC,IAAA,qBAAqB,EAAG,CADzB;AAEC,IAAA,OAAO,EAAC,MAFT;AAGC,kBAAab,EAAE,CAAE,gBAAF,CAHhB;AAIC,IAAA,WAAW,EAAGA,EAAE,CAAE,WAAF,CAJjB;AAKC,IAAA,KAAK,EAAGS,KALT;AAMC,IAAA,QAAQ,EAAKQ,QAAF,IACVP,aAAa,CAAE;AAAED,MAAAA,KAAK,EAAEQ;AAAT,KAAF;AAPf,IANF,EAiBGH,YAAY,IACb;AACC,IAAA,SAAS,EAAI,iDAAiDF,eAAiB,EADhF;AAEC,mBAAc;AAFf,KAIGE,YAJH,CAlBF,CADD;AA4BA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useBlockProps, PlainText } from '@wordpress/block-editor';\n\nconst arrowMap = {\n\tnone: '',\n\tarrow: '→',\n\tchevron: '»',\n};\n\nexport default function QueryPaginationNextEdit( {\n\tattributes: { label },\n\tsetAttributes,\n\tcontext: { paginationArrow, showLabel },\n} ) {\n\tconst displayArrow = arrowMap[ paginationArrow ];\n\treturn (\n\t\t<a\n\t\t\thref=\"#pagination-next-pseudo-link\"\n\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t{ ...useBlockProps() }\n\t\t>\n\t\t\t{ showLabel && (\n\t\t\t\t<PlainText\n\t\t\t\t\t__experimentalVersion={ 2 }\n\t\t\t\t\ttagName=\"span\"\n\t\t\t\t\taria-label={ __( 'Next page link' ) }\n\t\t\t\t\tplaceholder={ __( 'Next Page' ) }\n\t\t\t\t\tvalue={ label }\n\t\t\t\t\tonChange={ ( newLabel ) =>\n\t\t\t\t\t\tsetAttributes( { label: newLabel } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ displayArrow && (\n\t\t\t\t<span\n\t\t\t\t\tclassName={ `wp-block-query-pagination-next-arrow is-arrow-${ paginationArrow }` }\n\t\t\t\t\taria-hidden={ true }\n\t\t\t\t>\n\t\t\t\t\t{ displayArrow }\n\t\t\t\t</span>\n\t\t\t) }\n\t\t</a>\n\t);\n}\n"]}
|