@wordpress/block-library 9.2.0 → 9.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/build/audio/edit.js +20 -8
- package/build/audio/edit.js.map +1 -1
- package/build/audio/index.js +4 -0
- package/build/audio/index.js.map +1 -1
- package/build/audio/transforms.js +1 -1
- package/build/audio/transforms.js.map +1 -1
- package/build/block/edit.js +38 -24
- package/build/block/edit.js.map +1 -1
- package/build/block/index.js +5 -1
- package/build/block/index.js.map +1 -1
- package/build/button/edit.js +1 -1
- package/build/button/edit.js.map +1 -1
- package/build/buttons/index.js +26 -0
- package/build/buttons/index.js.map +1 -1
- package/build/categories/edit.js +20 -3
- package/build/categories/edit.js.map +1 -1
- package/build/categories/index.js +8 -0
- package/build/categories/index.js.map +1 -1
- package/build/columns/index.js +2 -2
- package/build/columns/index.js.map +1 -1
- package/build/cover/edit/inspector-controls.js +2 -1
- package/build/cover/edit/inspector-controls.js.map +1 -1
- package/build/embed/embed-preview.js +4 -4
- package/build/embed/embed-preview.js.map +1 -1
- package/build/embed/variations.js +39 -34
- package/build/embed/variations.js.map +1 -1
- package/build/file/edit.js +14 -6
- package/build/file/edit.js.map +1 -1
- package/build/file/index.js +4 -0
- package/build/file/index.js.map +1 -1
- package/build/file/transforms.js +2 -3
- package/build/file/transforms.js.map +1 -1
- package/build/footnotes/index.js +1 -1
- package/build/footnotes/index.js.map +1 -1
- package/build/form-input/edit.js +2 -0
- package/build/form-input/edit.js.map +1 -1
- package/build/gallery/deprecated.js +6 -54
- package/build/gallery/deprecated.js.map +1 -1
- package/build/gallery/edit.js +9 -8
- package/build/gallery/edit.js.map +1 -1
- package/build/gallery/index.js +12 -2
- package/build/gallery/index.js.map +1 -1
- package/build/gallery/save.js +0 -11
- package/build/gallery/save.js.map +1 -1
- package/build/gallery/shared.js +0 -27
- package/build/gallery/shared.js.map +1 -1
- package/build/gallery/transforms.js +29 -80
- package/build/gallery/transforms.js.map +1 -1
- package/build/group/deprecated.js +2 -5
- package/build/group/deprecated.js.map +1 -1
- package/build/group/index.js +1 -0
- package/build/group/index.js.map +1 -1
- package/build/group/placeholder.js +5 -0
- package/build/group/placeholder.js.map +1 -1
- package/build/heading/index.js +14 -1
- package/build/heading/index.js.map +1 -1
- package/build/image/edit.js +14 -22
- package/build/image/edit.js.map +1 -1
- package/build/image/image.js +54 -28
- package/build/image/image.js.map +1 -1
- package/build/image/index.js +7 -0
- package/build/image/index.js.map +1 -1
- package/build/image/transforms.js +1 -1
- package/build/image/transforms.js.map +1 -1
- package/build/image/view.js +65 -49
- package/build/image/view.js.map +1 -1
- package/build/latest-comments/index.js +9 -0
- package/build/latest-comments/index.js.map +1 -1
- package/build/list/edit.js +3 -3
- package/build/list/edit.js.map +1 -1
- package/build/list-item/edit.js +3 -3
- package/build/list-item/edit.js.map +1 -1
- package/build/list-item/hooks/index.js +0 -7
- package/build/list-item/hooks/index.js.map +1 -1
- package/build/list-item/hooks/use-merge.js +8 -1
- package/build/list-item/hooks/use-merge.js.map +1 -1
- package/build/list-item/index.js +11 -1
- package/build/list-item/index.js.map +1 -1
- package/build/loginout/index.js +3 -0
- package/build/loginout/index.js.map +1 -1
- package/build/media-text/edit.js +3 -2
- package/build/media-text/edit.js.map +1 -1
- package/build/media-text/index.js +12 -0
- package/build/media-text/index.js.map +1 -1
- package/build/navigation/edit/navigation-menu-delete-control.js +1 -0
- package/build/navigation/edit/navigation-menu-delete-control.js.map +1 -1
- package/build/navigation/use-navigation-menu.js +5 -1
- package/build/navigation/use-navigation-menu.js.map +1 -1
- package/build/navigation-link/link-ui.js +13 -17
- package/build/navigation-link/link-ui.js.map +1 -1
- package/build/navigation-submenu/edit.js +1 -12
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/page-list/convert-to-links-modal.js +1 -1
- package/build/page-list/convert-to-links-modal.js.map +1 -1
- package/build/page-list/edit.js +2 -1
- package/build/page-list/edit.js.map +1 -1
- package/build/page-list-item/edit.js +4 -1
- package/build/page-list-item/edit.js.map +1 -1
- package/build/paragraph/index.js +6 -0
- package/build/paragraph/index.js.map +1 -1
- package/build/paragraph/transforms.js +6 -0
- package/build/paragraph/transforms.js.map +1 -1
- package/build/post-author/index.js +8 -0
- package/build/post-author/index.js.map +1 -1
- package/build/post-author-biography/index.js +3 -0
- package/build/post-author-biography/index.js.map +1 -1
- package/build/post-author-name/index.js +3 -0
- package/build/post-author-name/index.js.map +1 -1
- package/build/post-content/index.js +3 -0
- package/build/post-content/index.js.map +1 -1
- package/build/post-date/edit.js +3 -1
- package/build/post-date/edit.js.map +1 -1
- package/build/post-date/index.js +3 -0
- package/build/post-date/index.js.map +1 -1
- package/build/post-excerpt/edit.js +1 -0
- package/build/post-excerpt/edit.js.map +1 -1
- package/build/post-excerpt/index.js +3 -0
- package/build/post-excerpt/index.js.map +1 -1
- package/build/post-featured-image/index.js +3 -0
- package/build/post-featured-image/index.js.map +1 -1
- package/build/post-terms/index.js +3 -0
- package/build/post-terms/index.js.map +1 -1
- package/build/post-title/edit.js +5 -1
- package/build/post-title/edit.js.map +1 -1
- package/build/post-title/index.js +3 -0
- package/build/post-title/index.js.map +1 -1
- package/build/query/edit/inspector-controls/author-control.js +3 -1
- package/build/query/edit/inspector-controls/author-control.js.map +1 -1
- package/build/query/edit/inspector-controls/index.js +27 -8
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/edit/inspector-controls/order-control.js +1 -0
- package/build/query/edit/inspector-controls/order-control.js.map +1 -1
- package/build/query/edit/inspector-controls/parent-control.js +2 -1
- package/build/query/edit/inspector-controls/parent-control.js.map +1 -1
- package/build/query/edit/inspector-controls/sticky-control.js +1 -0
- package/build/query/edit/inspector-controls/sticky-control.js.map +1 -1
- package/build/query/edit/inspector-controls/taxonomy-controls.js +5 -2
- package/build/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
- package/build/query/edit/query-content.js +11 -2
- package/build/query/edit/query-content.js.map +1 -1
- package/build/query/edit/query-placeholder.js +1 -14
- package/build/query/edit/query-placeholder.js.map +1 -1
- package/build/query/edit/query-toolbar.js +54 -61
- package/build/query/edit/query-toolbar.js.map +1 -1
- package/build/query/index.js +34 -0
- package/build/query/index.js.map +1 -1
- package/build/query/utils.js +5 -1
- package/build/query/utils.js.map +1 -1
- package/build/query/variations.js +9 -55
- package/build/query/variations.js.map +1 -1
- package/build/query-pagination-numbers/edit.js +1 -0
- package/build/query-pagination-numbers/edit.js.map +1 -1
- package/build/query-title/edit.js +11 -19
- package/build/query-title/edit.js.map +1 -1
- package/build/query-title/use-archive-label.js +95 -0
- package/build/query-title/use-archive-label.js.map +1 -0
- package/build/quote/index.js +15 -1
- package/build/quote/index.js.map +1 -1
- package/build/search/index.js +3 -0
- package/build/search/index.js.map +1 -1
- package/build/site-logo/edit.js +4 -1
- package/build/site-logo/edit.js.map +1 -1
- package/build/site-tagline/edit.js +5 -2
- package/build/site-tagline/edit.js.map +1 -1
- package/build/site-tagline/index.js +6 -1
- package/build/site-tagline/index.js.map +1 -1
- package/build/site-title/edit.js +4 -1
- package/build/site-title/edit.js.map +1 -1
- package/build/site-title/index.js +6 -1
- package/build/site-title/index.js.map +1 -1
- package/build/social-link/edit.js +27 -7
- package/build/social-link/edit.js.map +1 -1
- package/build/social-link/icons/soundcloud.js +1 -1
- package/build/social-link/icons/soundcloud.js.map +1 -1
- package/build/social-links/index.js +12 -0
- package/build/social-links/index.js.map +1 -1
- package/build/table/edit.js +8 -17
- package/build/table/edit.js.map +1 -1
- package/build/tag-cloud/edit.js +4 -1
- package/build/tag-cloud/edit.js.map +1 -1
- package/build/template-part/edit/index.js +5 -3
- package/build/template-part/edit/index.js.map +1 -1
- package/build/template-part/edit/inner-blocks.js +8 -3
- package/build/template-part/edit/inner-blocks.js.map +1 -1
- package/build/template-part/edit/placeholder.js +23 -3
- package/build/template-part/edit/placeholder.js.map +1 -1
- package/build/template-part/edit/title-modal.js +21 -9
- package/build/template-part/edit/title-modal.js.map +1 -1
- package/build/term-description/index.js +12 -0
- package/build/term-description/index.js.map +1 -1
- package/build/utils/hooks.js +17 -1
- package/build/utils/hooks.js.map +1 -1
- package/build/video/deprecated.js +4 -0
- package/build/video/deprecated.js.map +1 -1
- package/build/video/edit.js +17 -7
- package/build/video/edit.js.map +1 -1
- package/build/video/index.js +4 -0
- package/build/video/index.js.map +1 -1
- package/build/video/transforms.js +1 -1
- package/build/video/transforms.js.map +1 -1
- package/build-module/audio/edit.js +20 -8
- package/build-module/audio/edit.js.map +1 -1
- package/build-module/audio/index.js +4 -0
- package/build-module/audio/index.js.map +1 -1
- package/build-module/audio/transforms.js +1 -1
- package/build-module/audio/transforms.js.map +1 -1
- package/build-module/block/edit.js +38 -24
- package/build-module/block/edit.js.map +1 -1
- package/build-module/block/index.js +5 -1
- package/build-module/block/index.js.map +1 -1
- package/build-module/button/edit.js +1 -1
- package/build-module/button/edit.js.map +1 -1
- package/build-module/buttons/index.js +26 -0
- package/build-module/buttons/index.js.map +1 -1
- package/build-module/categories/edit.js +21 -4
- package/build-module/categories/edit.js.map +1 -1
- package/build-module/categories/index.js +8 -0
- package/build-module/categories/index.js.map +1 -1
- package/build-module/columns/index.js +2 -2
- package/build-module/columns/index.js.map +1 -1
- package/build-module/cover/edit/inspector-controls.js +2 -1
- package/build-module/cover/edit/inspector-controls.js.map +1 -1
- package/build-module/embed/embed-preview.js +4 -4
- package/build-module/embed/embed-preview.js.map +1 -1
- package/build-module/embed/variations.js +40 -35
- package/build-module/embed/variations.js.map +1 -1
- package/build-module/file/edit.js +15 -7
- package/build-module/file/edit.js.map +1 -1
- package/build-module/file/index.js +4 -0
- package/build-module/file/index.js.map +1 -1
- package/build-module/file/transforms.js +2 -3
- package/build-module/file/transforms.js.map +1 -1
- package/build-module/footnotes/index.js +1 -1
- package/build-module/footnotes/index.js.map +1 -1
- package/build-module/form-input/edit.js +2 -0
- package/build-module/form-input/edit.js.map +1 -1
- package/build-module/gallery/deprecated.js +6 -54
- package/build-module/gallery/deprecated.js.map +1 -1
- package/build-module/gallery/edit.js +10 -9
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/gallery/index.js +11 -1
- package/build-module/gallery/index.js.map +1 -1
- package/build-module/gallery/save.js +0 -11
- package/build-module/gallery/save.js.map +1 -1
- package/build-module/gallery/shared.js +0 -25
- package/build-module/gallery/shared.js.map +1 -1
- package/build-module/gallery/transforms.js +29 -80
- package/build-module/gallery/transforms.js.map +1 -1
- package/build-module/group/deprecated.js +2 -5
- package/build-module/group/deprecated.js.map +1 -1
- package/build-module/group/index.js +1 -0
- package/build-module/group/index.js.map +1 -1
- package/build-module/group/placeholder.js +5 -0
- package/build-module/group/placeholder.js.map +1 -1
- package/build-module/heading/index.js +14 -1
- package/build-module/heading/index.js.map +1 -1
- package/build-module/image/edit.js +13 -21
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/image.js +50 -24
- package/build-module/image/image.js.map +1 -1
- package/build-module/image/index.js +7 -0
- package/build-module/image/index.js.map +1 -1
- package/build-module/image/transforms.js +1 -1
- package/build-module/image/transforms.js.map +1 -1
- package/build-module/image/view.js +65 -49
- package/build-module/image/view.js.map +1 -1
- package/build-module/latest-comments/index.js +9 -0
- package/build-module/latest-comments/index.js.map +1 -1
- package/build-module/list/edit.js +3 -3
- package/build-module/list/edit.js.map +1 -1
- package/build-module/list-item/edit.js +3 -3
- package/build-module/list-item/edit.js.map +1 -1
- package/build-module/list-item/hooks/index.js +0 -1
- package/build-module/list-item/hooks/index.js.map +1 -1
- package/build-module/list-item/hooks/use-merge.js +8 -1
- package/build-module/list-item/hooks/use-merge.js.map +1 -1
- package/build-module/list-item/index.js +11 -1
- package/build-module/list-item/index.js.map +1 -1
- package/build-module/loginout/index.js +3 -0
- package/build-module/loginout/index.js.map +1 -1
- package/build-module/media-text/edit.js +3 -2
- package/build-module/media-text/edit.js.map +1 -1
- package/build-module/media-text/index.js +12 -0
- package/build-module/media-text/index.js.map +1 -1
- package/build-module/navigation/edit/navigation-menu-delete-control.js +1 -0
- package/build-module/navigation/edit/navigation-menu-delete-control.js.map +1 -1
- package/build-module/navigation/use-navigation-menu.js +5 -1
- package/build-module/navigation/use-navigation-menu.js.map +1 -1
- package/build-module/navigation-link/link-ui.js +13 -17
- package/build-module/navigation-link/link-ui.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +1 -12
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/page-list/convert-to-links-modal.js +1 -1
- package/build-module/page-list/convert-to-links-modal.js.map +1 -1
- package/build-module/page-list/edit.js +2 -1
- package/build-module/page-list/edit.js.map +1 -1
- package/build-module/page-list-item/edit.js +4 -1
- package/build-module/page-list-item/edit.js.map +1 -1
- package/build-module/paragraph/index.js +6 -0
- package/build-module/paragraph/index.js.map +1 -1
- package/build-module/paragraph/transforms.js +6 -0
- package/build-module/paragraph/transforms.js.map +1 -1
- package/build-module/post-author/index.js +8 -0
- package/build-module/post-author/index.js.map +1 -1
- package/build-module/post-author-biography/index.js +3 -0
- package/build-module/post-author-biography/index.js.map +1 -1
- package/build-module/post-author-name/index.js +3 -0
- package/build-module/post-author-name/index.js.map +1 -1
- package/build-module/post-content/index.js +3 -0
- package/build-module/post-content/index.js.map +1 -1
- package/build-module/post-date/edit.js +4 -2
- package/build-module/post-date/edit.js.map +1 -1
- package/build-module/post-date/index.js +3 -0
- package/build-module/post-date/index.js.map +1 -1
- package/build-module/post-excerpt/edit.js +1 -0
- package/build-module/post-excerpt/edit.js.map +1 -1
- package/build-module/post-excerpt/index.js +3 -0
- package/build-module/post-excerpt/index.js.map +1 -1
- package/build-module/post-featured-image/index.js +3 -0
- package/build-module/post-featured-image/index.js.map +1 -1
- package/build-module/post-terms/index.js +3 -0
- package/build-module/post-terms/index.js.map +1 -1
- package/build-module/post-title/edit.js +5 -1
- package/build-module/post-title/edit.js.map +1 -1
- package/build-module/post-title/index.js +3 -0
- package/build-module/post-title/index.js.map +1 -1
- package/build-module/query/edit/inspector-controls/author-control.js +3 -1
- package/build-module/query/edit/inspector-controls/author-control.js.map +1 -1
- package/build-module/query/edit/inspector-controls/index.js +28 -9
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/query/edit/inspector-controls/order-control.js +1 -0
- package/build-module/query/edit/inspector-controls/order-control.js.map +1 -1
- package/build-module/query/edit/inspector-controls/parent-control.js +2 -1
- package/build-module/query/edit/inspector-controls/parent-control.js.map +1 -1
- package/build-module/query/edit/inspector-controls/sticky-control.js +1 -0
- package/build-module/query/edit/inspector-controls/sticky-control.js.map +1 -1
- package/build-module/query/edit/inspector-controls/taxonomy-controls.js +6 -4
- package/build-module/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
- package/build-module/query/edit/query-content.js +11 -2
- package/build-module/query/edit/query-content.js.map +1 -1
- package/build-module/query/edit/query-placeholder.js +1 -14
- package/build-module/query/edit/query-placeholder.js.map +1 -1
- package/build-module/query/edit/query-toolbar.js +55 -62
- package/build-module/query/edit/query-toolbar.js.map +1 -1
- package/build-module/query/index.js +34 -0
- package/build-module/query/index.js.map +1 -1
- package/build-module/query/utils.js +5 -1
- package/build-module/query/utils.js.map +1 -1
- package/build-module/query/variations.js +4 -50
- package/build-module/query/variations.js.map +1 -1
- package/build-module/query-pagination-numbers/edit.js +1 -0
- package/build-module/query-pagination-numbers/edit.js.map +1 -1
- package/build-module/query-title/edit.js +12 -20
- package/build-module/query-title/edit.js.map +1 -1
- package/build-module/query-title/use-archive-label.js +88 -0
- package/build-module/query-title/use-archive-label.js.map +1 -0
- package/build-module/quote/index.js +15 -1
- package/build-module/quote/index.js.map +1 -1
- package/build-module/search/index.js +3 -0
- package/build-module/search/index.js.map +1 -1
- package/build-module/site-logo/edit.js +4 -1
- package/build-module/site-logo/edit.js.map +1 -1
- package/build-module/site-tagline/edit.js +5 -2
- package/build-module/site-tagline/edit.js.map +1 -1
- package/build-module/site-tagline/index.js +6 -1
- package/build-module/site-tagline/index.js.map +1 -1
- package/build-module/site-title/edit.js +4 -1
- package/build-module/site-title/edit.js.map +1 -1
- package/build-module/site-title/index.js +6 -1
- package/build-module/site-title/index.js.map +1 -1
- package/build-module/social-link/edit.js +28 -8
- package/build-module/social-link/edit.js.map +1 -1
- package/build-module/social-link/icons/soundcloud.js +1 -1
- package/build-module/social-link/icons/soundcloud.js.map +1 -1
- package/build-module/social-links/index.js +12 -0
- package/build-module/social-links/index.js.map +1 -1
- package/build-module/table/edit.js +9 -18
- package/build-module/table/edit.js.map +1 -1
- package/build-module/tag-cloud/edit.js +4 -1
- package/build-module/tag-cloud/edit.js.map +1 -1
- package/build-module/template-part/edit/index.js +5 -3
- package/build-module/template-part/edit/index.js.map +1 -1
- package/build-module/template-part/edit/inner-blocks.js +8 -3
- package/build-module/template-part/edit/inner-blocks.js.map +1 -1
- package/build-module/template-part/edit/placeholder.js +23 -3
- package/build-module/template-part/edit/placeholder.js.map +1 -1
- package/build-module/template-part/edit/title-modal.js +21 -9
- package/build-module/template-part/edit/title-modal.js.map +1 -1
- package/build-module/term-description/index.js +12 -0
- package/build-module/term-description/index.js.map +1 -1
- package/build-module/utils/hooks.js +16 -1
- package/build-module/utils/hooks.js.map +1 -1
- package/build-module/video/deprecated.js +4 -0
- package/build-module/video/deprecated.js.map +1 -1
- package/build-module/video/edit.js +18 -8
- package/build-module/video/edit.js.map +1 -1
- package/build-module/video/index.js +4 -0
- package/build-module/video/index.js.map +1 -1
- package/build-module/video/transforms.js +1 -1
- package/build-module/video/transforms.js.map +1 -1
- package/build-style/categories/editor-rtl.css +4 -0
- package/build-style/categories/editor.css +4 -0
- package/build-style/categories/style-rtl.css +4 -0
- package/build-style/categories/style.css +4 -0
- package/build-style/editor-rtl.css +16 -12
- package/build-style/editor.css +16 -12
- package/build-style/image/editor-rtl.css +8 -4
- package/build-style/image/editor.css +8 -4
- package/build-style/image/style-rtl.css +19 -0
- package/build-style/image/style.css +19 -0
- package/build-style/list/style-rtl.css +1 -1
- package/build-style/list/style.css +1 -1
- package/build-style/navigation/style-rtl.css +1 -4
- package/build-style/navigation/style.css +1 -4
- package/build-style/post-comments-form/style-rtl.css +12 -11
- package/build-style/post-comments-form/style.css +12 -11
- package/build-style/query/editor-rtl.css +3 -7
- package/build-style/query/editor.css +3 -7
- package/build-style/search/editor-rtl.css +1 -1
- package/build-style/search/editor.css +1 -1
- package/build-style/social-links/style-rtl.css +93 -93
- package/build-style/social-links/style.css +93 -93
- package/build-style/style-rtl.css +131 -109
- package/build-style/style.css +131 -109
- package/build-style/term-description/style-rtl.css +1 -0
- package/build-style/term-description/style.css +1 -0
- package/package.json +35 -35
- package/src/audio/block.json +4 -0
- package/src/audio/edit.js +19 -7
- package/src/audio/transforms.js +1 -1
- package/src/block/block.json +5 -1
- package/src/block/edit.js +58 -28
- package/src/block/test/edit.native.js +6 -2
- package/src/button/edit.js +1 -1
- package/src/button/index.php +14 -1
- package/src/buttons/block.json +20 -0
- package/src/buttons/index.js +6 -0
- package/src/categories/block.json +8 -0
- package/src/categories/edit.js +32 -4
- package/src/categories/editor.scss +4 -0
- package/src/categories/index.php +4 -1
- package/src/categories/style.scss +4 -0
- package/src/columns/index.js +1 -1
- package/src/cover/edit/inspector-controls.js +1 -0
- package/src/embed/embed-preview.js +4 -6
- package/src/embed/test/__snapshots__/index.native.js.snap +8 -8
- package/src/embed/test/index.js +1 -1
- package/src/embed/test/index.native.js +24 -23
- package/src/embed/variations.js +43 -35
- package/src/file/block.json +4 -0
- package/src/file/edit.js +19 -6
- package/src/file/transforms.js +1 -2
- package/src/footnotes/index.js +1 -2
- package/src/form-input/edit.js +2 -0
- package/src/gallery/block.json +10 -0
- package/src/gallery/deprecated.js +6 -55
- package/src/gallery/edit.js +13 -10
- package/src/gallery/gallery-styles.native.scss +0 -2
- package/src/gallery/index.js +1 -1
- package/src/gallery/save.js +0 -10
- package/src/gallery/shared.js +0 -28
- package/src/gallery/transforms.js +56 -99
- package/src/group/block.json +1 -0
- package/src/group/deprecated.js +3 -7
- package/src/group/placeholder.js +7 -0
- package/src/heading/block.json +12 -0
- package/src/heading/index.js +1 -0
- package/src/image/block.json +7 -0
- package/src/image/edit.js +11 -20
- package/src/image/editor.scss +6 -1
- package/src/image/image.js +91 -49
- package/src/image/index.php +58 -20
- package/src/image/style.scss +22 -0
- package/src/image/test/edit.native.js +1 -0
- package/src/image/transforms.js +1 -1
- package/src/image/view.js +69 -49
- package/src/latest-comments/block.json +9 -0
- package/src/list/edit.js +3 -3
- package/src/list/style.scss +1 -1
- package/src/list-item/block.json +11 -1
- package/src/list-item/edit.js +3 -3
- package/src/list-item/hooks/index.js +0 -1
- package/src/list-item/hooks/use-merge.js +19 -5
- package/src/loginout/block.json +3 -0
- package/src/media-text/block.json +12 -0
- package/src/media-text/edit.js +3 -2
- package/src/navigation/edit/navigation-menu-delete-control.js +1 -0
- package/src/navigation/index.php +1 -1
- package/src/navigation/style.scss +4 -9
- package/src/navigation/test/use-navigation-menu.js +54 -15
- package/src/navigation/use-navigation-menu.js +5 -1
- package/src/navigation-link/link-ui.js +8 -14
- package/src/navigation-submenu/edit.js +2 -14
- package/src/page-list/convert-to-links-modal.js +1 -1
- package/src/page-list/edit.js +2 -1
- package/src/page-list-item/edit.js +4 -4
- package/src/paragraph/block.json +6 -0
- package/src/post-author/index.js +8 -0
- package/src/post-author-biography/block.json +3 -0
- package/src/post-author-name/block.json +3 -0
- package/src/post-comments-form/style.scss +16 -13
- package/src/post-content/block.json +3 -0
- package/src/post-date/block.json +3 -0
- package/src/post-date/edit.js +5 -1
- package/src/post-date/index.php +8 -2
- package/src/post-excerpt/block.json +3 -0
- package/src/post-excerpt/edit.js +1 -0
- package/src/post-featured-image/block.json +3 -0
- package/src/post-terms/block.json +3 -0
- package/src/post-title/block.json +3 -0
- package/src/post-title/edit.js +5 -5
- package/src/query/edit/inspector-controls/author-control.js +2 -0
- package/src/query/edit/inspector-controls/index.js +44 -16
- package/src/query/edit/inspector-controls/order-control.js +1 -0
- package/src/query/edit/inspector-controls/parent-control.js +1 -0
- package/src/query/edit/inspector-controls/sticky-control.js +1 -0
- package/src/query/edit/inspector-controls/taxonomy-controls.js +8 -3
- package/src/query/edit/query-content.js +17 -3
- package/src/query/edit/query-placeholder.js +1 -21
- package/src/query/edit/query-toolbar.js +60 -72
- package/src/query/editor.scss +4 -9
- package/src/query/index.js +40 -0
- package/src/query/utils.js +4 -0
- package/src/query/variations.js +4 -46
- package/src/query-pagination-numbers/edit.js +1 -0
- package/src/query-title/edit.js +10 -17
- package/src/query-title/use-archive-label.js +99 -0
- package/src/quote/block.json +15 -1
- package/src/search/block.json +3 -0
- package/src/search/editor.scss +1 -1
- package/src/site-logo/edit.js +4 -1
- package/src/site-tagline/block.json +6 -1
- package/src/site-tagline/edit.js +5 -2
- package/src/site-title/edit.js +4 -1
- package/src/site-title/index.js +6 -1
- package/src/social-link/edit.js +29 -3
- package/src/social-link/icons/soundcloud.js +1 -1
- package/src/social-link/socials-with-bg.scss +1 -1
- package/src/social-link/socials-without-bg.scss +1 -1
- package/src/social-links/block.json +12 -0
- package/src/social-links/style.scss +2 -2
- package/src/table/edit.js +11 -24
- package/src/tag-cloud/edit.js +7 -1
- package/src/template-part/edit/index.js +5 -3
- package/src/template-part/edit/inner-blocks.js +8 -5
- package/src/template-part/edit/placeholder.js +31 -6
- package/src/template-part/edit/title-modal.js +19 -5
- package/src/term-description/block.json +12 -0
- package/src/term-description/style.scss +2 -0
- package/src/utils/hooks.js +19 -2
- package/src/video/block.json +4 -0
- package/src/video/edit.js +23 -8
- package/src/video/transforms.js +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/build/gallery/edit-wrapper.js +0 -37
- package/build/gallery/edit-wrapper.js.map +0 -1
- package/build/gallery/v1/constants.js +0 -10
- package/build/gallery/v1/constants.js.map +0 -1
- package/build/gallery/v1/edit.js +0 -399
- package/build/gallery/v1/edit.js.map +0 -1
- package/build/gallery/v1/gallery-button.native.js +0 -55
- package/build/gallery/v1/gallery-button.native.js.map +0 -1
- package/build/gallery/v1/gallery-image.js +0 -285
- package/build/gallery/v1/gallery-image.js.map +0 -1
- package/build/gallery/v1/gallery-image.native.js +0 -297
- package/build/gallery/v1/gallery-image.native.js.map +0 -1
- package/build/gallery/v1/gallery.js +0 -112
- package/build/gallery/v1/gallery.js.map +0 -1
- package/build/gallery/v1/gallery.native.js +0 -139
- package/build/gallery/v1/gallery.native.js.map +0 -1
- package/build/gallery/v1/save.js +0 -81
- package/build/gallery/v1/save.js.map +0 -1
- package/build/gallery/v1/shared.js +0 -17
- package/build/gallery/v1/shared.js.map +0 -1
- package/build/gallery/v1/tiles.native.js +0 -83
- package/build/gallery/v1/tiles.native.js.map +0 -1
- package/build/list-item/hooks/use-split.js +0 -39
- package/build/list-item/hooks/use-split.js.map +0 -1
- package/build/utils/constants.js +0 -15
- package/build/utils/constants.js.map +0 -1
- package/build-module/gallery/edit-wrapper.js +0 -31
- package/build-module/gallery/edit-wrapper.js.map +0 -1
- package/build-module/gallery/v1/constants.js +0 -4
- package/build-module/gallery/v1/constants.js.map +0 -1
- package/build-module/gallery/v1/edit.js +0 -393
- package/build-module/gallery/v1/edit.js.map +0 -1
- package/build-module/gallery/v1/gallery-button.native.js +0 -46
- package/build-module/gallery/v1/gallery-button.native.js.map +0 -1
- package/build-module/gallery/v1/gallery-image.js +0 -279
- package/build-module/gallery/v1/gallery-image.js.map +0 -1
- package/build-module/gallery/v1/gallery-image.native.js +0 -291
- package/build-module/gallery/v1/gallery-image.native.js.map +0 -1
- package/build-module/gallery/v1/gallery.js +0 -104
- package/build-module/gallery/v1/gallery.js.map +0 -1
- package/build-module/gallery/v1/gallery.native.js +0 -131
- package/build-module/gallery/v1/gallery.native.js.map +0 -1
- package/build-module/gallery/v1/save.js +0 -74
- package/build-module/gallery/v1/save.js.map +0 -1
- package/build-module/gallery/v1/shared.js +0 -10
- package/build-module/gallery/v1/shared.js.map +0 -1
- package/build-module/gallery/v1/tiles.native.js +0 -75
- package/build-module/gallery/v1/tiles.native.js.map +0 -1
- package/build-module/list-item/hooks/use-split.js +0 -32
- package/build-module/list-item/hooks/use-split.js.map +0 -1
- package/build-module/utils/constants.js +0 -9
- package/build-module/utils/constants.js.map +0 -1
- package/src/gallery/edit-wrapper.js +0 -27
- package/src/gallery/v1/constants.js +0 -3
- package/src/gallery/v1/edit.js +0 -450
- package/src/gallery/v1/gallery-button.native.js +0 -47
- package/src/gallery/v1/gallery-image-style.native.scss +0 -109
- package/src/gallery/v1/gallery-image.js +0 -293
- package/src/gallery/v1/gallery-image.native.js +0 -348
- package/src/gallery/v1/gallery-styles.native.scss +0 -8
- package/src/gallery/v1/gallery.js +0 -125
- package/src/gallery/v1/gallery.native.js +0 -162
- package/src/gallery/v1/save.js +0 -98
- package/src/gallery/v1/shared.js +0 -19
- package/src/gallery/v1/tiles-styles.native.scss +0 -11
- package/src/gallery/v1/tiles.native.js +0 -79
- package/src/list-item/hooks/use-split.js +0 -33
- package/src/utils/constants.js +0 -8
|
@@ -19,7 +19,7 @@ var _enhancedPaginationControl = _interopRequireDefault(require("./enhanced-pagi
|
|
|
19
19
|
var _createNewPostLink = _interopRequireDefault(require("./create-new-post-link"));
|
|
20
20
|
var _lockUnlock = require("../../../lock-unlock");
|
|
21
21
|
var _utils = require("../../utils");
|
|
22
|
-
var
|
|
22
|
+
var _hooks = require("../../../utils/hooks");
|
|
23
23
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
24
24
|
/**
|
|
25
25
|
* WordPress dependencies
|
|
@@ -101,6 +101,8 @@ function QueryInspectorControls(props) {
|
|
|
101
101
|
}, [querySearch, onChangeDebounced]);
|
|
102
102
|
const showInheritControl = (0, _utils.isControlAllowed)(allowedControls, 'inherit');
|
|
103
103
|
const showPostTypeControl = !inherit && (0, _utils.isControlAllowed)(allowedControls, 'postType');
|
|
104
|
+
const postTypeControlLabel = (0, _i18n.__)('Content type');
|
|
105
|
+
const postTypeControlHelp = (0, _i18n.__)('WordPress contains different types of content you can filter by. Posts and pages are the default types, but plugins could add more.');
|
|
104
106
|
const showColumnsControl = false;
|
|
105
107
|
const showOrderControl = !inherit && (0, _utils.isControlAllowed)(allowedControls, 'order');
|
|
106
108
|
const showStickyControl = !inherit && showSticky && (0, _utils.isControlAllowed)(allowedControls, 'sticky');
|
|
@@ -110,6 +112,7 @@ function QueryInspectorControls(props) {
|
|
|
110
112
|
const showSearchControl = (0, _utils.isControlAllowed)(allowedControls, 'search');
|
|
111
113
|
const showParentControl = (0, _utils.isControlAllowed)(allowedControls, 'parents') && isPostTypeHierarchical;
|
|
112
114
|
const showFiltersPanel = showTaxControl || showAuthorControl || showSearchControl || showParentControl;
|
|
115
|
+
const dropdownMenuProps = (0, _hooks.useToolsPanelDropdownMenuProps)();
|
|
113
116
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
114
117
|
children: [!!postType && /*#__PURE__*/(0, _jsxRuntime.jsx)(BlockInfo, {
|
|
115
118
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_createNewPostLink.default, {
|
|
@@ -120,21 +123,35 @@ function QueryInspectorControls(props) {
|
|
|
120
123
|
children: [showInheritControl && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToggleControl, {
|
|
121
124
|
__nextHasNoMarginBottom: true,
|
|
122
125
|
label: (0, _i18n.__)('Inherit query from template'),
|
|
123
|
-
help: (0, _i18n.__)('
|
|
126
|
+
help: (0, _i18n.__)('Enable 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.'),
|
|
124
127
|
checked: !!inherit,
|
|
125
128
|
onChange: value => setQuery({
|
|
126
129
|
inherit: !!value
|
|
127
130
|
})
|
|
128
|
-
}), showPostTypeControl && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.SelectControl, {
|
|
131
|
+
}), showPostTypeControl && (postTypesSelectOptions.length > 2 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.SelectControl, {
|
|
129
132
|
__nextHasNoMarginBottom: true,
|
|
133
|
+
__next40pxDefaultSize: true,
|
|
130
134
|
options: postTypesSelectOptions,
|
|
131
135
|
value: postType,
|
|
132
|
-
label:
|
|
136
|
+
label: postTypeControlLabel,
|
|
133
137
|
onChange: onPostTypeChange,
|
|
134
|
-
help:
|
|
135
|
-
})
|
|
138
|
+
help: postTypeControlHelp
|
|
139
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToggleGroupControl, {
|
|
140
|
+
__nextHasNoMarginBottom: true,
|
|
141
|
+
__next40pxDefaultSize: true,
|
|
142
|
+
isBlock: true,
|
|
143
|
+
value: postType,
|
|
144
|
+
label: postTypeControlLabel,
|
|
145
|
+
onChange: onPostTypeChange,
|
|
146
|
+
help: postTypeControlHelp,
|
|
147
|
+
children: postTypesSelectOptions.map(option => /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToggleGroupControlOption, {
|
|
148
|
+
value: option.value,
|
|
149
|
+
label: option.label
|
|
150
|
+
}, option.value))
|
|
151
|
+
})), showColumnsControl && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
136
152
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.RangeControl, {
|
|
137
153
|
__nextHasNoMarginBottom: true,
|
|
154
|
+
__next40pxDefaultSize: true,
|
|
138
155
|
label: (0, _i18n.__)('Columns'),
|
|
139
156
|
value: displayLayout.columns,
|
|
140
157
|
onChange: value => setDisplayLayout({
|
|
@@ -162,7 +179,8 @@ function QueryInspectorControls(props) {
|
|
|
162
179
|
clientId: clientId
|
|
163
180
|
})]
|
|
164
181
|
}), !inherit && showFiltersPanel && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalToolsPanel, {
|
|
165
|
-
className: "block-library-query-toolspanel__filters"
|
|
182
|
+
className: "block-library-query-toolspanel__filters" // unused but kept for backward compatibility
|
|
183
|
+
,
|
|
166
184
|
label: (0, _i18n.__)('Filters'),
|
|
167
185
|
resetAll: () => {
|
|
168
186
|
setQuery({
|
|
@@ -173,7 +191,7 @@ function QueryInspectorControls(props) {
|
|
|
173
191
|
});
|
|
174
192
|
setQuerySearch('');
|
|
175
193
|
},
|
|
176
|
-
dropdownMenuProps:
|
|
194
|
+
dropdownMenuProps: dropdownMenuProps,
|
|
177
195
|
children: [showTaxControl && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
|
|
178
196
|
label: (0, _i18n.__)('Taxonomies'),
|
|
179
197
|
hasValue: () => Object.values(taxQuery || {}).some(terms => !!terms.length),
|
|
@@ -200,6 +218,7 @@ function QueryInspectorControls(props) {
|
|
|
200
218
|
onDeselect: () => setQuerySearch(''),
|
|
201
219
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.TextControl, {
|
|
202
220
|
__nextHasNoMarginBottom: true,
|
|
221
|
+
__next40pxDefaultSize: true,
|
|
203
222
|
label: (0, _i18n.__)('Keyword'),
|
|
204
223
|
value: querySearch,
|
|
205
224
|
onChange: setQuerySearch
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_i18n","_blockEditor","_compose","_element","_orderControl","_interopRequireDefault","_authorControl","_parentControl","_taxonomyControls","_stickyControl","_enhancedPaginationControl","_createNewPostLink","_lockUnlock","_utils","_constants","_jsxRuntime","BlockInfo","unlock","blockEditorPrivateApis","QueryInspectorControls","props","attributes","setQuery","setDisplayLayout","setAttributes","clientId","query","displayLayout","enhancedPagination","order","orderBy","author","authorIds","postType","sticky","inherit","taxQuery","parents","allowedControls","useAllowedControls","showSticky","setShowSticky","useState","postTypesTaxonomiesMap","postTypesSelectOptions","usePostTypes","taxonomies","useTaxonomies","isPostTypeHierarchical","useIsPostTypeHierarchical","useEffect","onPostTypeChange","newValue","updateQuery","supportedTaxonomies","updatedTaxQuery","Object","entries","reduce","accumulator","taxonomySlug","terms","includes","keys","length","undefined","querySearch","setQuerySearch","search","onChangeDebounced","useCallback","debounce","cancel","showInheritControl","isControlAllowed","showPostTypeControl","showColumnsControl","showOrderControl","showStickyControl","showSettingsPanel","showTaxControl","showAuthorControl","showSearchControl","showParentControl","showFiltersPanel","jsxs","Fragment","children","jsx","default","PanelBody","title","__","ToggleControl","__nextHasNoMarginBottom","label","help","checked","onChange","value","SelectControl","options","RangeControl","columns","min","max","Math","Notice","status","isDismissible","__experimentalToolsPanel","className","resetAll","dropdownMenuProps","TOOLSPANEL_DROPDOWNMENU_PROPS","__experimentalToolsPanelItem","hasValue","values","some","onDeselect","TaxonomyControls","TextControl"],"sources":["@wordpress/block-library/src/query/edit/inspector-controls/index.js"],"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 { privateApis as blockEditorPrivateApis } 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 EnhancedPaginationControl from './enhanced-pagination-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';\nimport { TOOLSPANEL_DROPDOWNMENU_PROPS } from '../../../utils/constants';\n\nconst { BlockInfo } = unlock( blockEditorPrivateApis );\n\nexport default function QueryInspectorControls( props ) {\n\tconst { attributes, setQuery, setDisplayLayout, setAttributes, clientId } =\n\t\tprops;\n\tconst { query, displayLayout, enhancedPagination } = 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{ !! postType && (\n\t\t\t\t<BlockInfo>\n\t\t\t\t\t<CreateNewPostLink postType={ postType } />\n\t\t\t\t</BlockInfo>\n\t\t\t) }\n\t\t\t{ showSettingsPanel && (\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t{ showInheritControl && (\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Inherit query from template' ) }\n\t\t\t\t\t\t\thelp={ __(\n\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) }\n\t\t\t\t\t\t\tchecked={ !! inherit }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetQuery( { inherit: !! value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ showPostTypeControl && (\n\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\toptions={ postTypesSelectOptions }\n\t\t\t\t\t\t\tvalue={ postType }\n\t\t\t\t\t\t\tlabel={ __( 'Post type' ) }\n\t\t\t\t\t\t\tonChange={ onPostTypeChange }\n\t\t\t\t\t\t\thelp={ __(\n\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) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ showColumnsControl && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Columns' ) }\n\t\t\t\t\t\t\t\tvalue={ displayLayout.columns }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tsetDisplayLayout( {\n\t\t\t\t\t\t\t\t\t\tcolumns: value,\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\tmin={ 2 }\n\t\t\t\t\t\t\t\tmax={ Math.max( 6, displayLayout.columns ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ displayLayout.columns > 6 && (\n\t\t\t\t\t\t\t\t<Notice\n\t\t\t\t\t\t\t\t\tstatus=\"warning\"\n\t\t\t\t\t\t\t\t\tisDismissible={ false }\n\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\t\t'This column count exceeds the recommended amount and may cause visual breakage.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</Notice>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t\t{ showOrderControl && (\n\t\t\t\t\t\t<OrderControl\n\t\t\t\t\t\t\t{ ...{ order, orderBy } }\n\t\t\t\t\t\t\tonChange={ setQuery }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ showStickyControl && (\n\t\t\t\t\t\t<StickyControl\n\t\t\t\t\t\t\tvalue={ sticky }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetQuery( { sticky: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t<EnhancedPaginationControl\n\t\t\t\t\t\tenhancedPagination={ enhancedPagination }\n\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t) }\n\t\t\t{ ! inherit && showFiltersPanel && (\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tclassName=\"block-library-query-toolspanel__filters\"\n\t\t\t\t\tlabel={ __( 'Filters' ) }\n\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\tsetQuery( {\n\t\t\t\t\t\t\tauthor: '',\n\t\t\t\t\t\t\tparents: [],\n\t\t\t\t\t\t\tsearch: '',\n\t\t\t\t\t\t\ttaxQuery: null,\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tsetQuerySearch( '' );\n\t\t\t\t\t} }\n\t\t\t\t\tdropdownMenuProps={ TOOLSPANEL_DROPDOWNMENU_PROPS }\n\t\t\t\t>\n\t\t\t\t\t{ showTaxControl && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\tlabel={ __( 'Taxonomies' ) }\n\t\t\t\t\t\t\thasValue={ () =>\n\t\t\t\t\t\t\t\tObject.values( taxQuery || {} ).some(\n\t\t\t\t\t\t\t\t\t( terms ) => !! terms.length\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonDeselect={ () => setQuery( { taxQuery: null } ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<TaxonomyControls\n\t\t\t\t\t\t\t\tonChange={ setQuery }\n\t\t\t\t\t\t\t\tquery={ query }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t\t{ showAuthorControl && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () => !! authorIds }\n\t\t\t\t\t\t\tlabel={ __( 'Authors' ) }\n\t\t\t\t\t\t\tonDeselect={ () => setQuery( { author: '' } ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<AuthorControl\n\t\t\t\t\t\t\t\tvalue={ authorIds }\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</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t\t{ showSearchControl && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () => !! querySearch }\n\t\t\t\t\t\t\tlabel={ __( 'Keyword' ) }\n\t\t\t\t\t\t\tonDeselect={ () => setQuerySearch( '' ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Keyword' ) }\n\t\t\t\t\t\t\t\tvalue={ querySearch }\n\t\t\t\t\t\t\t\tonChange={ setQuerySearch }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t\t{ showParentControl && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () => !! parents?.length }\n\t\t\t\t\t\t\tlabel={ __( 'Parents' ) }\n\t\t\t\t\t\t\tonDeselect={ () => setQuery( { parents: [] } ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ParentControl\n\t\t\t\t\t\t\t\tparents={ parents }\n\t\t\t\t\t\t\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UACbpD,OAAO,EAAGA,OAAS;UACnBJ,QAAQ,EAAGA,QAAU;UACrBiE,QAAQ,EAAG5E;QAAU,CACrB;MAAC,CACa,CAChB;IAAA,CACU,CACZ;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_components","require","_i18n","_blockEditor","_compose","_element","_orderControl","_interopRequireDefault","_authorControl","_parentControl","_taxonomyControls","_stickyControl","_enhancedPaginationControl","_createNewPostLink","_lockUnlock","_utils","_hooks","_jsxRuntime","BlockInfo","unlock","blockEditorPrivateApis","QueryInspectorControls","props","attributes","setQuery","setDisplayLayout","setAttributes","clientId","query","displayLayout","enhancedPagination","order","orderBy","author","authorIds","postType","sticky","inherit","taxQuery","parents","allowedControls","useAllowedControls","showSticky","setShowSticky","useState","postTypesTaxonomiesMap","postTypesSelectOptions","usePostTypes","taxonomies","useTaxonomies","isPostTypeHierarchical","useIsPostTypeHierarchical","useEffect","onPostTypeChange","newValue","updateQuery","supportedTaxonomies","updatedTaxQuery","Object","entries","reduce","accumulator","taxonomySlug","terms","includes","keys","length","undefined","querySearch","setQuerySearch","search","onChangeDebounced","useCallback","debounce","cancel","showInheritControl","isControlAllowed","showPostTypeControl","postTypeControlLabel","__","postTypeControlHelp","showColumnsControl","showOrderControl","showStickyControl","showSettingsPanel","showTaxControl","showAuthorControl","showSearchControl","showParentControl","showFiltersPanel","dropdownMenuProps","useToolsPanelDropdownMenuProps","jsxs","Fragment","children","jsx","default","PanelBody","title","ToggleControl","__nextHasNoMarginBottom","label","help","checked","onChange","value","SelectControl","__next40pxDefaultSize","options","__experimentalToggleGroupControl","isBlock","map","option","__experimentalToggleGroupControlOption","RangeControl","columns","min","max","Math","Notice","status","isDismissible","__experimentalToolsPanel","className","resetAll","__experimentalToolsPanelItem","hasValue","values","some","onDeselect","TaxonomyControls","TextControl"],"sources":["@wordpress/block-library/src/query/edit/inspector-controls/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tPanelBody,\n\tTextControl,\n\tSelectControl,\n\tRangeControl,\n\tToggleControl,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\tNotice,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as blockEditorPrivateApis } 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 EnhancedPaginationControl from './enhanced-pagination-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';\nimport { useToolsPanelDropdownMenuProps } from '../../../utils/hooks';\n\nconst { BlockInfo } = unlock( blockEditorPrivateApis );\n\nexport default function QueryInspectorControls( props ) {\n\tconst { attributes, setQuery, setDisplayLayout, setAttributes, clientId } =\n\t\tprops;\n\tconst { query, displayLayout, enhancedPagination } = 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 postTypeControlLabel = __( 'Content type' );\n\tconst postTypeControlHelp = __(\n\t\t'WordPress contains different types of content you can filter by. Posts and pages are the default types, but plugins could add more.'\n\t);\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\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\treturn (\n\t\t<>\n\t\t\t{ !! postType && (\n\t\t\t\t<BlockInfo>\n\t\t\t\t\t<CreateNewPostLink postType={ postType } />\n\t\t\t\t</BlockInfo>\n\t\t\t) }\n\t\t\t{ showSettingsPanel && (\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t{ showInheritControl && (\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Inherit query from template' ) }\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Enable 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) }\n\t\t\t\t\t\t\tchecked={ !! inherit }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetQuery( { inherit: !! value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ showPostTypeControl &&\n\t\t\t\t\t\t( postTypesSelectOptions.length > 2 ? (\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\t__next40pxDefaultSize\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={ postTypeControlLabel }\n\t\t\t\t\t\t\t\tonChange={ onPostTypeChange }\n\t\t\t\t\t\t\t\thelp={ postTypeControlHelp }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<ToggleGroupControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tisBlock\n\t\t\t\t\t\t\t\tvalue={ postType }\n\t\t\t\t\t\t\t\tlabel={ postTypeControlLabel }\n\t\t\t\t\t\t\t\tonChange={ onPostTypeChange }\n\t\t\t\t\t\t\t\thelp={ postTypeControlHelp }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ postTypesSelectOptions.map( ( option ) => (\n\t\t\t\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\t\t\t\tkey={ option.value }\n\t\t\t\t\t\t\t\t\t\tvalue={ option.value }\n\t\t\t\t\t\t\t\t\t\tlabel={ option.label }\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</ToggleGroupControl>\n\t\t\t\t\t\t) ) }\n\n\t\t\t\t\t{ showColumnsControl && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tlabel={ __( 'Columns' ) }\n\t\t\t\t\t\t\t\tvalue={ displayLayout.columns }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tsetDisplayLayout( {\n\t\t\t\t\t\t\t\t\t\tcolumns: value,\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\tmin={ 2 }\n\t\t\t\t\t\t\t\tmax={ Math.max( 6, displayLayout.columns ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ displayLayout.columns > 6 && (\n\t\t\t\t\t\t\t\t<Notice\n\t\t\t\t\t\t\t\t\tstatus=\"warning\"\n\t\t\t\t\t\t\t\t\tisDismissible={ false }\n\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\t\t'This column count exceeds the recommended amount and may cause visual breakage.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</Notice>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t\t{ showOrderControl && (\n\t\t\t\t\t\t<OrderControl\n\t\t\t\t\t\t\t{ ...{ order, orderBy } }\n\t\t\t\t\t\t\tonChange={ setQuery }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ showStickyControl && (\n\t\t\t\t\t\t<StickyControl\n\t\t\t\t\t\t\tvalue={ sticky }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetQuery( { sticky: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t<EnhancedPaginationControl\n\t\t\t\t\t\tenhancedPagination={ enhancedPagination }\n\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t) }\n\t\t\t{ ! inherit && showFiltersPanel && (\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tclassName=\"block-library-query-toolspanel__filters\" // unused but kept for backward compatibility\n\t\t\t\t\tlabel={ __( 'Filters' ) }\n\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\tsetQuery( {\n\t\t\t\t\t\t\tauthor: '',\n\t\t\t\t\t\t\tparents: [],\n\t\t\t\t\t\t\tsearch: '',\n\t\t\t\t\t\t\ttaxQuery: null,\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tsetQuerySearch( '' );\n\t\t\t\t\t} }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t{ showTaxControl && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\tlabel={ __( 'Taxonomies' ) }\n\t\t\t\t\t\t\thasValue={ () =>\n\t\t\t\t\t\t\t\tObject.values( taxQuery || {} ).some(\n\t\t\t\t\t\t\t\t\t( terms ) => !! terms.length\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonDeselect={ () => setQuery( { taxQuery: null } ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<TaxonomyControls\n\t\t\t\t\t\t\t\tonChange={ setQuery }\n\t\t\t\t\t\t\t\tquery={ query }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t\t{ showAuthorControl && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () => !! authorIds }\n\t\t\t\t\t\t\tlabel={ __( 'Authors' ) }\n\t\t\t\t\t\t\tonDeselect={ () => setQuery( { author: '' } ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<AuthorControl\n\t\t\t\t\t\t\t\tvalue={ authorIds }\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</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t\t{ showSearchControl && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () => !! querySearch }\n\t\t\t\t\t\t\tlabel={ __( 'Keyword' ) }\n\t\t\t\t\t\t\tonDeselect={ () => setQuerySearch( '' ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tlabel={ __( 'Keyword' ) }\n\t\t\t\t\t\t\t\tvalue={ querySearch }\n\t\t\t\t\t\t\t\tonChange={ setQuerySearch }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t\t{ showParentControl && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () => !! parents?.length }\n\t\t\t\t\t\t\tlabel={ __( 'Parents' ) }\n\t\t\t\t\t\t\tonDeselect={ () => setQuery( { parents: [] } ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ParentControl\n\t\t\t\t\t\t\t\tparents={ parents }\n\t\t\t\t\t\t\t\tpostType={ postType }\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</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t</ToolsPanel>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAYA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAKA,IAAAK,aAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,cAAA,GAAAD,sBAAA,CAAAN,OAAA;AACA,IAAAQ,cAAA,GAAAF,sBAAA,CAAAN,OAAA;AACA,IAAAS,iBAAA,GAAAT,OAAA;AACA,IAAAU,cAAA,GAAAJ,sBAAA,CAAAN,OAAA;AACA,IAAAW,0BAAA,GAAAL,sBAAA,CAAAN,OAAA;AACA,IAAAY,kBAAA,GAAAN,sBAAA,CAAAN,OAAA;AACA,IAAAa,WAAA,GAAAb,OAAA;AACA,IAAAc,MAAA,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E,GAAA,EAACtF,cAAA,CAAAuF,OAAa;UACbzD,OAAO,EAAGA,OAAS;UACnBJ,QAAQ,EAAGA,QAAU;UACrBqE,QAAQ,EAAGhF;QAAU,CACrB;MAAC,CACa,CAChB;IAAA,CACU,CACZ;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
|
|
@@ -33,6 +33,7 @@ function OrderControl({
|
|
|
33
33
|
}) {
|
|
34
34
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.SelectControl, {
|
|
35
35
|
__nextHasNoMarginBottom: true,
|
|
36
|
+
__next40pxDefaultSize: true,
|
|
36
37
|
label: (0, _i18n.__)('Order by'),
|
|
37
38
|
value: `${orderBy}/${order}`,
|
|
38
39
|
options: orderOptions,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_i18n","_jsxRuntime","orderOptions","label","__","value","OrderControl","order","orderBy","onChange","jsx","SelectControl","__nextHasNoMarginBottom","options","newOrderBy","newOrder","split","_default","exports","default"],"sources":["@wordpress/block-library/src/query/edit/inspector-controls/order-control.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SelectControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nconst orderOptions = [\n\t{\n\t\tlabel: __( 'Newest to oldest' ),\n\t\tvalue: 'date/desc',\n\t},\n\t{\n\t\tlabel: __( 'Oldest to newest' ),\n\t\tvalue: 'date/asc',\n\t},\n\t{\n\t\t/* translators: label for ordering posts by title in ascending order */\n\t\tlabel: __( 'A → Z' ),\n\t\tvalue: 'title/asc',\n\t},\n\t{\n\t\t/* translators: label for ordering posts by title in descending order */\n\t\tlabel: __( 'Z → A' ),\n\t\tvalue: 'title/desc',\n\t},\n];\nfunction OrderControl( { order, orderBy, onChange } ) {\n\treturn (\n\t\t<SelectControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\tlabel={ __( 'Order by' ) }\n\t\t\tvalue={ `${ orderBy }/${ order }` }\n\t\t\toptions={ orderOptions }\n\t\t\tonChange={ ( value ) => {\n\t\t\t\tconst [ newOrderBy, newOrder ] = value.split( '/' );\n\t\t\t\tonChange( { order: newOrder, orderBy: newOrderBy } );\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nexport default OrderControl;\n"],"mappings":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAAqC,IAAAE,WAAA,GAAAF,OAAA;AAJrC;AACA;AACA;;AAIA,MAAMG,YAAY,GAAG,CACpB;EACCC,KAAK,EAAE,IAAAC,QAAE,EAAE,kBAAmB,CAAC;EAC/BC,KAAK,EAAE;AACR,CAAC,EACD;EACCF,KAAK,EAAE,IAAAC,QAAE,EAAE,kBAAmB,CAAC;EAC/BC,KAAK,EAAE;AACR,CAAC,EACD;EACC;EACAF,KAAK,EAAE,IAAAC,QAAE,EAAE,OAAQ,CAAC;EACpBC,KAAK,EAAE;AACR,CAAC,EACD;EACC;EACAF,KAAK,EAAE,IAAAC,QAAE,EAAE,OAAQ,CAAC;EACpBC,KAAK,EAAE;AACR,CAAC,CACD;AACD,SAASC,YAAYA,CAAE;EAAEC,KAAK;EAAEC,OAAO;EAAEC;AAAS,CAAC,EAAG;EACrD,oBACC,IAAAR,WAAA,CAAAS,GAAA,EAACZ,WAAA,CAAAa,aAAa;IACbC,uBAAuB;
|
|
1
|
+
{"version":3,"names":["_components","require","_i18n","_jsxRuntime","orderOptions","label","__","value","OrderControl","order","orderBy","onChange","jsx","SelectControl","__nextHasNoMarginBottom","__next40pxDefaultSize","options","newOrderBy","newOrder","split","_default","exports","default"],"sources":["@wordpress/block-library/src/query/edit/inspector-controls/order-control.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SelectControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nconst orderOptions = [\n\t{\n\t\tlabel: __( 'Newest to oldest' ),\n\t\tvalue: 'date/desc',\n\t},\n\t{\n\t\tlabel: __( 'Oldest to newest' ),\n\t\tvalue: 'date/asc',\n\t},\n\t{\n\t\t/* translators: label for ordering posts by title in ascending order */\n\t\tlabel: __( 'A → Z' ),\n\t\tvalue: 'title/asc',\n\t},\n\t{\n\t\t/* translators: label for ordering posts by title in descending order */\n\t\tlabel: __( 'Z → A' ),\n\t\tvalue: 'title/desc',\n\t},\n];\nfunction OrderControl( { order, orderBy, onChange } ) {\n\treturn (\n\t\t<SelectControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\t__next40pxDefaultSize\n\t\t\tlabel={ __( 'Order by' ) }\n\t\t\tvalue={ `${ orderBy }/${ order }` }\n\t\t\toptions={ orderOptions }\n\t\t\tonChange={ ( value ) => {\n\t\t\t\tconst [ newOrderBy, newOrder ] = value.split( '/' );\n\t\t\t\tonChange( { order: newOrder, orderBy: newOrderBy } );\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nexport default OrderControl;\n"],"mappings":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAAqC,IAAAE,WAAA,GAAAF,OAAA;AAJrC;AACA;AACA;;AAIA,MAAMG,YAAY,GAAG,CACpB;EACCC,KAAK,EAAE,IAAAC,QAAE,EAAE,kBAAmB,CAAC;EAC/BC,KAAK,EAAE;AACR,CAAC,EACD;EACCF,KAAK,EAAE,IAAAC,QAAE,EAAE,kBAAmB,CAAC;EAC/BC,KAAK,EAAE;AACR,CAAC,EACD;EACC;EACAF,KAAK,EAAE,IAAAC,QAAE,EAAE,OAAQ,CAAC;EACpBC,KAAK,EAAE;AACR,CAAC,EACD;EACC;EACAF,KAAK,EAAE,IAAAC,QAAE,EAAE,OAAQ,CAAC;EACpBC,KAAK,EAAE;AACR,CAAC,CACD;AACD,SAASC,YAAYA,CAAE;EAAEC,KAAK;EAAEC,OAAO;EAAEC;AAAS,CAAC,EAAG;EACrD,oBACC,IAAAR,WAAA,CAAAS,GAAA,EAACZ,WAAA,CAAAa,aAAa;IACbC,uBAAuB;IACvBC,qBAAqB;IACrBV,KAAK,EAAG,IAAAC,QAAE,EAAE,UAAW,CAAG;IAC1BC,KAAK,EAAI,GAAGG,OAAS,IAAID,KAAO,EAAG;IACnCO,OAAO,EAAGZ,YAAc;IACxBO,QAAQ,EAAKJ,KAAK,IAAM;MACvB,MAAM,CAAEU,UAAU,EAAEC,QAAQ,CAAE,GAAGX,KAAK,CAACY,KAAK,CAAE,GAAI,CAAC;MACnDR,QAAQ,CAAE;QAAEF,KAAK,EAAES,QAAQ;QAAER,OAAO,EAAEO;MAAW,CAAE,CAAC;IACrD;EAAG,CACH,CAAC;AAEJ;AAAC,IAAAG,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcd,YAAY","ignoreList":[]}
|
|
@@ -137,7 +137,8 @@ function ParentControl({
|
|
|
137
137
|
onInputChange: debouncedSearch,
|
|
138
138
|
suggestions: suggestions,
|
|
139
139
|
onChange: onParentChange,
|
|
140
|
-
__experimentalShowHowTo: false
|
|
140
|
+
__experimentalShowHowTo: false,
|
|
141
|
+
__nextHasNoMarginBottom: true
|
|
141
142
|
});
|
|
142
143
|
}
|
|
143
144
|
var _default = exports.default = ParentControl;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_components","_data","_coreData","_element","_compose","_utils","_jsxRuntime","EMPTY_ARRAY","BASE_QUERY","order","_fields","context","ParentControl","parents","postType","onChange","search","setSearch","useState","value","setValue","suggestions","setSuggestions","debouncedSearch","useDebounce","searchResults","searchHasResolved","useSelect","select","getEntityRecords","hasFinishedResolution","coreStore","selectorArgs","orderby","exclude","per_page","currentParents","length","include","useEffect","currentParentsInfo","getEntitiesInfo","mapToIHasNameAndId","sanitizedValue","reduce","accumulator","id","entity","mapById","push","name","entitiesInfo","useMemo","names","getIdByValue","entitiesMappedByName","onParentChange","newValue","ids","Array","from","mapByName","add","Set","jsx","FormTokenField","label","__","onInputChange","__experimentalShowHowTo","_default","exports","default"],"sources":["@wordpress/block-library/src/query/edit/inspector-controls/parent-control.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { FormTokenField } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useState, useEffect, useMemo } from '@wordpress/element';\nimport { useDebounce } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { getEntitiesInfo, mapToIHasNameAndId } from '../../utils';\n\nconst EMPTY_ARRAY = [];\nconst BASE_QUERY = {\n\torder: 'asc',\n\t_fields: 'id,title',\n\tcontext: 'view',\n};\n\nfunction ParentControl( { parents, postType, onChange } ) {\n\tconst [ search, setSearch ] = useState( '' );\n\tconst [ value, setValue ] = useState( EMPTY_ARRAY );\n\tconst [ suggestions, setSuggestions ] = useState( EMPTY_ARRAY );\n\tconst debouncedSearch = useDebounce( setSearch, 250 );\n\tconst { searchResults, searchHasResolved } = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! search ) {\n\t\t\t\treturn { searchResults: EMPTY_ARRAY, searchHasResolved: true };\n\t\t\t}\n\t\t\tconst { getEntityRecords, hasFinishedResolution } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst selectorArgs = [\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\t{\n\t\t\t\t\t...BASE_QUERY,\n\t\t\t\t\tsearch,\n\t\t\t\t\torderby: 'relevance',\n\t\t\t\t\texclude: parents,\n\t\t\t\t\tper_page: 20,\n\t\t\t\t},\n\t\t\t];\n\t\t\treturn {\n\t\t\t\tsearchResults: getEntityRecords( ...selectorArgs ),\n\t\t\t\tsearchHasResolved: hasFinishedResolution(\n\t\t\t\t\t'getEntityRecords',\n\t\t\t\t\tselectorArgs\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[ search, parents ]\n\t);\n\tconst currentParents = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! parents?.length ) {\n\t\t\t\treturn EMPTY_ARRAY;\n\t\t\t}\n\t\t\tconst { getEntityRecords } = select( coreStore );\n\t\t\treturn getEntityRecords( 'postType', postType, {\n\t\t\t\t...BASE_QUERY,\n\t\t\t\tinclude: parents,\n\t\t\t\tper_page: parents.length,\n\t\t\t} );\n\t\t},\n\t\t[ parents ]\n\t);\n\t// Update the `value` state only after the selectors are resolved\n\t// to avoid emptying the input when we're changing parents.\n\tuseEffect( () => {\n\t\tif ( ! parents?.length ) {\n\t\t\tsetValue( EMPTY_ARRAY );\n\t\t}\n\t\tif ( ! currentParents?.length ) {\n\t\t\treturn;\n\t\t}\n\t\tconst currentParentsInfo = getEntitiesInfo(\n\t\t\tmapToIHasNameAndId( currentParents, 'title.rendered' )\n\t\t);\n\t\t// Returns only the existing entity ids. This prevents the component\n\t\t// from crashing in the editor, when non existing ids are provided.\n\t\tconst sanitizedValue = parents.reduce( ( accumulator, id ) => {\n\t\t\tconst entity = currentParentsInfo.mapById[ id ];\n\t\t\tif ( entity ) {\n\t\t\t\taccumulator.push( {\n\t\t\t\t\tid,\n\t\t\t\t\tvalue: entity.name,\n\t\t\t\t} );\n\t\t\t}\n\t\t\treturn accumulator;\n\t\t}, [] );\n\t\tsetValue( sanitizedValue );\n\t}, [ parents, currentParents ] );\n\n\tconst entitiesInfo = useMemo( () => {\n\t\tif ( ! searchResults?.length ) {\n\t\t\treturn EMPTY_ARRAY;\n\t\t}\n\t\treturn getEntitiesInfo(\n\t\t\tmapToIHasNameAndId( searchResults, 'title.rendered' )\n\t\t);\n\t}, [ searchResults ] );\n\t// Update suggestions only when the query has resolved.\n\tuseEffect( () => {\n\t\tif ( ! searchHasResolved ) {\n\t\t\treturn;\n\t\t}\n\t\tsetSuggestions( entitiesInfo.names );\n\t}, [ entitiesInfo.names, searchHasResolved ] );\n\n\tconst getIdByValue = ( entitiesMappedByName, entity ) => {\n\t\tconst id = entity?.id || entitiesMappedByName?.[ entity ]?.id;\n\t\tif ( id ) {\n\t\t\treturn id;\n\t\t}\n\t};\n\tconst onParentChange = ( newValue ) => {\n\t\tconst ids = Array.from(\n\t\t\tnewValue.reduce( ( accumulator, entity ) => {\n\t\t\t\t// Verify that new values point to existing entities.\n\t\t\t\tconst id = getIdByValue( entitiesInfo.mapByName, entity );\n\t\t\t\tif ( id ) {\n\t\t\t\t\taccumulator.add( id );\n\t\t\t\t}\n\t\t\t\treturn accumulator;\n\t\t\t}, new Set() )\n\t\t);\n\t\tsetSuggestions( EMPTY_ARRAY );\n\t\tonChange( { parents: ids } );\n\t};\n\treturn (\n\t\t<FormTokenField\n\t\t\tlabel={ __( 'Parents' ) }\n\t\t\tvalue={ value }\n\t\t\tonInputChange={ debouncedSearch }\n\t\t\tsuggestions={ suggestions }\n\t\t\tonChange={ onParentChange }\n\t\t\t__experimentalShowHowTo={ false }\n\t\t/>\n\t);\n}\n\nexport default ParentControl;\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAKA,IAAAM,MAAA,GAAAN,OAAA;AAAkE,IAAAO,WAAA,GAAAP,OAAA;AAblE;AACA;AACA;;AAQA;AACA;AACA;;AAGA,MAAMQ,WAAW,GAAG,EAAE;AACtB,MAAMC,UAAU,GAAG;EAClBC,KAAK,EAAE,KAAK;EACZC,OAAO,EAAE,UAAU;EACnBC,OAAO,EAAE;AACV,CAAC;AAED,SAASC,aAAaA,CAAE;EAAEC,OAAO;EAAEC,QAAQ;EAAEC;AAAS,CAAC,EAAG;EACzD,MAAM,CAAEC,MAAM,EAAEC,SAAS,CAAE,GAAG,IAAAC,iBAAQ,EAAE,EAAG,CAAC;EAC5C,MAAM,CAAEC,KAAK,EAAEC,QAAQ,CAAE,GAAG,IAAAF,iBAAQ,EAAEX,WAAY,CAAC;EACnD,MAAM,CAAEc,WAAW,EAAEC,cAAc,CAAE,GAAG,IAAAJ,i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E;IAC7D,IAAKA,EAAE,EAAG;MACT,OAAOA,EAAE;IACV;EACD,CAAC;EACD,MAAMU,cAAc,GAAKC,QAAQ,IAAM;IACtC,MAAMC,GAAG,GAAGC,KAAK,CAACC,IAAI,CACrBH,QAAQ,CAACb,MAAM,CAAE,CAAEC,WAAW,EAAEE,MAAM,KAAM;MAC3C;MACA,MAAMD,EAAE,GAAGQ,YAAY,CAAEH,YAAY,CAACU,SAAS,EAAEd,MAAO,CAAC;MACzD,IAAKD,EAAE,EAAG;QACTD,WAAW,CAACiB,GAAG,CAAEhB,EAAG,CAAC;MACtB;MACA,OAAOD,WAAW;IACnB,CAAC,EAAE,IAAIkB,GAAG,CAAC,CAAE,CACd,CAAC;IACDzC,cAAc,CAAEf,WAAY,CAAC;IAC7BQ,QAAQ,CAAE;MAAEF,OAAO,EAAE6C;IAAI,CAAE,CAAC;EAC7B,CAAC;EACD,oBACC,IAAApD,WAAA,CAAA0D,GAAA,EAAChE,WAAA,CAAAiE,cAAc;IACdC,KAAK,EAAG,IAAAC,QAAE,EAAE,SAAU,CAAG;IACzBhD,KAAK,EAAGA,KAAO;IACfiD,aAAa,EAAG7C,eAAiB;IACjCF,WAAW,EAAGA,WAAa;IAC3BN,QAAQ,EAAGyC,cAAgB;IAC3Ba,uBAAuB,EAAG;
|
|
1
|
+
{"version":3,"names":["_i18n","require","_components","_data","_coreData","_element","_compose","_utils","_jsxRuntime","EMPTY_ARRAY","BASE_QUERY","order","_fields","context","ParentControl","parents","postType","onChange","search","setSearch","useState","value","setValue","suggestions","setSuggestions","debouncedSearch","useDebounce","searchResults","searchHasResolved","useSelect","select","getEntityRecords","hasFinishedResolution","coreStore","selectorArgs","orderby","exclude","per_page","currentParents","length","include","useEffect","currentParentsInfo","getEntitiesInfo","mapToIHasNameAndId","sanitizedValue","reduce","accumulator","id","entity","mapById","push","name","entitiesInfo","useMemo","names","getIdByValue","entitiesMappedByName","onParentChange","newValue","ids","Array","from","mapByName","add","Set","jsx","FormTokenField","label","__","onInputChange","__experimentalShowHowTo","__nextHasNoMarginBottom","_default","exports","default"],"sources":["@wordpress/block-library/src/query/edit/inspector-controls/parent-control.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { FormTokenField } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useState, useEffect, useMemo } from '@wordpress/element';\nimport { useDebounce } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { getEntitiesInfo, mapToIHasNameAndId } from '../../utils';\n\nconst EMPTY_ARRAY = [];\nconst BASE_QUERY = {\n\torder: 'asc',\n\t_fields: 'id,title',\n\tcontext: 'view',\n};\n\nfunction ParentControl( { parents, postType, onChange } ) {\n\tconst [ search, setSearch ] = useState( '' );\n\tconst [ value, setValue ] = useState( EMPTY_ARRAY );\n\tconst [ suggestions, setSuggestions ] = useState( EMPTY_ARRAY );\n\tconst debouncedSearch = useDebounce( setSearch, 250 );\n\tconst { searchResults, searchHasResolved } = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! search ) {\n\t\t\t\treturn { searchResults: EMPTY_ARRAY, searchHasResolved: true };\n\t\t\t}\n\t\t\tconst { getEntityRecords, hasFinishedResolution } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst selectorArgs = [\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\t{\n\t\t\t\t\t...BASE_QUERY,\n\t\t\t\t\tsearch,\n\t\t\t\t\torderby: 'relevance',\n\t\t\t\t\texclude: parents,\n\t\t\t\t\tper_page: 20,\n\t\t\t\t},\n\t\t\t];\n\t\t\treturn {\n\t\t\t\tsearchResults: getEntityRecords( ...selectorArgs ),\n\t\t\t\tsearchHasResolved: hasFinishedResolution(\n\t\t\t\t\t'getEntityRecords',\n\t\t\t\t\tselectorArgs\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[ search, parents ]\n\t);\n\tconst currentParents = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! parents?.length ) {\n\t\t\t\treturn EMPTY_ARRAY;\n\t\t\t}\n\t\t\tconst { getEntityRecords } = select( coreStore );\n\t\t\treturn getEntityRecords( 'postType', postType, {\n\t\t\t\t...BASE_QUERY,\n\t\t\t\tinclude: parents,\n\t\t\t\tper_page: parents.length,\n\t\t\t} );\n\t\t},\n\t\t[ parents ]\n\t);\n\t// Update the `value` state only after the selectors are resolved\n\t// to avoid emptying the input when we're changing parents.\n\tuseEffect( () => {\n\t\tif ( ! parents?.length ) {\n\t\t\tsetValue( EMPTY_ARRAY );\n\t\t}\n\t\tif ( ! currentParents?.length ) {\n\t\t\treturn;\n\t\t}\n\t\tconst currentParentsInfo = getEntitiesInfo(\n\t\t\tmapToIHasNameAndId( currentParents, 'title.rendered' )\n\t\t);\n\t\t// Returns only the existing entity ids. This prevents the component\n\t\t// from crashing in the editor, when non existing ids are provided.\n\t\tconst sanitizedValue = parents.reduce( ( accumulator, id ) => {\n\t\t\tconst entity = currentParentsInfo.mapById[ id ];\n\t\t\tif ( entity ) {\n\t\t\t\taccumulator.push( {\n\t\t\t\t\tid,\n\t\t\t\t\tvalue: entity.name,\n\t\t\t\t} );\n\t\t\t}\n\t\t\treturn accumulator;\n\t\t}, [] );\n\t\tsetValue( sanitizedValue );\n\t}, [ parents, currentParents ] );\n\n\tconst entitiesInfo = useMemo( () => {\n\t\tif ( ! searchResults?.length ) {\n\t\t\treturn EMPTY_ARRAY;\n\t\t}\n\t\treturn getEntitiesInfo(\n\t\t\tmapToIHasNameAndId( searchResults, 'title.rendered' )\n\t\t);\n\t}, [ searchResults ] );\n\t// Update suggestions only when the query has resolved.\n\tuseEffect( () => {\n\t\tif ( ! searchHasResolved ) {\n\t\t\treturn;\n\t\t}\n\t\tsetSuggestions( entitiesInfo.names );\n\t}, [ entitiesInfo.names, searchHasResolved ] );\n\n\tconst getIdByValue = ( entitiesMappedByName, entity ) => {\n\t\tconst id = entity?.id || entitiesMappedByName?.[ entity ]?.id;\n\t\tif ( id ) {\n\t\t\treturn id;\n\t\t}\n\t};\n\tconst onParentChange = ( newValue ) => {\n\t\tconst ids = Array.from(\n\t\t\tnewValue.reduce( ( accumulator, entity ) => {\n\t\t\t\t// Verify that new values point to existing entities.\n\t\t\t\tconst id = getIdByValue( entitiesInfo.mapByName, entity );\n\t\t\t\tif ( id ) {\n\t\t\t\t\taccumulator.add( id );\n\t\t\t\t}\n\t\t\t\treturn accumulator;\n\t\t\t}, new Set() )\n\t\t);\n\t\tsetSuggestions( EMPTY_ARRAY );\n\t\tonChange( { parents: ids } );\n\t};\n\treturn (\n\t\t<FormTokenField\n\t\t\tlabel={ __( 'Parents' ) }\n\t\t\tvalue={ value }\n\t\t\tonInputChange={ debouncedSearch }\n\t\t\tsuggestions={ suggestions }\n\t\t\tonChange={ onParentChange }\n\t\t\t__experimentalShowHowTo={ false }\n\t\t\t__nextHasNoMarginBottom\n\t\t/>\n\t);\n}\n\nexport default ParentControl;\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAKA,IAAAM,MAAA,GAAAN,OAAA;AAAkE,IAAAO,WAAA,GAAAP,OAAA;AAblE;AACA;AACA;;AAQA;AACA;AACA;;AAGA,MAAMQ,WAAW,GAAG,EAAE;AACtB,MAAMC,UAAU,GAAG;EAClBC,KAAK,EAAE,KAAK;EACZC,OAAO,EAAE,UAAU;EACnBC,OAAO,EAAE;AACV,CAAC;AAED,SAASC,aAAaA,CAAE;EAAEC,OAAO;EAAEC,QAAQ;EAAEC;AAAS,CAAC,EAAG;EACzD,MAAM,CAAEC,MAAM,EAAEC,SAAS,CAAE,GAAG,IAAAC,iBAAQ,EAAE,EAAG,CAAC;EAC5C,MAAM,CAAEC,K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GA,CAAEC,oBAAoB,EAAER,MAAM,KAAM;IACxD,MAAMD,EAAE,GAAGC,MAAM,EAAED,EAAE,IAAIS,oBAAoB,GAAIR,MAAM,CAAE,EAAED,EAAE;IAC7D,IAAKA,EAAE,EAAG;MACT,OAAOA,EAAE;IACV;EACD,CAAC;EACD,MAAMU,cAAc,GAAKC,QAAQ,IAAM;IACtC,MAAMC,GAAG,GAAGC,KAAK,CAACC,IAAI,CACrBH,QAAQ,CAACb,MAAM,CAAE,CAAEC,WAAW,EAAEE,MAAM,KAAM;MAC3C;MACA,MAAMD,EAAE,GAAGQ,YAAY,CAAEH,YAAY,CAACU,SAAS,EAAEd,MAAO,CAAC;MACzD,IAAKD,EAAE,EAAG;QACTD,WAAW,CAACiB,GAAG,CAAEhB,EAAG,CAAC;MACtB;MACA,OAAOD,WAAW;IACnB,CAAC,EAAE,IAAIkB,GAAG,CAAC,CAAE,CACd,CAAC;IACDzC,cAAc,CAAEf,WAAY,CAAC;IAC7BQ,QAAQ,CAAE;MAAEF,OAAO,EAAE6C;IAAI,CAAE,CAAC;EAC7B,CAAC;EACD,oBACC,IAAApD,WAAA,CAAA0D,GAAA,EAAChE,WAAA,CAAAiE,cAAc;IACdC,KAAK,EAAG,IAAAC,QAAE,EAAE,SAAU,CAAG;IACzBhD,KAAK,EAAGA,KAAO;IACfiD,aAAa,EAAG7C,eAAiB;IACjCF,WAAW,EAAGA,WAAa;IAC3BN,QAAQ,EAAGyC,cAAgB;IAC3Ba,uBAAuB,EAAG,KAAO;IACjCC,uBAAuB;EAAA,CACvB,CAAC;AAEJ;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc7D,aAAa","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_i18n","_jsxRuntime","stickyOptions","label","__","value","StickyControl","onChange","jsx","SelectControl","__nextHasNoMarginBottom","options","help"],"sources":["@wordpress/block-library/src/query/edit/inspector-controls/sticky-control.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SelectControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nconst stickyOptions = [\n\t{ label: __( 'Include' ), value: '' },\n\t{ label: __( 'Exclude' ), value: 'exclude' },\n\t{ label: __( 'Only' ), value: 'only' },\n];\n\nexport default function StickyControl( { value, onChange } ) {\n\treturn (\n\t\t<SelectControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\tlabel={ __( 'Sticky posts' ) }\n\t\t\toptions={ stickyOptions }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\thelp={ __(\n\t\t\t\t'Blog posts can be “stickied”, a feature that places them at the top of the front page of posts, keeping it there until new sticky posts are published.'\n\t\t\t) }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAAqC,IAAAE,WAAA,GAAAF,OAAA;AAJrC;AACA;AACA;;AAIA,MAAMG,aAAa,GAAG,CACrB;EAAEC,KAAK,EAAE,IAAAC,QAAE,EAAE,SAAU,CAAC;EAAEC,KAAK,EAAE;AAAG,CAAC,EACrC;EAAEF,KAAK,EAAE,IAAAC,QAAE,EAAE,SAAU,CAAC;EAAEC,KAAK,EAAE;AAAU,CAAC,EAC5C;EAAEF,KAAK,EAAE,IAAAC,QAAE,EAAE,MAAO,CAAC;EAAEC,KAAK,EAAE;AAAO,CAAC,CACtC;AAEc,SAASC,aAAaA,CAAE;EAAED,KAAK;EAAEE;AAAS,CAAC,EAAG;EAC5D,oBACC,IAAAN,WAAA,CAAAO,GAAA,EAACV,WAAA,CAAAW,aAAa;IACbC,uBAAuB;
|
|
1
|
+
{"version":3,"names":["_components","require","_i18n","_jsxRuntime","stickyOptions","label","__","value","StickyControl","onChange","jsx","SelectControl","__nextHasNoMarginBottom","__next40pxDefaultSize","options","help"],"sources":["@wordpress/block-library/src/query/edit/inspector-controls/sticky-control.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SelectControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nconst stickyOptions = [\n\t{ label: __( 'Include' ), value: '' },\n\t{ label: __( 'Exclude' ), value: 'exclude' },\n\t{ label: __( 'Only' ), value: 'only' },\n];\n\nexport default function StickyControl( { value, onChange } ) {\n\treturn (\n\t\t<SelectControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\t__next40pxDefaultSize\n\t\t\tlabel={ __( 'Sticky posts' ) }\n\t\t\toptions={ stickyOptions }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\thelp={ __(\n\t\t\t\t'Blog posts can be “stickied”, a feature that places them at the top of the front page of posts, keeping it there until new sticky posts are published.'\n\t\t\t) }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAAqC,IAAAE,WAAA,GAAAF,OAAA;AAJrC;AACA;AACA;;AAIA,MAAMG,aAAa,GAAG,CACrB;EAAEC,KAAK,EAAE,IAAAC,QAAE,EAAE,SAAU,CAAC;EAAEC,KAAK,EAAE;AAAG,CAAC,EACrC;EAAEF,KAAK,EAAE,IAAAC,QAAE,EAAE,SAAU,CAAC;EAAEC,KAAK,EAAE;AAAU,CAAC,EAC5C;EAAEF,KAAK,EAAE,IAAAC,QAAE,EAAE,MAAO,CAAC;EAAEC,KAAK,EAAE;AAAO,CAAC,CACtC;AAEc,SAASC,aAAaA,CAAE;EAAED,KAAK;EAAEE;AAAS,CAAC,EAAG;EAC5D,oBACC,IAAAN,WAAA,CAAAO,GAAA,EAACV,WAAA,CAAAW,aAAa;IACbC,uBAAuB;IACvBC,qBAAqB;IACrBR,KAAK,EAAG,IAAAC,QAAE,EAAE,cAAe,CAAG;IAC9BQ,OAAO,EAAGV,aAAe;IACzBG,KAAK,EAAGA,KAAO;IACfE,QAAQ,EAAGA,QAAU;IACrBM,IAAI,EAAG,IAAAT,QAAE,EACR,wJACD;EAAG,CACH,CAAC;AAEJ","ignoreList":[]}
|
|
@@ -59,7 +59,8 @@ function TaxonomyControls({
|
|
|
59
59
|
if (!taxonomies || taxonomies.length === 0) {
|
|
60
60
|
return null;
|
|
61
61
|
}
|
|
62
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
62
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalVStack, {
|
|
63
|
+
spacing: 4,
|
|
63
64
|
children: taxonomies.map(taxonomy => {
|
|
64
65
|
const termIds = taxQuery?.[taxonomy.slug] || [];
|
|
65
66
|
const handleChange = newTermIds => onChange({
|
|
@@ -187,7 +188,9 @@ function TaxonomyItem({
|
|
|
187
188
|
suggestions: suggestions,
|
|
188
189
|
displayTransform: _htmlEntities.decodeEntities,
|
|
189
190
|
onChange: onTermsChange,
|
|
190
|
-
__experimentalShowHowTo: false
|
|
191
|
+
__experimentalShowHowTo: false,
|
|
192
|
+
__nextHasNoMarginBottom: true,
|
|
193
|
+
__next40pxDefaultSize: true
|
|
191
194
|
})
|
|
192
195
|
});
|
|
193
196
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_data","_coreData","_element","_compose","_htmlEntities","_utils","_jsxRuntime","EMPTY_ARRAY","BASE_QUERY","order","_fields","context","getTermIdByTermValue","terms","termValue","termId","id","find","term","name","termValueLower","toLocaleLowerCase","TaxonomyControls","onChange","query","postType","taxQuery","taxonomies","useTaxonomies","length","jsx","Fragment","children","map","taxonomy","termIds","slug","handleChange","newTermIds","TaxonomyItem","search","setSearch","useState","value","setValue","suggestions","setSuggestions","debouncedSearch","useDebounce","searchResults","searchHasResolved","useSelect","select","getEntityRecords","hasFinishedResolution","coreStore","selectorArgs","orderby","exclude","per_page","existingTerms","include","useEffect","sanitizedValue","reduce","accumulator","entity","push","result","onTermsChange","newTermValues","Set","add","Array","from","className","FormTokenField","label","onInputChange","displayTransform","decodeEntities","__experimentalShowHowTo"],"sources":["@wordpress/block-library/src/query/edit/inspector-controls/taxonomy-controls.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { FormTokenField } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useState, useEffect } from '@wordpress/element';\nimport { useDebounce } from '@wordpress/compose';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { useTaxonomies } from '../../utils';\n\nconst EMPTY_ARRAY = [];\nconst BASE_QUERY = {\n\torder: 'asc',\n\t_fields: 'id,name',\n\tcontext: 'view',\n};\n\n// Helper function to get the term id based on user input in terms `FormTokenField`.\nconst getTermIdByTermValue = ( terms, termValue ) => {\n\t// First we check for exact match by `term.id` or case sensitive `term.name` match.\n\tconst termId =\n\t\ttermValue?.id || terms?.find( ( term ) => term.name === termValue )?.id;\n\tif ( termId ) {\n\t\treturn termId;\n\t}\n\n\t/**\n\t * Here we make an extra check for entered terms in a non case sensitive way,\n\t * to match user expectations, due to `FormTokenField` behaviour that shows\n\t * suggestions which are case insensitive.\n\t *\n\t * Although WP tries to discourage users to add terms with the same name (case insensitive),\n\t * it's still possible if you manually change the name, as long as the terms have different slugs.\n\t * In this edge case we always apply the first match from the terms list.\n\t */\n\tconst termValueLower = termValue.toLocaleLowerCase();\n\treturn terms?.find(\n\t\t( term ) => term.name.toLocaleLowerCase() === termValueLower\n\t)?.id;\n};\n\nexport function TaxonomyControls( { onChange, query } ) {\n\tconst { postType, taxQuery } = query;\n\n\tconst taxonomies = useTaxonomies( postType );\n\tif ( ! taxonomies || taxonomies.length === 0 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ taxonomies.map( ( taxonomy ) => {\n\t\t\t\tconst termIds = taxQuery?.[ taxonomy.slug ] || [];\n\t\t\t\tconst handleChange = ( newTermIds ) =>\n\t\t\t\t\tonChange( {\n\t\t\t\t\t\ttaxQuery: {\n\t\t\t\t\t\t\t...taxQuery,\n\t\t\t\t\t\t\t[ taxonomy.slug ]: newTermIds,\n\t\t\t\t\t\t},\n\t\t\t\t\t} );\n\n\t\t\t\treturn (\n\t\t\t\t\t<TaxonomyItem\n\t\t\t\t\t\tkey={ taxonomy.slug }\n\t\t\t\t\t\ttaxonomy={ taxonomy }\n\t\t\t\t\t\ttermIds={ termIds }\n\t\t\t\t\t\tonChange={ handleChange }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</>\n\t);\n}\n\n/**\n * Renders a `FormTokenField` for a given taxonomy.\n *\n * @param {Object} props The props for the component.\n * @param {Object} props.taxonomy The taxonomy object.\n * @param {number[]} props.termIds An array with the block's term ids for the given taxonomy.\n * @param {Function} props.onChange Callback `onChange` function.\n * @return {JSX.Element} The rendered component.\n */\nfunction TaxonomyItem( { taxonomy, termIds, onChange } ) {\n\tconst [ search, setSearch ] = useState( '' );\n\tconst [ value, setValue ] = useState( EMPTY_ARRAY );\n\tconst [ suggestions, setSuggestions ] = useState( EMPTY_ARRAY );\n\tconst debouncedSearch = useDebounce( setSearch, 250 );\n\tconst { searchResults, searchHasResolved } = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! search ) {\n\t\t\t\treturn { searchResults: EMPTY_ARRAY, searchHasResolved: true };\n\t\t\t}\n\t\t\tconst { getEntityRecords, hasFinishedResolution } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst selectorArgs = [\n\t\t\t\t'taxonomy',\n\t\t\t\ttaxonomy.slug,\n\t\t\t\t{\n\t\t\t\t\t...BASE_QUERY,\n\t\t\t\t\tsearch,\n\t\t\t\t\torderby: 'name',\n\t\t\t\t\texclude: termIds,\n\t\t\t\t\tper_page: 20,\n\t\t\t\t},\n\t\t\t];\n\t\t\treturn {\n\t\t\t\tsearchResults: getEntityRecords( ...selectorArgs ),\n\t\t\t\tsearchHasResolved: hasFinishedResolution(\n\t\t\t\t\t'getEntityRecords',\n\t\t\t\t\tselectorArgs\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[ search, termIds ]\n\t);\n\t// `existingTerms` are the ones fetched from the API and their type is `{ id: number; name: string }`.\n\t// They are used to extract the terms' names to populate the `FormTokenField` properly\n\t// and to sanitize the provided `termIds`, by setting only the ones that exist.\n\tconst existingTerms = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! termIds?.length ) {\n\t\t\t\treturn EMPTY_ARRAY;\n\t\t\t}\n\t\t\tconst { getEntityRecords } = select( coreStore );\n\t\t\treturn getEntityRecords( 'taxonomy', taxonomy.slug, {\n\t\t\t\t...BASE_QUERY,\n\t\t\t\tinclude: termIds,\n\t\t\t\tper_page: termIds.length,\n\t\t\t} );\n\t\t},\n\t\t[ termIds ]\n\t);\n\t// Update the `value` state only after the selectors are resolved\n\t// to avoid emptying the input when we're changing terms.\n\tuseEffect( () => {\n\t\tif ( ! termIds?.length ) {\n\t\t\tsetValue( EMPTY_ARRAY );\n\t\t}\n\t\tif ( ! existingTerms?.length ) {\n\t\t\treturn;\n\t\t}\n\t\t// Returns only the existing entity ids. This prevents the component\n\t\t// from crashing in the editor, when non existing ids are provided.\n\t\tconst sanitizedValue = termIds.reduce( ( accumulator, id ) => {\n\t\t\tconst entity = existingTerms.find( ( term ) => term.id === id );\n\t\t\tif ( entity ) {\n\t\t\t\taccumulator.push( {\n\t\t\t\t\tid,\n\t\t\t\t\tvalue: entity.name,\n\t\t\t\t} );\n\t\t\t}\n\t\t\treturn accumulator;\n\t\t}, [] );\n\t\tsetValue( sanitizedValue );\n\t}, [ termIds, existingTerms ] );\n\t// Update suggestions only when the query has resolved.\n\tuseEffect( () => {\n\t\tif ( ! searchHasResolved ) {\n\t\t\treturn;\n\t\t}\n\t\tsetSuggestions( searchResults.map( ( result ) => result.name ) );\n\t}, [ searchResults, searchHasResolved ] );\n\tconst onTermsChange = ( newTermValues ) => {\n\t\tconst newTermIds = new Set();\n\t\tfor ( const termValue of newTermValues ) {\n\t\t\tconst termId = getTermIdByTermValue( searchResults, termValue );\n\t\t\tif ( termId ) {\n\t\t\t\tnewTermIds.add( termId );\n\t\t\t}\n\t\t}\n\t\tsetSuggestions( EMPTY_ARRAY );\n\t\tonChange( Array.from( newTermIds ) );\n\t};\n\treturn (\n\t\t<div className=\"block-library-query-inspector__taxonomy-control\">\n\t\t\t<FormTokenField\n\t\t\t\tlabel={ taxonomy.name }\n\t\t\t\tvalue={ value }\n\t\t\t\tonInputChange={ debouncedSearch }\n\t\t\t\tsuggestions={ suggestions }\n\t\t\t\tdisplayTransform={ decodeEntities }\n\t\t\t\tonChange={ onTermsChange }\n\t\t\t\t__experimentalShowHowTo={ false }\n\t\t\t/>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AAKA,IAAAM,MAAA,GAAAN,OAAA;AAA4C,IAAAO,WAAA,GAAAP,OAAA;AAb5C;AACA;AACA;;AAQA;AACA;AACA;;AAGA,MAAMQ,WAAW,GAAG,EAAE;AACtB,MAAMC,UAAU,GAAG;EAClBC,KAAK,EAAE,KAAK;EACZC,OAAO,EAAE,SAAS;EAClBC,OAAO,EAAE;AACV,CAAC;;AAED;AACA,MAAMC,oBAAoB,GAAGA,CAAEC,KAAK,EAAEC,SAAS,KAAM;EACpD;EACA,MAAMC,MAAM,GACXD,SAAS,EAAEE,EAAE,IAAIH,KAAK,EAAEI,IAAI,CAAIC,IAAI,IAAMA,IAAI,CAACC,IAAI,KAAKL,SAAU,CAAC,EAAEE,EAAE;EACxE,IAAKD,MAAM,EAAG;IACb,OAAOA,MAAM;EACd;;EAEA;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACC,MAAMK,cAAc,GAAGN,SAAS,CAACO,iBAAiB,CAAC,CAAC;EACpD,O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AO,CAAC;MACzB;IACD;IACA+B,cAAc,CAAEvC,WAAY,CAAC;IAC7BgB,QAAQ,CAAEkD,KAAK,CAACC,IAAI,CAAEpC,UAAW,CAAE,CAAC;EACrC,CAAC;EACD,oBACC,IAAAhC,WAAA,CAAAwB,GAAA;IAAK6C,SAAS,EAAC,iDAAiD;IAAA3C,QAAA,eAC/D,IAAA1B,WAAA,CAAAwB,GAAA,EAAChC,WAAA,CAAA8E,cAAc;MACdC,KAAK,EAAG3C,QAAQ,CAACf,IAAM;MACvBwB,KAAK,EAAGA,KAAO;MACfmC,aAAa,EAAG/B,eAAiB;MACjCF,WAAW,EAAGA,WAAa;MAC3BkC,gBAAgB,EAAGC,4BAAgB;MACnCzD,QAAQ,EAAG8C,aAAe;MAC1BY,uBAAuB,EAAG;IAAO,CACjC;EAAC,CACE,CAAC;AAER","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_components","require","_data","_coreData","_element","_compose","_htmlEntities","_utils","_jsxRuntime","EMPTY_ARRAY","BASE_QUERY","order","_fields","context","getTermIdByTermValue","terms","termValue","termId","id","find","term","name","termValueLower","toLocaleLowerCase","TaxonomyControls","onChange","query","postType","taxQuery","taxonomies","useTaxonomies","length","jsx","__experimentalVStack","spacing","children","map","taxonomy","termIds","slug","handleChange","newTermIds","TaxonomyItem","search","setSearch","useState","value","setValue","suggestions","setSuggestions","debouncedSearch","useDebounce","searchResults","searchHasResolved","useSelect","select","getEntityRecords","hasFinishedResolution","coreStore","selectorArgs","orderby","exclude","per_page","existingTerms","include","useEffect","sanitizedValue","reduce","accumulator","entity","push","result","onTermsChange","newTermValues","Set","add","Array","from","className","FormTokenField","label","onInputChange","displayTransform","decodeEntities","__experimentalShowHowTo","__nextHasNoMarginBottom","__next40pxDefaultSize"],"sources":["@wordpress/block-library/src/query/edit/inspector-controls/taxonomy-controls.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tFormTokenField,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useState, useEffect } from '@wordpress/element';\nimport { useDebounce } from '@wordpress/compose';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { useTaxonomies } from '../../utils';\n\nconst EMPTY_ARRAY = [];\nconst BASE_QUERY = {\n\torder: 'asc',\n\t_fields: 'id,name',\n\tcontext: 'view',\n};\n\n// Helper function to get the term id based on user input in terms `FormTokenField`.\nconst getTermIdByTermValue = ( terms, termValue ) => {\n\t// First we check for exact match by `term.id` or case sensitive `term.name` match.\n\tconst termId =\n\t\ttermValue?.id || terms?.find( ( term ) => term.name === termValue )?.id;\n\tif ( termId ) {\n\t\treturn termId;\n\t}\n\n\t/**\n\t * Here we make an extra check for entered terms in a non case sensitive way,\n\t * to match user expectations, due to `FormTokenField` behaviour that shows\n\t * suggestions which are case insensitive.\n\t *\n\t * Although WP tries to discourage users to add terms with the same name (case insensitive),\n\t * it's still possible if you manually change the name, as long as the terms have different slugs.\n\t * In this edge case we always apply the first match from the terms list.\n\t */\n\tconst termValueLower = termValue.toLocaleLowerCase();\n\treturn terms?.find(\n\t\t( term ) => term.name.toLocaleLowerCase() === termValueLower\n\t)?.id;\n};\n\nexport function TaxonomyControls( { onChange, query } ) {\n\tconst { postType, taxQuery } = query;\n\n\tconst taxonomies = useTaxonomies( postType );\n\tif ( ! taxonomies || taxonomies.length === 0 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<VStack spacing={ 4 }>\n\t\t\t{ taxonomies.map( ( taxonomy ) => {\n\t\t\t\tconst termIds = taxQuery?.[ taxonomy.slug ] || [];\n\t\t\t\tconst handleChange = ( newTermIds ) =>\n\t\t\t\t\tonChange( {\n\t\t\t\t\t\ttaxQuery: {\n\t\t\t\t\t\t\t...taxQuery,\n\t\t\t\t\t\t\t[ taxonomy.slug ]: newTermIds,\n\t\t\t\t\t\t},\n\t\t\t\t\t} );\n\n\t\t\t\treturn (\n\t\t\t\t\t<TaxonomyItem\n\t\t\t\t\t\tkey={ taxonomy.slug }\n\t\t\t\t\t\ttaxonomy={ taxonomy }\n\t\t\t\t\t\ttermIds={ termIds }\n\t\t\t\t\t\tonChange={ handleChange }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</VStack>\n\t);\n}\n\n/**\n * Renders a `FormTokenField` for a given taxonomy.\n *\n * @param {Object} props The props for the component.\n * @param {Object} props.taxonomy The taxonomy object.\n * @param {number[]} props.termIds An array with the block's term ids for the given taxonomy.\n * @param {Function} props.onChange Callback `onChange` function.\n * @return {JSX.Element} The rendered component.\n */\nfunction TaxonomyItem( { taxonomy, termIds, onChange } ) {\n\tconst [ search, setSearch ] = useState( '' );\n\tconst [ value, setValue ] = useState( EMPTY_ARRAY );\n\tconst [ suggestions, setSuggestions ] = useState( EMPTY_ARRAY );\n\tconst debouncedSearch = useDebounce( setSearch, 250 );\n\tconst { searchResults, searchHasResolved } = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! search ) {\n\t\t\t\treturn { searchResults: EMPTY_ARRAY, searchHasResolved: true };\n\t\t\t}\n\t\t\tconst { getEntityRecords, hasFinishedResolution } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst selectorArgs = [\n\t\t\t\t'taxonomy',\n\t\t\t\ttaxonomy.slug,\n\t\t\t\t{\n\t\t\t\t\t...BASE_QUERY,\n\t\t\t\t\tsearch,\n\t\t\t\t\torderby: 'name',\n\t\t\t\t\texclude: termIds,\n\t\t\t\t\tper_page: 20,\n\t\t\t\t},\n\t\t\t];\n\t\t\treturn {\n\t\t\t\tsearchResults: getEntityRecords( ...selectorArgs ),\n\t\t\t\tsearchHasResolved: hasFinishedResolution(\n\t\t\t\t\t'getEntityRecords',\n\t\t\t\t\tselectorArgs\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[ search, termIds ]\n\t);\n\t// `existingTerms` are the ones fetched from the API and their type is `{ id: number; name: string }`.\n\t// They are used to extract the terms' names to populate the `FormTokenField` properly\n\t// and to sanitize the provided `termIds`, by setting only the ones that exist.\n\tconst existingTerms = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! termIds?.length ) {\n\t\t\t\treturn EMPTY_ARRAY;\n\t\t\t}\n\t\t\tconst { getEntityRecords } = select( coreStore );\n\t\t\treturn getEntityRecords( 'taxonomy', taxonomy.slug, {\n\t\t\t\t...BASE_QUERY,\n\t\t\t\tinclude: termIds,\n\t\t\t\tper_page: termIds.length,\n\t\t\t} );\n\t\t},\n\t\t[ termIds ]\n\t);\n\t// Update the `value` state only after the selectors are resolved\n\t// to avoid emptying the input when we're changing terms.\n\tuseEffect( () => {\n\t\tif ( ! termIds?.length ) {\n\t\t\tsetValue( EMPTY_ARRAY );\n\t\t}\n\t\tif ( ! existingTerms?.length ) {\n\t\t\treturn;\n\t\t}\n\t\t// Returns only the existing entity ids. This prevents the component\n\t\t// from crashing in the editor, when non existing ids are provided.\n\t\tconst sanitizedValue = termIds.reduce( ( accumulator, id ) => {\n\t\t\tconst entity = existingTerms.find( ( term ) => term.id === id );\n\t\t\tif ( entity ) {\n\t\t\t\taccumulator.push( {\n\t\t\t\t\tid,\n\t\t\t\t\tvalue: entity.name,\n\t\t\t\t} );\n\t\t\t}\n\t\t\treturn accumulator;\n\t\t}, [] );\n\t\tsetValue( sanitizedValue );\n\t}, [ termIds, existingTerms ] );\n\t// Update suggestions only when the query has resolved.\n\tuseEffect( () => {\n\t\tif ( ! searchHasResolved ) {\n\t\t\treturn;\n\t\t}\n\t\tsetSuggestions( searchResults.map( ( result ) => result.name ) );\n\t}, [ searchResults, searchHasResolved ] );\n\tconst onTermsChange = ( newTermValues ) => {\n\t\tconst newTermIds = new Set();\n\t\tfor ( const termValue of newTermValues ) {\n\t\t\tconst termId = getTermIdByTermValue( searchResults, termValue );\n\t\t\tif ( termId ) {\n\t\t\t\tnewTermIds.add( termId );\n\t\t\t}\n\t\t}\n\t\tsetSuggestions( EMPTY_ARRAY );\n\t\tonChange( Array.from( newTermIds ) );\n\t};\n\treturn (\n\t\t<div className=\"block-library-query-inspector__taxonomy-control\">\n\t\t\t<FormTokenField\n\t\t\t\tlabel={ taxonomy.name }\n\t\t\t\tvalue={ value }\n\t\t\t\tonInputChange={ debouncedSearch }\n\t\t\t\tsuggestions={ suggestions }\n\t\t\t\tdisplayTransform={ decodeEntities }\n\t\t\t\tonChange={ onTermsChange }\n\t\t\t\t__experimentalShowHowTo={ false }\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t__next40pxDefaultSize\n\t\t\t/>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAIA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AAKA,IAAAM,MAAA,GAAAN,OAAA;AAA4C,IAAAO,WAAA,GAAAP,OAAA;AAhB5C;AACA;AACA;;AAWA;AACA;AACA;;AAGA,MAAMQ,WAAW,GAAG,EAAE;AACtB,MAAMC,UAAU,GAAG;EAClBC,KAAK,EAAE,KAAK;EACZC,OAAO,EAAE,SAAS;EAClBC,OAAO,EAAE;AACV,CAAC;;AAED;AACA,MAAMC,oBAAoB,GAAGA,CAAEC,KAAK,EAAEC,SAAS,KAAM;EACpD;EACA,MAAMC,MAAM,GACXD,SAAS,EAAEE,EAAE,IAAIH,KAAK,EAAEI,IAAI,CAAIC,IAAI,IAAMA,IAAI,CAACC,IAAI,KAAKL,SAAU,CAAC,EAAEE,EAAE;EACxE,IAAKD,MAAM,EAAG;IACb,OAAOA,MAAM;EACd;;EAEA;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACC,MAAMK,cAAc,GAAGN,SAAS,CAACO,iBAAiB,CAAC,CAAC;EACpD,OAAOR,KAAK,EAAEI,IAAI,CACfC,IAA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IACD;IACAgC,cAAc,CAAExC,WAAY,CAAC;IAC7BgB,QAAQ,CAAEmD,KAAK,CAACC,IAAI,CAAEpC,UAAW,CAAE,CAAC;EACrC,CAAC;EACD,oBACC,IAAAjC,WAAA,CAAAwB,GAAA;IAAK8C,SAAS,EAAC,iDAAiD;IAAA3C,QAAA,eAC/D,IAAA3B,WAAA,CAAAwB,GAAA,EAAChC,WAAA,CAAA+E,cAAc;MACdC,KAAK,EAAG3C,QAAQ,CAAChB,IAAM;MACvByB,KAAK,EAAGA,KAAO;MACfmC,aAAa,EAAG/B,eAAiB;MACjCF,WAAW,EAAGA,WAAa;MAC3BkC,gBAAgB,EAAGC,4BAAgB;MACnC1D,QAAQ,EAAG+C,aAAe;MAC1BY,uBAAuB,EAAG,KAAO;MACjCC,uBAAuB;MACvBC,qBAAqB;IAAA,CACrB;EAAC,CACE,CAAC;AAER","ignoreList":[]}
|
|
@@ -58,11 +58,20 @@ function QueryContent({
|
|
|
58
58
|
} = select(_blockEditor.store);
|
|
59
59
|
const {
|
|
60
60
|
getEntityRecord,
|
|
61
|
+
getEntityRecordEdits,
|
|
61
62
|
canUser
|
|
62
63
|
} = select(_coreData.store);
|
|
63
|
-
const settingPerPage = canUser('read',
|
|
64
|
+
const settingPerPage = canUser('read', {
|
|
65
|
+
kind: 'root',
|
|
66
|
+
name: 'site'
|
|
67
|
+
}) ? +getEntityRecord('root', 'site')?.posts_per_page : +getSettings().postsPerPage;
|
|
68
|
+
|
|
69
|
+
// Gets changes made via the template area posts per page setting. These won't be saved
|
|
70
|
+
// until the page is saved, but we should reflect this setting within the query loops
|
|
71
|
+
// that inherit it.
|
|
72
|
+
const editedSettingPerPage = +getEntityRecordEdits('root', 'site')?.posts_per_page;
|
|
64
73
|
return {
|
|
65
|
-
postsPerPage: settingPerPage || DEFAULTS_POSTS_PER_PAGE
|
|
74
|
+
postsPerPage: editedSettingPerPage || settingPerPage || DEFAULTS_POSTS_PER_PAGE
|
|
66
75
|
};
|
|
67
76
|
}, []);
|
|
68
77
|
// There are some effects running where some initialization logic is
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_compose","_element","_blockEditor","_components","_i18n","_coreData","_queryToolbar","_interopRequireDefault","_inspectorControls","_enhancedPaginationModal","_jsxRuntime","DEFAULTS_POSTS_PER_PAGE","TEMPLATE","QueryContent","attributes","setAttributes","openPatternSelectionModal","name","clientId","queryId","query","displayLayout","tagName","TagName","inherit","__unstableMarkNextChangeAsNotPersistent","useDispatch","blockEditorStore","instanceId","useInstanceId","blockProps","useBlockProps","innerBlocksProps","useInnerBlocksProps","template","postsPerPage","useSelect","select","getSettings","getEntityRecord","canUser","coreStore","settingPerPage","posts_per_page","useEffect","newQuery","perPage","Object","keys","length","updateQuery","Number","isFinite","updateDisplayLayout","newDisplayLayout","htmlElementMessages","main","__","section","aside","jsxs","Fragment","children","jsx","default","InspectorControls","setQuery","setDisplayLayout","BlockControls","group","SelectControl","__nextHasNoMarginBottom","__next40pxDefaultSize","label","options","value","onChange","help"],"sources":["@wordpress/block-library/src/query/edit/query-content.js"],"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';\nimport EnhancedPaginationModal from './enhanced-pagination-modal';\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\n\treturn (\n\t\t<>\n\t\t\t<EnhancedPaginationModal\n\t\t\t\tattributes={ attributes }\n\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\tclientId={ clientId }\n\t\t\t/>\n\t\t\t<InspectorControls>\n\t\t\t\t<QueryInspectorControls\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetQuery={ updateQuery }\n\t\t\t\t\tsetDisplayLayout={ updateDisplayLayout }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\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\t__next40pxDefaultSize\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"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAOA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AAKA,IAAAO,aAAA,GAAAC,sBAAA,CAAAR,OAAA;AACA,IAAAS,kBAAA,GAAAD,sBAAA,CAAAR,OAAA;AACA,IAAAU,wBAAA,GAAAF,sBAAA,CAAAR,OAAA;AAAkE,IAAAW,WAAA,GAAAX,OAAA;AAtBlE;AACA;AACA;;AAeA;AACA;AACA;;AAKA,MAAMY,uBAAuB,GAAG,CAAC;AAEjC,MAAMC,QAAQ,GAAG,CAAE,CAAE,oBAAoB,CAAE,CAAE;AAC9B,SAASC,YAAYA,CAAE;EACrCC,UAAU;EACVC,aAAa;EACbC,yBAAyB;EACzBC,IAAI;EACJC;AACD,CAAC,EAAG;EACH,MAAM;IACLC,OAAO;IACPC,KAAK;IACLC,aAAa;IACbC,OAAO,EAAEC,OAAO,GAAG,KAAK;IACxBH,KAAK,EAAE;MAAEI;IAAQ,CAAC,GAAG,CAAC;EACvB,CAAC,GAAGV,UAAU;EACd,MAAM;IAAEW;E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AC;EAAA,CAClC,CAAC;AAEL","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_data","require","_compose","_element","_blockEditor","_components","_i18n","_coreData","_queryToolbar","_interopRequireDefault","_inspectorControls","_enhancedPaginationModal","_jsxRuntime","DEFAULTS_POSTS_PER_PAGE","TEMPLATE","QueryContent","attributes","setAttributes","openPatternSelectionModal","name","clientId","queryId","query","displayLayout","tagName","TagName","inherit","__unstableMarkNextChangeAsNotPersistent","useDispatch","blockEditorStore","instanceId","useInstanceId","blockProps","useBlockProps","innerBlocksProps","useInnerBlocksProps","template","postsPerPage","useSelect","select","getSettings","getEntityRecord","getEntityRecordEdits","canUser","coreStore","settingPerPage","kind","posts_per_page","editedSettingPerPage","useEffect","newQuery","perPage","Object","keys","length","updateQuery","Number","isFinite","updateDisplayLayout","newDisplayLayout","htmlElementMessages","main","__","section","aside","jsxs","Fragment","children","jsx","default","InspectorControls","setQuery","setDisplayLayout","BlockControls","group","SelectControl","__nextHasNoMarginBottom","__next40pxDefaultSize","label","options","value","onChange","help"],"sources":["@wordpress/block-library/src/query/edit/query-content.js"],"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';\nimport EnhancedPaginationModal from './enhanced-pagination-modal';\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, getEntityRecordEdits, canUser } =\n\t\t\tselect( coreStore );\n\t\tconst settingPerPage = canUser( 'read', {\n\t\t\tkind: 'root',\n\t\t\tname: 'site',\n\t\t} )\n\t\t\t? +getEntityRecord( 'root', 'site' )?.posts_per_page\n\t\t\t: +getSettings().postsPerPage;\n\n\t\t// Gets changes made via the template area posts per page setting. These won't be saved\n\t\t// until the page is saved, but we should reflect this setting within the query loops\n\t\t// that inherit it.\n\t\tconst editedSettingPerPage = +getEntityRecordEdits( 'root', 'site' )\n\t\t\t?.posts_per_page;\n\n\t\treturn {\n\t\t\tpostsPerPage:\n\t\t\t\teditedSettingPerPage ||\n\t\t\t\tsettingPerPage ||\n\t\t\t\tDEFAULTS_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\n\treturn (\n\t\t<>\n\t\t\t<EnhancedPaginationModal\n\t\t\t\tattributes={ attributes }\n\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\tclientId={ clientId }\n\t\t\t/>\n\t\t\t<InspectorControls>\n\t\t\t\t<QueryInspectorControls\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetQuery={ updateQuery }\n\t\t\t\t\tsetDisplayLayout={ updateDisplayLayout }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\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\t__next40pxDefaultSize\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"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAOA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AAKA,IAAAO,aAAA,GAAAC,sBAAA,CAAAR,OAAA;AACA,IAAAS,kBAAA,GAAAD,sBAAA,CAAAR,OAAA;AACA,IAAAU,wBAAA,GAAAF,sBAAA,CAAAR,OAAA;AAAkE,IAAAW,WAAA,GAAAX,OAAA;AAtBlE;AACA;AACA;;AAeA;AACA;AACA;;AAKA,MAAMY,uBAAuB,GAAG,CAAC;AAEjC,MAAMC,QAAQ,GAAG,CAAE,CAAE,oBAAoB,CAAE,CAAE;AAC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,EAChD;UAAEF,KAAK,EAAE,QAAQ;UAAEE,KAAK,EAAE;QAAO,CAAC,EAClC;UAAEF,KAAK,EAAE,WAAW;UAAEE,KAAK,EAAE;QAAU,CAAC,EACxC;UAAEF,KAAK,EAAE,SAAS;UAAEE,KAAK,EAAE;QAAQ,CAAC,CAClC;QACHA,KAAK,EAAGvD,OAAS;QACjBwD,QAAQ,EAAKD,KAAK,IACjB/D,aAAa,CAAE;UAAEO,OAAO,EAAEwD;QAAM,CAAE,CAClC;QACDE,IAAI,EAAGtB,mBAAmB,CAAEnC,OAAO;MAAI,CACvC;IAAC,CACgB,CAAC,eACpB,IAAAb,WAAA,CAAAwD,GAAA,EAAC3C,OAAO;MAAA,GAAMS;IAAgB,CAAI,CAAC;EAAA,CAClC,CAAC;AAEL","ignoreList":[]}
|
|
@@ -24,8 +24,7 @@ function QueryPlaceholder({
|
|
|
24
24
|
attributes,
|
|
25
25
|
clientId,
|
|
26
26
|
name,
|
|
27
|
-
openPatternSelectionModal
|
|
28
|
-
setAttributes
|
|
27
|
+
openPatternSelectionModal
|
|
29
28
|
}) {
|
|
30
29
|
const [isStartingBlank, setIsStartingBlank] = (0, _element.useState)(false);
|
|
31
30
|
const blockProps = (0, _blockEditor.useBlockProps)();
|
|
@@ -56,7 +55,6 @@ function QueryPlaceholder({
|
|
|
56
55
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(QueryVariationPicker, {
|
|
57
56
|
clientId: clientId,
|
|
58
57
|
attributes: attributes,
|
|
59
|
-
setAttributes: setAttributes,
|
|
60
58
|
icon: icon,
|
|
61
59
|
label: label
|
|
62
60
|
});
|
|
@@ -84,7 +82,6 @@ function QueryPlaceholder({
|
|
|
84
82
|
function QueryVariationPicker({
|
|
85
83
|
clientId,
|
|
86
84
|
attributes,
|
|
87
|
-
setAttributes,
|
|
88
85
|
icon,
|
|
89
86
|
label
|
|
90
87
|
}) {
|
|
@@ -100,16 +97,6 @@ function QueryVariationPicker({
|
|
|
100
97
|
label: label,
|
|
101
98
|
variations: scopeVariations,
|
|
102
99
|
onSelect: variation => {
|
|
103
|
-
if (variation.attributes) {
|
|
104
|
-
setAttributes({
|
|
105
|
-
...variation.attributes,
|
|
106
|
-
query: {
|
|
107
|
-
...variation.attributes.query,
|
|
108
|
-
postType: attributes.query.postType || variation.attributes.query.postType
|
|
109
|
-
},
|
|
110
|
-
namespace: attributes.namespace
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
100
|
if (variation.innerBlocks) {
|
|
114
101
|
replaceInnerBlocks(clientId, (0, _blocks.createBlocksFromInnerBlocksTemplate)(variation.innerBlocks), false);
|
|
115
102
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_blocks","_element","_blockEditor","_components","_i18n","_utils","_jsxRuntime","QueryPlaceholder","attributes","clientId","name","openPatternSelectionModal","
|
|
1
|
+
{"version":3,"names":["_data","require","_blocks","_element","_blockEditor","_components","_i18n","_utils","_jsxRuntime","QueryPlaceholder","attributes","clientId","name","openPatternSelectionModal","isStartingBlank","setIsStartingBlank","useState","blockProps","useBlockProps","blockNameForPatterns","useBlockNameForPatterns","blockType","activeBlockVariation","hasPatterns","useSelect","select","getActiveBlockVariation","getBlockType","blocksStore","getBlockRootClientId","getPatternsByBlockTypes","blockEditorStore","rootClientId","length","icon","src","label","title","jsx","QueryVariationPicker","children","jsxs","Placeholder","instructions","__","Button","variant","onClick","scopeVariations","useScopedBlockVariations","replaceInnerBlocks","useDispatch","__experimentalBlockVariationPicker","variations","onSelect","variation","innerBlocks","createBlocksFromInnerBlocksTemplate"],"sources":["@wordpress/block-library/src/query/edit/query-placeholder.js"],"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} 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} ) {\n\tconst [ isStartingBlank, setIsStartingBlank ] = useState( false );\n\tconst blockProps = useBlockProps();\n\tconst blockNameForPatterns = useBlockNameForPatterns(\n\t\tclientId,\n\t\tattributes\n\t);\n\tconst { blockType, activeBlockVariation, hasPatterns } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getActiveBlockVariation, getBlockType } =\n\t\t\t\tselect( 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\tactiveBlockVariation: getActiveBlockVariation(\n\t\t\t\t\tname,\n\t\t\t\t\tattributes\n\t\t\t\t),\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, attributes ]\n\t);\n\tconst icon =\n\t\tactiveBlockVariation?.icon?.src ||\n\t\tactiveBlockVariation?.icon ||\n\t\tblockType?.icon?.src;\n\tconst label = activeBlockVariation?.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\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( { clientId, attributes, icon, label } ) {\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.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"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAIA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAKA,IAAAI,WAAA,GAAAJ,OAAA;AACA,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