@wordpress/block-library 10.1.0 → 10.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/build/accordion/block.json +1 -0
- package/build/accordion/edit.cjs +0 -1
- package/build/accordion/edit.cjs.map +2 -2
- package/build/accordion/view.cjs +23 -0
- package/build/accordion/view.cjs.map +2 -2
- package/build/accordion-heading/deprecated.cjs +121 -1
- package/build/accordion-heading/deprecated.cjs.map +2 -2
- package/build/accordion-heading/edit.cjs +18 -1
- package/build/accordion-heading/edit.cjs.map +3 -3
- package/build/accordion-heading/save.cjs +18 -1
- package/build/accordion-heading/save.cjs.map +3 -3
- package/build/accordion-panel/edit.cjs +1 -1
- package/build/accordion-panel/edit.cjs.map +2 -2
- package/build/archives/edit.cjs +0 -1
- package/build/archives/edit.cjs.map +2 -2
- package/build/audio/edit.cjs +0 -1
- package/build/audio/edit.cjs.map +2 -2
- package/build/avatar/edit.cjs +0 -1
- package/build/avatar/edit.cjs.map +2 -2
- package/build/avatar/user-control.cjs +0 -1
- package/build/avatar/user-control.cjs.map +2 -2
- package/build/button/edit.cjs +18 -8
- package/build/button/edit.cjs.map +2 -2
- package/build/categories/edit.cjs +0 -1
- package/build/categories/edit.cjs.map +2 -2
- package/build/code/transforms.cjs +5 -3
- package/build/code/transforms.cjs.map +2 -2
- package/build/column/edit.cjs +0 -1
- package/build/column/edit.cjs.map +2 -2
- package/build/columns/edit.cjs +0 -1
- package/build/columns/edit.cjs.map +2 -2
- package/build/columns/transforms.cjs +9 -2
- package/build/columns/transforms.cjs.map +2 -2
- package/build/comment-author-avatar/edit.cjs +0 -1
- package/build/comment-author-avatar/edit.cjs.map +2 -2
- package/build/comments-pagination/comments-pagination-arrow-controls.cjs +0 -1
- package/build/comments-pagination/comments-pagination-arrow-controls.cjs.map +2 -2
- package/build/cover/block.json +11 -0
- package/build/cover/edit/block-controls.cjs +11 -4
- package/build/cover/edit/block-controls.cjs.map +2 -2
- package/build/cover/edit/embed-video-url-input.cjs +5 -3
- package/build/cover/edit/embed-video-url-input.cjs.map +3 -3
- package/build/cover/edit/index.cjs +1 -1
- package/build/cover/edit/index.cjs.map +2 -2
- package/build/cover/edit/inspector-controls.cjs +1 -3
- package/build/cover/edit/inspector-controls.cjs.map +2 -2
- package/build/cover/embed-video-utils.cjs +17 -7
- package/build/cover/embed-video-utils.cjs.map +2 -2
- package/build/details/transforms.cjs +1 -1
- package/build/details/transforms.cjs.map +2 -2
- package/build/embed/edit.cjs +2 -3
- package/build/embed/edit.cjs.map +2 -2
- package/build/embed/embed-placeholder.cjs +20 -21
- package/build/embed/embed-placeholder.cjs.map +3 -3
- package/build/file/edit.cjs +4 -3
- package/build/file/edit.cjs.map +2 -2
- package/build/file/inspector.cjs +0 -2
- package/build/file/inspector.cjs.map +2 -2
- package/build/file/transforms.cjs +25 -60
- package/build/file/transforms.cjs.map +2 -2
- package/build/form/edit.cjs +0 -2
- package/build/form/edit.cjs.map +2 -2
- package/build/freeform/convert-to-blocks-button.cjs +52 -0
- package/build/freeform/convert-to-blocks-button.cjs.map +7 -0
- package/build/freeform/edit.cjs +14 -33
- package/build/freeform/edit.cjs.map +3 -3
- package/build/freeform/index.cjs +1 -7
- package/build/freeform/index.cjs.map +3 -3
- package/build/gallery/block.json +8 -3
- package/build/gallery/dynamic-gallery.cjs +263 -0
- package/build/gallery/dynamic-gallery.cjs.map +7 -0
- package/build/gallery/dynamic-source.cjs +85 -0
- package/build/gallery/dynamic-source.cjs.map +7 -0
- package/build/gallery/edit.cjs +286 -206
- package/build/gallery/edit.cjs.map +3 -3
- package/build/gallery/gallery.cjs +0 -3
- package/build/gallery/gallery.cjs.map +2 -2
- package/build/gallery/gap-styles.cjs +49 -13
- package/build/gallery/gap-styles.cjs.map +3 -3
- package/build/gallery/index.cjs +2 -0
- package/build/gallery/index.cjs.map +3 -3
- package/build/gallery/save.cjs +16 -12
- package/build/gallery/save.cjs.map +2 -2
- package/build/gallery/use-dynamic-gallery.cjs +181 -0
- package/build/gallery/use-dynamic-gallery.cjs.map +7 -0
- package/build/gallery/variations.cjs +54 -0
- package/build/gallery/variations.cjs.map +7 -0
- package/build/group/edit.cjs +1 -2
- package/build/group/edit.cjs.map +2 -2
- package/build/group/transforms.cjs +3 -7
- package/build/group/transforms.cjs.map +2 -2
- package/build/heading/edit.cjs +10 -3
- package/build/heading/edit.cjs.map +2 -2
- package/build/html/block.json +2 -2
- package/build/html/edit.cjs +65 -23
- package/build/html/edit.cjs.map +3 -3
- package/build/html/index.cjs +3 -3
- package/build/html/index.cjs.map +2 -2
- package/build/html/modal.cjs +4 -8
- package/build/html/modal.cjs.map +2 -2
- package/build/html/save.cjs +2 -4
- package/build/html/save.cjs.map +2 -2
- package/build/html/transforms.cjs +7 -5
- package/build/html/transforms.cjs.map +2 -2
- package/build/icon/components/custom-inserter/icon-grid.cjs +25 -12
- package/build/icon/components/custom-inserter/icon-grid.cjs.map +2 -2
- package/build/icon/components/custom-inserter/index.cjs +100 -31
- package/build/icon/components/custom-inserter/index.cjs.map +3 -3
- package/build/icon/edit.cjs +11 -12
- package/build/icon/edit.cjs.map +2 -2
- package/build/image/block.json +1 -1
- package/build/image/image.cjs +23 -70
- package/build/image/image.cjs.map +3 -3
- package/build/image/transforms.cjs +78 -0
- package/build/image/transforms.cjs.map +3 -3
- package/build/index.cjs +18 -8
- package/build/index.cjs.map +2 -2
- package/build/latest-comments/edit.cjs +0 -2
- package/build/latest-comments/edit.cjs.map +2 -2
- package/build/latest-posts/block.json +8 -9
- package/build/latest-posts/constants.cjs +0 -3
- package/build/latest-posts/constants.cjs.map +2 -2
- package/build/latest-posts/deprecated.cjs +100 -8
- package/build/latest-posts/deprecated.cjs.map +2 -2
- package/build/latest-posts/edit.cjs +67 -84
- package/build/latest-posts/edit.cjs.map +2 -2
- package/build/list/ordered-list-settings.cjs +0 -1
- package/build/list/ordered-list-settings.cjs.map +2 -2
- package/build/list-item/edit.cjs +1 -1
- package/build/list-item/edit.cjs.map +2 -2
- package/build/list-item/hooks/use-enter.cjs +14 -17
- package/build/list-item/hooks/use-enter.cjs.map +3 -3
- package/build/list-item/hooks/use-space.cjs +3 -2
- package/build/list-item/hooks/use-space.cjs.map +3 -3
- package/build/media-text/edit.cjs +0 -1
- package/build/media-text/edit.cjs.map +2 -2
- package/build/missing/edit.cjs +1 -3
- package/build/missing/edit.cjs.map +2 -2
- package/build/navigation/edit/index.cjs +0 -1
- package/build/navigation/edit/index.cjs.map +2 -2
- package/build/navigation/edit/overlay-menu-preview-controls.cjs +0 -1
- package/build/navigation/edit/overlay-menu-preview-controls.cjs.map +2 -2
- package/build/navigation/edit/overlay-menu-preview.cjs +0 -1
- package/build/navigation/edit/overlay-menu-preview.cjs.map +2 -2
- package/build/navigation/edit/overlay-template-part-selector.cjs +0 -1
- package/build/navigation/edit/overlay-template-part-selector.cjs.map +2 -2
- package/build/navigation/edit/overlay-visibility-control.cjs +0 -1
- package/build/navigation/edit/overlay-visibility-control.cjs.map +2 -2
- package/build/navigation-link/shared/use-link-preview.cjs +11 -1
- package/build/navigation-link/shared/use-link-preview.cjs.map +2 -2
- package/build/navigation-overlay-close/edit.cjs +0 -1
- package/build/navigation-overlay-close/edit.cjs.map +2 -2
- package/build/page-list/edit.cjs +0 -1
- package/build/page-list/edit.cjs.map +2 -2
- package/build/paragraph/block.json +1 -0
- package/build/paragraph/use-enter.cjs +3 -7
- package/build/paragraph/use-enter.cjs.map +3 -3
- package/build/playlist/block.json +28 -15
- package/build/playlist/context.cjs +36 -0
- package/build/playlist/context.cjs.map +7 -0
- package/build/playlist/edit.cjs +257 -81
- package/build/playlist/edit.cjs.map +3 -3
- package/build/playlist/index.cjs +1 -1
- package/build/playlist/index.cjs.map +2 -2
- package/build/playlist/utils.cjs +19 -8
- package/build/playlist/utils.cjs.map +3 -3
- package/build/playlist/view.cjs +87 -17
- package/build/playlist/view.cjs.map +2 -2
- package/build/playlist-track/block.json +4 -5
- package/build/playlist-track/edit.cjs +114 -70
- package/build/playlist-track/edit.cjs.map +3 -3
- package/build/post-author/edit.cjs +0 -2
- package/build/post-author/edit.cjs.map +2 -2
- package/build/post-content/block.json +1 -0
- package/build/post-excerpt/edit.cjs +0 -1
- package/build/post-excerpt/edit.cjs.map +2 -2
- package/build/post-featured-image/overlay-controls.cjs +1 -2
- package/build/post-featured-image/overlay-controls.cjs.map +2 -2
- package/build/post-navigation-link/edit.cjs +0 -2
- package/build/post-navigation-link/edit.cjs.map +2 -2
- package/build/post-template/block.json +2 -1
- package/build/post-template/edit.cjs +10 -1
- package/build/post-template/edit.cjs.map +2 -2
- package/build/pullquote/block.json +3 -1
- package/build/query/block.json +3 -2
- package/build/query/edit/inspector-controls/author-control.cjs +1 -2
- package/build/query/edit/inspector-controls/author-control.cjs.map +2 -2
- package/build/query/edit/inspector-controls/format-controls.cjs +1 -2
- package/build/query/edit/inspector-controls/format-controls.cjs.map +2 -2
- package/build/query/edit/inspector-controls/index.cjs +38 -7
- package/build/query/edit/inspector-controls/index.cjs.map +2 -2
- package/build/query/edit/inspector-controls/offset-controls.cjs +0 -1
- package/build/query/edit/inspector-controls/offset-controls.cjs.map +2 -2
- package/build/query/edit/inspector-controls/order-control.cjs +0 -1
- package/build/query/edit/inspector-controls/order-control.cjs.map +2 -2
- package/build/query/edit/inspector-controls/pages-control.cjs +0 -1
- package/build/query/edit/inspector-controls/pages-control.cjs.map +2 -2
- package/build/query/edit/inspector-controls/parent-control.cjs +0 -1
- package/build/query/edit/inspector-controls/parent-control.cjs.map +2 -2
- package/build/query/edit/inspector-controls/per-page-control.cjs +0 -1
- package/build/query/edit/inspector-controls/per-page-control.cjs.map +2 -2
- package/build/query/edit/inspector-controls/sticky-control.cjs +0 -1
- package/build/query/edit/inspector-controls/sticky-control.cjs.map +2 -2
- package/build/query/edit/inspector-controls/taxonomy-controls.cjs +1 -2
- package/build/query/edit/inspector-controls/taxonomy-controls.cjs.map +2 -2
- package/build/query/edit/query-content.cjs +10 -3
- package/build/query/edit/query-content.cjs.map +2 -2
- package/build/query/index.cjs +2 -1
- package/build/query/index.cjs.map +2 -2
- package/build/query-pagination/query-pagination-arrow-controls.cjs +0 -1
- package/build/query-pagination/query-pagination-arrow-controls.cjs.map +2 -2
- package/build/query-pagination-numbers/edit.cjs +0 -1
- package/build/query-pagination-numbers/edit.cjs.map +2 -2
- package/build/quote/block.json +3 -1
- package/build/quote/transforms.cjs +1 -7
- package/build/quote/transforms.cjs.map +2 -2
- package/build/rss/edit.cjs +0 -4
- package/build/rss/edit.cjs.map +2 -2
- package/build/search/edit.cjs +0 -4
- package/build/search/edit.cjs.map +2 -2
- package/build/separator/edit.cjs +1 -2
- package/build/separator/edit.cjs.map +2 -2
- package/build/site-logo/edit.cjs +34 -63
- package/build/site-logo/edit.cjs.map +3 -3
- package/build/social-links/edit.cjs +0 -1
- package/build/social-links/edit.cjs.map +2 -2
- package/build/spacer/controls.cjs +2 -4
- package/build/spacer/controls.cjs.map +2 -2
- package/build/spacer/edit.cjs +1 -2
- package/build/spacer/edit.cjs.map +2 -2
- package/build/tab-list/block.json +5 -4
- package/build/tab-list/edit.cjs +95 -54
- package/build/tab-list/edit.cjs.map +3 -3
- package/build/tab-list/save.cjs +4 -3
- package/build/tab-list/save.cjs.map +2 -2
- package/build/tab-panel/block.json +1 -6
- package/build/tab-panel/controls.cjs +2 -4
- package/build/tab-panel/controls.cjs.map +3 -3
- package/build/tab-panel/edit.cjs +15 -15
- package/build/tab-panel/edit.cjs.map +2 -2
- package/build/tab-panels/block.json +0 -1
- package/build/tab-panels/edit.cjs +2 -4
- package/build/tab-panels/edit.cjs.map +3 -3
- package/build/table-of-contents/edit.cjs +0 -1
- package/build/table-of-contents/edit.cjs.map +2 -2
- package/build/tabs/block.json +0 -5
- package/build/tabs/edit.cjs +6 -41
- package/build/tabs/edit.cjs.map +3 -3
- package/build/tabs/tab-toolbar-controls.cjs +74 -0
- package/build/tabs/tab-toolbar-controls.cjs.map +7 -0
- package/build/tabs/use-tab-actions.cjs +87 -0
- package/build/tabs/use-tab-actions.cjs.map +7 -0
- package/build/tabs/use-tab-list-items-sync.cjs +23 -5
- package/build/tabs/use-tab-list-items-sync.cjs.map +2 -2
- package/build/tag-cloud/edit.cjs +2 -6
- package/build/tag-cloud/edit.cjs.map +2 -2
- package/build/template-part/edit/advanced-controls.cjs +0 -1
- package/build/template-part/edit/advanced-controls.cjs.map +2 -2
- package/build/template-part/edit/import-controls.cjs +1 -2
- package/build/template-part/edit/import-controls.cjs.map +2 -2
- package/build/term-name/block.json +1 -3
- package/build/term-name/deprecated.cjs +105 -0
- package/build/term-name/deprecated.cjs.map +7 -0
- package/build/term-name/edit.cjs +11 -37
- package/build/term-name/edit.cjs.map +3 -3
- package/build/term-name/index.cjs +3 -1
- package/build/term-name/index.cjs.map +3 -3
- package/build/terms-query/edit/inspector-controls/include-control.cjs +0 -1
- package/build/terms-query/edit/inspector-controls/include-control.cjs.map +2 -2
- package/build/terms-query/edit/inspector-controls/inherit-control.cjs +0 -1
- package/build/terms-query/edit/inspector-controls/inherit-control.cjs.map +2 -2
- package/build/terms-query/edit/inspector-controls/max-terms-control.cjs +0 -1
- package/build/terms-query/edit/inspector-controls/max-terms-control.cjs.map +2 -2
- package/build/terms-query/edit/inspector-controls/order-control.cjs +0 -1
- package/build/terms-query/edit/inspector-controls/order-control.cjs.map +2 -2
- package/build/terms-query/edit/inspector-controls/taxonomy-control.cjs +0 -1
- package/build/terms-query/edit/inspector-controls/taxonomy-control.cjs.map +2 -2
- package/build/text-columns/edit.cjs +0 -1
- package/build/text-columns/edit.cjs.map +2 -2
- package/build/utils/waveform-player.cjs +138 -22
- package/build/utils/waveform-player.cjs.map +2 -2
- package/build/utils/waveform-utils.cjs +315 -17
- package/build/utils/waveform-utils.cjs.map +2 -2
- package/build/verse/block.json +3 -1
- package/build/video/block.json +6 -0
- package/build/video/edit-common-settings.cjs +0 -1
- package/build/video/edit-common-settings.cjs.map +2 -2
- package/build/video/edit.cjs +17 -1
- package/build/video/edit.cjs.map +2 -2
- package/build/video/index.cjs +2 -0
- package/build/video/index.cjs.map +3 -3
- package/build/video/save.cjs +7 -1
- package/build/video/save.cjs.map +2 -2
- package/build/video/tracks-editor.cjs +0 -1
- package/build/video/tracks-editor.cjs.map +2 -2
- package/build/video/variations.cjs +75 -0
- package/build/video/variations.cjs.map +7 -0
- package/build-module/accordion/block.json +1 -0
- package/build-module/accordion/edit.mjs +0 -1
- package/build-module/accordion/edit.mjs.map +2 -2
- package/build-module/accordion/view.mjs +23 -0
- package/build-module/accordion/view.mjs.map +2 -2
- package/build-module/accordion-heading/deprecated.mjs +121 -1
- package/build-module/accordion-heading/deprecated.mjs.map +2 -2
- package/build-module/accordion-heading/edit.mjs +8 -1
- package/build-module/accordion-heading/edit.mjs.map +2 -2
- package/build-module/accordion-heading/save.mjs +8 -1
- package/build-module/accordion-heading/save.mjs.map +2 -2
- package/build-module/accordion-panel/edit.mjs +1 -1
- package/build-module/accordion-panel/edit.mjs.map +2 -2
- package/build-module/archives/edit.mjs +0 -1
- package/build-module/archives/edit.mjs.map +2 -2
- package/build-module/audio/edit.mjs +0 -1
- package/build-module/audio/edit.mjs.map +2 -2
- package/build-module/avatar/edit.mjs +0 -1
- package/build-module/avatar/edit.mjs.map +2 -2
- package/build-module/avatar/user-control.mjs +0 -1
- package/build-module/avatar/user-control.mjs.map +2 -2
- package/build-module/button/edit.mjs +19 -14
- package/build-module/button/edit.mjs.map +2 -2
- package/build-module/categories/edit.mjs +0 -1
- package/build-module/categories/edit.mjs.map +2 -2
- package/build-module/code/transforms.mjs +6 -4
- package/build-module/code/transforms.mjs.map +2 -2
- package/build-module/column/edit.mjs +0 -1
- package/build-module/column/edit.mjs.map +2 -2
- package/build-module/columns/edit.mjs +0 -1
- package/build-module/columns/edit.mjs.map +2 -2
- package/build-module/columns/transforms.mjs +9 -2
- package/build-module/columns/transforms.mjs.map +2 -2
- package/build-module/comment-author-avatar/edit.mjs +0 -1
- package/build-module/comment-author-avatar/edit.mjs.map +2 -2
- package/build-module/comments-pagination/comments-pagination-arrow-controls.mjs +0 -1
- package/build-module/comments-pagination/comments-pagination-arrow-controls.mjs.map +2 -2
- package/build-module/cover/block.json +11 -0
- package/build-module/cover/edit/block-controls.mjs +11 -4
- package/build-module/cover/edit/block-controls.mjs.map +2 -2
- package/build-module/cover/edit/embed-video-url-input.mjs +5 -4
- package/build-module/cover/edit/embed-video-url-input.mjs.map +2 -2
- package/build-module/cover/edit/index.mjs +1 -1
- package/build-module/cover/edit/index.mjs.map +2 -2
- package/build-module/cover/edit/inspector-controls.mjs +1 -3
- package/build-module/cover/edit/inspector-controls.mjs.map +2 -2
- package/build-module/cover/embed-video-utils.mjs +16 -7
- package/build-module/cover/embed-video-utils.mjs.map +2 -2
- package/build-module/details/transforms.mjs +2 -2
- package/build-module/details/transforms.mjs.map +2 -2
- package/build-module/embed/edit.mjs +2 -3
- package/build-module/embed/edit.mjs.map +2 -2
- package/build-module/embed/embed-placeholder.mjs +20 -24
- package/build-module/embed/embed-placeholder.mjs.map +2 -2
- package/build-module/file/edit.mjs +4 -3
- package/build-module/file/edit.mjs.map +2 -2
- package/build-module/file/inspector.mjs +0 -2
- package/build-module/file/inspector.mjs.map +2 -2
- package/build-module/file/transforms.mjs +25 -60
- package/build-module/file/transforms.mjs.map +2 -2
- package/build-module/form/edit.mjs +0 -2
- package/build-module/form/edit.mjs.map +2 -2
- package/build-module/freeform/convert-to-blocks-button.mjs +31 -0
- package/build-module/freeform/convert-to-blocks-button.mjs.map +7 -0
- package/build-module/freeform/edit.mjs +15 -34
- package/build-module/freeform/edit.mjs.map +2 -2
- package/build-module/freeform/index.mjs +1 -7
- package/build-module/freeform/index.mjs.map +2 -2
- package/build-module/gallery/block.json +8 -3
- package/build-module/gallery/dynamic-gallery.mjs +253 -0
- package/build-module/gallery/dynamic-gallery.mjs.map +7 -0
- package/build-module/gallery/dynamic-source.mjs +55 -0
- package/build-module/gallery/dynamic-source.mjs.map +7 -0
- package/build-module/gallery/edit.mjs +291 -209
- package/build-module/gallery/edit.mjs.map +2 -2
- package/build-module/gallery/gallery.mjs +0 -3
- package/build-module/gallery/gallery.mjs.map +2 -2
- package/build-module/gallery/gap-styles.mjs +53 -14
- package/build-module/gallery/gap-styles.mjs.map +2 -2
- package/build-module/gallery/index.mjs +2 -0
- package/build-module/gallery/index.mjs.map +2 -2
- package/build-module/gallery/save.mjs +16 -12
- package/build-module/gallery/save.mjs.map +2 -2
- package/build-module/gallery/use-dynamic-gallery.mjs +167 -0
- package/build-module/gallery/use-dynamic-gallery.mjs.map +7 -0
- package/build-module/gallery/variations.mjs +33 -0
- package/build-module/gallery/variations.mjs.map +7 -0
- package/build-module/group/edit.mjs +1 -2
- package/build-module/group/edit.mjs.map +2 -2
- package/build-module/group/transforms.mjs +4 -8
- package/build-module/group/transforms.mjs.map +2 -2
- package/build-module/heading/edit.mjs +11 -4
- package/build-module/heading/edit.mjs.map +2 -2
- package/build-module/html/block.json +2 -2
- package/build-module/html/edit.mjs +69 -25
- package/build-module/html/edit.mjs.map +2 -2
- package/build-module/html/index.mjs +3 -3
- package/build-module/html/index.mjs.map +2 -2
- package/build-module/html/modal.mjs +4 -8
- package/build-module/html/modal.mjs.map +2 -2
- package/build-module/html/save.mjs +2 -4
- package/build-module/html/save.mjs.map +2 -2
- package/build-module/html/transforms.mjs +8 -6
- package/build-module/html/transforms.mjs.map +2 -2
- package/build-module/icon/components/custom-inserter/icon-grid.mjs +25 -12
- package/build-module/icon/components/custom-inserter/icon-grid.mjs.map +2 -2
- package/build-module/icon/components/custom-inserter/index.mjs +102 -33
- package/build-module/icon/components/custom-inserter/index.mjs.map +2 -2
- package/build-module/icon/edit.mjs +11 -12
- package/build-module/icon/edit.mjs.map +2 -2
- package/build-module/image/block.json +1 -1
- package/build-module/image/image.mjs +23 -71
- package/build-module/image/image.mjs.map +2 -2
- package/build-module/image/transforms.mjs +78 -0
- package/build-module/image/transforms.mjs.map +2 -2
- package/build-module/index.mjs +18 -8
- package/build-module/index.mjs.map +2 -2
- package/build-module/latest-comments/edit.mjs +0 -2
- package/build-module/latest-comments/edit.mjs.map +2 -2
- package/build-module/latest-posts/block.json +8 -9
- package/build-module/latest-posts/constants.mjs +0 -2
- package/build-module/latest-posts/constants.mjs.map +2 -2
- package/build-module/latest-posts/deprecated.mjs +100 -8
- package/build-module/latest-posts/deprecated.mjs.map +2 -2
- package/build-module/latest-posts/edit.mjs +67 -85
- package/build-module/latest-posts/edit.mjs.map +2 -2
- package/build-module/list/ordered-list-settings.mjs +0 -1
- package/build-module/list/ordered-list-settings.mjs.map +2 -2
- package/build-module/list-item/edit.mjs +1 -1
- package/build-module/list-item/edit.mjs.map +2 -2
- package/build-module/list-item/hooks/use-enter.mjs +15 -21
- package/build-module/list-item/hooks/use-enter.mjs.map +2 -2
- package/build-module/list-item/hooks/use-space.mjs +4 -6
- package/build-module/list-item/hooks/use-space.mjs.map +2 -2
- package/build-module/media-text/edit.mjs +0 -1
- package/build-module/media-text/edit.mjs.map +2 -2
- package/build-module/missing/edit.mjs +1 -3
- package/build-module/missing/edit.mjs.map +2 -2
- package/build-module/navigation/edit/index.mjs +0 -1
- package/build-module/navigation/edit/index.mjs.map +2 -2
- package/build-module/navigation/edit/overlay-menu-preview-controls.mjs +0 -1
- package/build-module/navigation/edit/overlay-menu-preview-controls.mjs.map +2 -2
- package/build-module/navigation/edit/overlay-menu-preview.mjs +0 -1
- package/build-module/navigation/edit/overlay-menu-preview.mjs.map +2 -2
- package/build-module/navigation/edit/overlay-template-part-selector.mjs +0 -1
- package/build-module/navigation/edit/overlay-template-part-selector.mjs.map +2 -2
- package/build-module/navigation/edit/overlay-visibility-control.mjs +0 -1
- package/build-module/navigation/edit/overlay-visibility-control.mjs.map +2 -2
- package/build-module/navigation-link/shared/use-link-preview.mjs +11 -1
- package/build-module/navigation-link/shared/use-link-preview.mjs.map +2 -2
- package/build-module/navigation-overlay-close/edit.mjs +0 -1
- package/build-module/navigation-overlay-close/edit.mjs.map +2 -2
- package/build-module/page-list/edit.mjs +0 -1
- package/build-module/page-list/edit.mjs.map +2 -2
- package/build-module/paragraph/block.json +1 -0
- package/build-module/paragraph/use-enter.mjs +4 -11
- package/build-module/paragraph/use-enter.mjs.map +2 -2
- package/build-module/playlist/block.json +28 -15
- package/build-module/playlist/context.mjs +11 -0
- package/build-module/playlist/context.mjs.map +7 -0
- package/build-module/playlist/edit.mjs +262 -84
- package/build-module/playlist/edit.mjs.map +2 -2
- package/build-module/playlist/index.mjs +1 -1
- package/build-module/playlist/index.mjs.map +2 -2
- package/build-module/playlist/utils.mjs +17 -7
- package/build-module/playlist/utils.mjs.map +2 -2
- package/build-module/playlist/view.mjs +93 -18
- package/build-module/playlist/view.mjs.map +2 -2
- package/build-module/playlist-track/block.json +4 -5
- package/build-module/playlist-track/edit.mjs +117 -72
- package/build-module/playlist-track/edit.mjs.map +2 -2
- package/build-module/post-author/edit.mjs +0 -2
- package/build-module/post-author/edit.mjs.map +2 -2
- package/build-module/post-content/block.json +1 -0
- package/build-module/post-excerpt/edit.mjs +0 -1
- package/build-module/post-excerpt/edit.mjs.map +2 -2
- package/build-module/post-featured-image/overlay-controls.mjs +1 -2
- package/build-module/post-featured-image/overlay-controls.mjs.map +2 -2
- package/build-module/post-navigation-link/edit.mjs +0 -2
- package/build-module/post-navigation-link/edit.mjs.map +2 -2
- package/build-module/post-template/block.json +2 -1
- package/build-module/post-template/edit.mjs +10 -1
- package/build-module/post-template/edit.mjs.map +2 -2
- package/build-module/pullquote/block.json +3 -1
- package/build-module/query/block.json +3 -2
- package/build-module/query/edit/inspector-controls/author-control.mjs +1 -2
- package/build-module/query/edit/inspector-controls/author-control.mjs.map +2 -2
- package/build-module/query/edit/inspector-controls/format-controls.mjs +1 -2
- package/build-module/query/edit/inspector-controls/format-controls.mjs.map +2 -2
- package/build-module/query/edit/inspector-controls/index.mjs +40 -8
- package/build-module/query/edit/inspector-controls/index.mjs.map +2 -2
- package/build-module/query/edit/inspector-controls/offset-controls.mjs +0 -1
- package/build-module/query/edit/inspector-controls/offset-controls.mjs.map +2 -2
- package/build-module/query/edit/inspector-controls/order-control.mjs +0 -1
- package/build-module/query/edit/inspector-controls/order-control.mjs.map +2 -2
- package/build-module/query/edit/inspector-controls/pages-control.mjs +0 -1
- package/build-module/query/edit/inspector-controls/pages-control.mjs.map +2 -2
- package/build-module/query/edit/inspector-controls/parent-control.mjs +0 -1
- package/build-module/query/edit/inspector-controls/parent-control.mjs.map +2 -2
- package/build-module/query/edit/inspector-controls/per-page-control.mjs +0 -1
- package/build-module/query/edit/inspector-controls/per-page-control.mjs.map +2 -2
- package/build-module/query/edit/inspector-controls/sticky-control.mjs +0 -1
- package/build-module/query/edit/inspector-controls/sticky-control.mjs.map +2 -2
- package/build-module/query/edit/inspector-controls/taxonomy-controls.mjs +1 -2
- package/build-module/query/edit/inspector-controls/taxonomy-controls.mjs.map +2 -2
- package/build-module/query/edit/query-content.mjs +10 -3
- package/build-module/query/edit/query-content.mjs.map +2 -2
- package/build-module/query/index.mjs +2 -1
- package/build-module/query/index.mjs.map +2 -2
- package/build-module/query-pagination/query-pagination-arrow-controls.mjs +0 -1
- package/build-module/query-pagination/query-pagination-arrow-controls.mjs.map +2 -2
- package/build-module/query-pagination-numbers/edit.mjs +0 -1
- package/build-module/query-pagination-numbers/edit.mjs.map +2 -2
- package/build-module/quote/block.json +3 -1
- package/build-module/quote/transforms.mjs +6 -8
- package/build-module/quote/transforms.mjs.map +2 -2
- package/build-module/rss/edit.mjs +0 -4
- package/build-module/rss/edit.mjs.map +2 -2
- package/build-module/search/edit.mjs +0 -4
- package/build-module/search/edit.mjs.map +2 -2
- package/build-module/separator/edit.mjs +1 -2
- package/build-module/separator/edit.mjs.map +2 -2
- package/build-module/site-logo/edit.mjs +34 -64
- package/build-module/site-logo/edit.mjs.map +2 -2
- package/build-module/social-links/edit.mjs +0 -1
- package/build-module/social-links/edit.mjs.map +2 -2
- package/build-module/spacer/controls.mjs +2 -4
- package/build-module/spacer/controls.mjs.map +2 -2
- package/build-module/spacer/edit.mjs +1 -2
- package/build-module/spacer/edit.mjs.map +2 -2
- package/build-module/tab-list/block.json +5 -4
- package/build-module/tab-list/edit.mjs +102 -56
- package/build-module/tab-list/edit.mjs.map +2 -2
- package/build-module/tab-list/save.mjs +5 -3
- package/build-module/tab-list/save.mjs.map +2 -2
- package/build-module/tab-panel/block.json +1 -6
- package/build-module/tab-panel/controls.mjs +2 -4
- package/build-module/tab-panel/controls.mjs.map +2 -2
- package/build-module/tab-panel/edit.mjs +16 -16
- package/build-module/tab-panel/edit.mjs.map +2 -2
- package/build-module/tab-panels/block.json +0 -1
- package/build-module/tab-panels/edit.mjs +2 -4
- package/build-module/tab-panels/edit.mjs.map +2 -2
- package/build-module/table-of-contents/edit.mjs +0 -1
- package/build-module/table-of-contents/edit.mjs.map +2 -2
- package/build-module/tabs/block.json +0 -5
- package/build-module/tabs/edit.mjs +7 -47
- package/build-module/tabs/edit.mjs.map +2 -2
- package/build-module/tabs/tab-toolbar-controls.mjs +46 -0
- package/build-module/tabs/tab-toolbar-controls.mjs.map +7 -0
- package/build-module/tabs/use-tab-actions.mjs +66 -0
- package/build-module/tabs/use-tab-actions.mjs.map +7 -0
- package/build-module/tabs/use-tab-list-items-sync.mjs +25 -7
- package/build-module/tabs/use-tab-list-items-sync.mjs.map +2 -2
- package/build-module/tag-cloud/edit.mjs +2 -6
- package/build-module/tag-cloud/edit.mjs.map +2 -2
- package/build-module/template-part/edit/advanced-controls.mjs +0 -1
- package/build-module/template-part/edit/advanced-controls.mjs.map +2 -2
- package/build-module/template-part/edit/import-controls.mjs +1 -2
- package/build-module/template-part/edit/import-controls.mjs.map +2 -2
- package/build-module/term-name/block.json +1 -3
- package/build-module/term-name/deprecated.mjs +74 -0
- package/build-module/term-name/deprecated.mjs.map +7 -0
- package/build-module/term-name/edit.mjs +11 -28
- package/build-module/term-name/edit.mjs.map +2 -2
- package/build-module/term-name/index.mjs +3 -1
- package/build-module/term-name/index.mjs.map +2 -2
- package/build-module/terms-query/edit/inspector-controls/include-control.mjs +0 -1
- package/build-module/terms-query/edit/inspector-controls/include-control.mjs.map +2 -2
- package/build-module/terms-query/edit/inspector-controls/inherit-control.mjs +0 -1
- package/build-module/terms-query/edit/inspector-controls/inherit-control.mjs.map +2 -2
- package/build-module/terms-query/edit/inspector-controls/max-terms-control.mjs +0 -1
- package/build-module/terms-query/edit/inspector-controls/max-terms-control.mjs.map +2 -2
- package/build-module/terms-query/edit/inspector-controls/order-control.mjs +0 -1
- package/build-module/terms-query/edit/inspector-controls/order-control.mjs.map +2 -2
- package/build-module/terms-query/edit/inspector-controls/taxonomy-control.mjs +0 -1
- package/build-module/terms-query/edit/inspector-controls/taxonomy-control.mjs.map +2 -2
- package/build-module/text-columns/edit.mjs +0 -1
- package/build-module/text-columns/edit.mjs.map +2 -2
- package/build-module/utils/waveform-player.mjs +144 -23
- package/build-module/utils/waveform-player.mjs.map +2 -2
- package/build-module/utils/waveform-utils.mjs +310 -16
- package/build-module/utils/waveform-utils.mjs.map +2 -2
- package/build-module/verse/block.json +3 -1
- package/build-module/video/block.json +6 -0
- package/build-module/video/edit-common-settings.mjs +0 -1
- package/build-module/video/edit-common-settings.mjs.map +2 -2
- package/build-module/video/edit.mjs +17 -1
- package/build-module/video/edit.mjs.map +2 -2
- package/build-module/video/index.mjs +2 -0
- package/build-module/video/index.mjs.map +2 -2
- package/build-module/video/save.mjs +7 -1
- package/build-module/video/save.mjs.map +2 -2
- package/build-module/video/tracks-editor.mjs +0 -1
- package/build-module/video/tracks-editor.mjs.map +2 -2
- package/build-module/video/variations.mjs +50 -0
- package/build-module/video/variations.mjs.map +7 -0
- package/build-style/accordion-panel/style-rtl.css +1 -2
- package/build-style/accordion-panel/style.css +1 -2
- package/build-style/audio/style-rtl.css +6 -0
- package/build-style/audio/style.css +6 -0
- package/build-style/audio/theme-rtl.css +6 -0
- package/build-style/audio/theme.css +6 -0
- package/build-style/columns/style-rtl.css +6 -0
- package/build-style/columns/style.css +6 -0
- package/build-style/common-rtl.css +6 -4
- package/build-style/common.css +6 -4
- package/build-style/editor-rtl.css +84 -24
- package/build-style/editor.css +84 -24
- package/build-style/embed/style-rtl.css +6 -0
- package/build-style/embed/style.css +6 -0
- package/build-style/embed/theme-rtl.css +6 -0
- package/build-style/embed/theme.css +6 -0
- package/build-style/freeform/editor-rtl.css +6 -0
- package/build-style/freeform/editor.css +6 -0
- package/build-style/gallery/editor-rtl.css +27 -3
- package/build-style/gallery/editor.css +27 -3
- package/build-style/gallery/style-rtl.css +6 -0
- package/build-style/gallery/style.css +6 -0
- package/build-style/gallery/theme-rtl.css +6 -0
- package/build-style/gallery/theme.css +6 -0
- package/build-style/html/editor-rtl.css +13 -0
- package/build-style/html/editor.css +13 -0
- package/build-style/icon/editor-rtl.css +80 -7
- package/build-style/icon/editor.css +80 -7
- package/build-style/image/editor-rtl.css +10 -0
- package/build-style/image/editor.css +10 -0
- package/build-style/image/style-rtl.css +6 -1
- package/build-style/image/style.css +6 -1
- package/build-style/image/theme-rtl.css +6 -0
- package/build-style/image/theme.css +6 -0
- package/build-style/latest-posts/style-rtl.css +26 -15
- package/build-style/latest-posts/style.css +26 -15
- package/build-style/more/editor-rtl.css +2 -2
- package/build-style/more/editor.css +2 -2
- package/build-style/navigation/editor-rtl.css +9 -4
- package/build-style/navigation/editor.css +9 -4
- package/build-style/navigation/style-rtl.css +6 -0
- package/build-style/navigation/style.css +6 -0
- package/build-style/navigation-link/editor-rtl.css +1 -1
- package/build-style/navigation-link/editor.css +1 -1
- package/build-style/navigation-submenu/editor-rtl.css +6 -0
- package/build-style/navigation-submenu/editor.css +6 -0
- package/build-style/nextpage/editor-rtl.css +2 -2
- package/build-style/nextpage/editor.css +2 -2
- package/build-style/page-list/editor-rtl.css +6 -0
- package/build-style/page-list/editor.css +6 -0
- package/build-style/playlist/editor-rtl.css +6 -0
- package/build-style/playlist/editor.css +6 -0
- package/build-style/playlist/style-rtl.css +158 -20
- package/build-style/playlist/style.css +158 -20
- package/build-style/playlist-track/style-rtl.css +10 -0
- package/build-style/playlist-track/style.css +10 -0
- package/build-style/post-template/style-rtl.css +6 -0
- package/build-style/post-template/style.css +6 -0
- package/build-style/query/editor-rtl.css +6 -0
- package/build-style/query/editor.css +6 -0
- package/build-style/rss/style-rtl.css +6 -0
- package/build-style/rss/style.css +6 -0
- package/build-style/shortcode/editor-rtl.css +6 -0
- package/build-style/shortcode/editor.css +6 -0
- package/build-style/style-rtl.css +192 -39
- package/build-style/style.css +192 -39
- package/build-style/table/editor-rtl.css +6 -0
- package/build-style/table/editor.css +6 -0
- package/build-style/table/theme-rtl.css +6 -0
- package/build-style/table/theme.css +6 -0
- package/build-style/template-part/editor-rtl.css +6 -0
- package/build-style/template-part/editor.css +6 -0
- package/build-style/theme-rtl.css +6 -0
- package/build-style/theme.css +6 -0
- package/build-style/video/editor-rtl.css +1 -1
- package/build-style/video/editor.css +1 -1
- package/build-style/video/style-rtl.css +6 -0
- package/build-style/video/style.css +6 -0
- package/build-style/video/theme-rtl.css +6 -0
- package/build-style/video/theme.css +6 -0
- package/build-types/table-of-contents/list.d.ts +1 -1
- package/build-types/table-of-contents/list.d.ts.map +1 -1
- package/package.json +48 -44
- package/src/accordion/README.md +2 -1
- package/src/accordion/block.json +1 -0
- package/src/accordion/edit.js +0 -1
- package/src/accordion/view.js +24 -0
- package/src/accordion-heading/README.md +1 -1
- package/src/accordion-heading/deprecated.js +122 -1
- package/src/accordion-heading/edit.js +12 -1
- package/src/accordion-heading/save.js +12 -1
- package/src/accordion-item/README.md +1 -1
- package/src/accordion-item/index.php +2 -1
- package/src/accordion-panel/edit.js +1 -1
- package/src/accordion-panel/style.scss +1 -4
- package/src/archives/edit.js +0 -1
- package/src/audio/edit.js +0 -1
- package/src/avatar/edit.js +0 -1
- package/src/avatar/user-control.js +0 -1
- package/src/button/edit.js +21 -15
- package/src/categories/edit.js +0 -1
- package/src/code/transforms.js +6 -4
- package/src/column/edit.js +0 -1
- package/src/columns/edit.js +0 -1
- package/src/columns/transforms.js +9 -2
- package/src/comment-author-avatar/edit.js +0 -1
- package/src/comments-pagination/comments-pagination-arrow-controls.js +0 -1
- package/src/common.scss +0 -4
- package/src/cover/README.md +60 -0
- package/src/cover/block.json +11 -0
- package/src/cover/edit/block-controls.js +21 -11
- package/src/cover/edit/embed-video-url-input.js +5 -4
- package/src/cover/edit/index.js +9 -11
- package/src/cover/edit/inspector-controls.js +0 -2
- package/src/cover/embed-video-utils.js +38 -13
- package/src/cover/test/edit.js +4 -4
- package/src/details/transforms.js +2 -2
- package/src/embed/edit.js +4 -5
- package/src/embed/embed-placeholder.js +16 -20
- package/src/file/edit.js +8 -8
- package/src/file/inspector.js +0 -2
- package/src/file/transforms.js +28 -60
- package/src/form/edit.js +0 -2
- package/src/freeform/convert-to-blocks-button.js +33 -0
- package/src/freeform/edit.js +11 -21
- package/src/freeform/index.js +1 -9
- package/src/gallery/README.md +4 -1
- package/src/gallery/block.json +8 -3
- package/src/gallery/dynamic-gallery.js +384 -0
- package/src/gallery/dynamic-source.js +117 -0
- package/src/gallery/edit.js +155 -49
- package/src/gallery/editor.scss +32 -4
- package/src/gallery/gallery.js +0 -7
- package/src/gallery/gap-styles.js +79 -20
- package/src/gallery/index.js +2 -0
- package/src/gallery/index.php +379 -42
- package/src/gallery/save.js +22 -11
- package/src/gallery/test/dynamic-source.js +90 -0
- package/src/gallery/use-dynamic-gallery.js +275 -0
- package/src/gallery/variations.js +37 -0
- package/src/group/edit.js +2 -3
- package/src/group/transforms.js +4 -8
- package/src/heading/edit.js +19 -14
- package/src/home-link/index.php +1 -1
- package/src/html/README.md +2 -1
- package/src/html/block.json +2 -2
- package/src/html/edit.js +86 -14
- package/src/html/editor.scss +10 -0
- package/src/html/index.js +3 -4
- package/src/html/modal.js +5 -9
- package/src/html/save.js +4 -7
- package/src/html/test/index.js +143 -0
- package/src/html/transforms.js +11 -6
- package/src/icon/components/custom-inserter/icon-grid.js +40 -11
- package/src/icon/components/custom-inserter/index.js +98 -25
- package/src/icon/edit.js +11 -17
- package/src/icon/editor.scss +33 -8
- package/src/icon/index.php +38 -45
- package/src/image/README.md +1 -1
- package/src/image/block.json +1 -1
- package/src/image/editor.scss +11 -0
- package/src/image/image.js +105 -169
- package/src/image/style.scss +0 -1
- package/src/image/test/use-open-image-media-editor-modal.js +19 -4
- package/src/image/transforms.js +128 -0
- package/src/index.js +19 -9
- package/src/latest-comments/edit.js +0 -2
- package/src/latest-posts/README.md +2 -2
- package/src/latest-posts/block.json +8 -9
- package/src/latest-posts/constants.js +0 -1
- package/src/latest-posts/deprecated.js +112 -9
- package/src/latest-posts/edit.js +38 -53
- package/src/latest-posts/index.php +60 -19
- package/src/latest-posts/style.scss +12 -2
- package/src/latest-posts/test/deprecated.js +153 -0
- package/src/list/ordered-list-settings.js +0 -1
- package/src/list-item/edit.js +1 -1
- package/src/list-item/hooks/use-enter.js +15 -22
- package/src/list-item/hooks/use-space.js +4 -6
- package/src/media-text/edit.js +0 -1
- package/src/media-text/editor.scss +1 -0
- package/src/missing/edit.js +1 -3
- package/src/more/editor.scss +1 -1
- package/src/navigation/edit/index.js +0 -1
- package/src/navigation/edit/overlay-menu-preview-controls.js +0 -1
- package/src/navigation/edit/overlay-menu-preview.js +0 -1
- package/src/navigation/edit/overlay-template-part-selector.js +0 -1
- package/src/navigation/edit/overlay-visibility-control.js +0 -1
- package/src/navigation/editor.scss +1 -2
- package/src/navigation-link/editor.scss +1 -1
- package/src/navigation-link/index.php +6 -3
- package/src/navigation-link/shared/test/controls.js +0 -4
- package/src/navigation-link/shared/test/use-entity-binding.js +8 -12
- package/src/navigation-link/shared/test/use-handle-link-change.test.js +0 -4
- package/src/navigation-link/shared/test/use-link-preview.test.js +17 -4
- package/src/navigation-link/shared/use-link-preview.js +24 -4
- package/src/navigation-overlay-close/edit.js +0 -1
- package/src/navigation-submenu/index.php +6 -3
- package/src/nextpage/editor.scss +1 -1
- package/src/page-list/edit.js +0 -1
- package/src/page-list/index.php +1 -1
- package/src/paragraph/README.md +1 -0
- package/src/paragraph/block.json +1 -0
- package/src/paragraph/use-enter.js +4 -11
- package/src/playlist/README.md +17 -20
- package/src/playlist/block.json +28 -15
- package/src/playlist/context.js +9 -0
- package/src/playlist/edit.js +298 -97
- package/src/playlist/editor.scss +6 -0
- package/src/playlist/index.js +1 -1
- package/src/playlist/index.php +91 -36
- package/src/playlist/style.scss +51 -6
- package/src/playlist/test/edit.js +13 -12
- package/src/playlist/utils.js +24 -12
- package/src/playlist/view.js +101 -20
- package/src/playlist-track/README.md +3 -5
- package/src/playlist-track/block.json +4 -5
- package/src/playlist-track/edit.js +116 -83
- package/src/playlist-track/index.php +24 -17
- package/src/playlist-track/style.scss +10 -0
- package/src/playlist-track/test/edit.js +169 -0
- package/src/post-author/edit.js +0 -2
- package/src/post-content/README.md +1 -0
- package/src/post-content/block.json +1 -0
- package/src/post-excerpt/edit.js +0 -1
- package/src/post-featured-image/overlay-controls.js +0 -1
- package/src/post-navigation-link/edit.js +0 -2
- package/src/post-template/README.md +1 -0
- package/src/post-template/block.json +2 -1
- package/src/post-template/edit.js +9 -0
- package/src/pullquote/README.md +1 -0
- package/src/pullquote/block.json +3 -1
- package/src/query/README.md +2 -1
- package/src/query/block.json +3 -2
- package/src/query/edit/inspector-controls/author-control.js +0 -1
- package/src/query/edit/inspector-controls/format-controls.js +0 -1
- package/src/query/edit/inspector-controls/index.js +43 -6
- package/src/query/edit/inspector-controls/offset-controls.js +0 -1
- package/src/query/edit/inspector-controls/order-control.js +0 -1
- package/src/query/edit/inspector-controls/pages-control.js +0 -1
- package/src/query/edit/inspector-controls/parent-control.js +0 -1
- package/src/query/edit/inspector-controls/per-page-control.js +0 -1
- package/src/query/edit/inspector-controls/sticky-control.js +0 -1
- package/src/query/edit/inspector-controls/taxonomy-controls.js +0 -1
- package/src/query/edit/query-content.js +19 -3
- package/src/query/index.js +1 -0
- package/src/query-pagination/query-pagination-arrow-controls.js +0 -1
- package/src/query-pagination-numbers/edit.js +0 -1
- package/src/quote/README.md +1 -0
- package/src/quote/block.json +3 -1
- package/src/quote/transforms.js +6 -8
- package/src/rss/edit.js +0 -4
- package/src/rss/index.php +1 -1
- package/src/search/edit.js +0 -4
- package/src/separator/edit.js +0 -1
- package/src/site-logo/edit.js +38 -78
- package/src/social-links/edit.js +0 -1
- package/src/spacer/controls.js +2 -4
- package/src/spacer/edit.js +2 -3
- package/src/tab-list/README.md +4 -5
- package/src/tab-list/block.json +5 -4
- package/src/tab-list/edit.js +133 -73
- package/src/tab-list/index.php +9 -4
- package/src/tab-list/save.js +5 -4
- package/src/tab-panel/README.md +4 -6
- package/src/tab-panel/block.json +1 -6
- package/src/tab-panel/controls.js +2 -4
- package/src/tab-panel/edit.js +19 -24
- package/src/tab-panels/README.md +5 -3
- package/src/tab-panels/block.json +0 -1
- package/src/tab-panels/edit.js +2 -4
- package/src/table-of-contents/edit.js +0 -1
- package/src/tabs/README.md +18 -9
- package/src/tabs/block.json +0 -5
- package/src/tabs/edit.js +8 -65
- package/src/tabs/tab-toolbar-controls.js +58 -0
- package/src/tabs/use-tab-actions.js +102 -0
- package/src/tabs/use-tab-list-items-sync.js +31 -12
- package/src/tag-cloud/edit.js +0 -4
- package/src/tag-cloud/index.php +1 -1
- package/src/template-part/edit/advanced-controls.js +0 -1
- package/src/template-part/edit/import-controls.js +0 -1
- package/src/template-part/index.php +1 -16
- package/src/term-name/README.md +1 -1
- package/src/term-name/block.json +1 -3
- package/src/term-name/deprecated.js +74 -0
- package/src/term-name/edit.js +2 -18
- package/src/term-name/index.js +2 -0
- package/src/terms-query/edit/inspector-controls/include-control.js +0 -1
- package/src/terms-query/edit/inspector-controls/inherit-control.js +0 -1
- package/src/terms-query/edit/inspector-controls/max-terms-control.js +0 -1
- package/src/terms-query/edit/inspector-controls/order-control.js +0 -1
- package/src/terms-query/edit/inspector-controls/taxonomy-control.js +0 -1
- package/src/text-columns/edit.js +0 -1
- package/src/utils/media-control.scss +1 -5
- package/src/utils/test/waveform-player.js +297 -38
- package/src/utils/test/waveform-utils.js +410 -9
- package/src/utils/waveform-player.js +189 -59
- package/src/utils/waveform-utils.js +443 -40
- package/src/verse/README.md +1 -0
- package/src/verse/block.json +3 -1
- package/src/video/README.md +2 -0
- package/src/video/block.json +6 -0
- package/src/video/edit-common-settings.js +0 -1
- package/src/video/edit.js +30 -1
- package/src/video/editor.scss +1 -1
- package/src/video/index.js +2 -0
- package/src/video/save.js +12 -0
- package/src/video/test/variations.js +65 -0
- package/src/video/tracks-editor.js +0 -1
- package/src/video/variations.js +65 -0
- package/build/freeform/migration-notice.cjs +0 -58
- package/build/freeform/migration-notice.cjs.map +0 -7
- package/build/tab-panel/add-tab-toolbar-control.cjs +0 -90
- package/build/tab-panel/add-tab-toolbar-control.cjs.map +0 -7
- package/build/tab-panel/remove-tab-toolbar-control.cjs +0 -99
- package/build/tab-panel/remove-tab-toolbar-control.cjs.map +0 -7
- package/build/tabs/controls.cjs +0 -45
- package/build/tabs/controls.cjs.map +0 -7
- package/build-module/freeform/migration-notice.mjs +0 -37
- package/build-module/freeform/migration-notice.mjs.map +0 -7
- package/build-module/tab-panel/add-tab-toolbar-control.mjs +0 -72
- package/build-module/tab-panel/add-tab-toolbar-control.mjs.map +0 -7
- package/build-module/tab-panel/remove-tab-toolbar-control.mjs +0 -81
- package/build-module/tab-panel/remove-tab-toolbar-control.mjs.map +0 -7
- package/build-module/tabs/controls.mjs +0 -14
- package/build-module/tabs/controls.mjs.map +0 -7
- package/src/freeform/migration-notice.js +0 -49
- package/src/tab-panel/add-tab-toolbar-control.js +0 -90
- package/src/tab-panel/remove-tab-toolbar-control.js +0 -110
- package/src/tabs/controls.js +0 -14
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/query/edit/inspector-controls/order-control.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { SelectControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nconst defaultOrderByOptions = [\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];\n\nfunction OrderControl( {\n\torder,\n\torderBy,\n\torderByOptions = defaultOrderByOptions,\n\tonChange,\n} ) {\n\treturn (\n\t\t<SelectControl\n\t\t\
|
|
5
|
-
"mappings": ";AAGA,SAAS,qBAAqB;AAC9B,SAAS,UAAU;AA8BjB;AA5BF,IAAM,wBAAwB;AAAA,EAC7B;AAAA,IACC,OAAO,GAAI,kBAAmB;AAAA,IAC9B,OAAO;AAAA,EACR;AAAA,EACA;AAAA,IACC,OAAO,GAAI,kBAAmB;AAAA,IAC9B,OAAO;AAAA,EACR;AAAA,EACA;AAAA;AAAA,IAEC,OAAO,GAAI,OAAQ;AAAA,IACnB,OAAO;AAAA,EACR;AAAA,EACA;AAAA;AAAA,IAEC,OAAO,GAAI,OAAQ;AAAA,IACnB,OAAO;AAAA,EACR;AACD;AAEA,SAAS,aAAc;AAAA,EACtB;AAAA,EACA;AAAA,EACA,iBAAiB;AAAA,EACjB;AACD,GAAI;AACH,SACC;AAAA,IAAC;AAAA;AAAA,MACA,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { SelectControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nconst defaultOrderByOptions = [\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];\n\nfunction OrderControl( {\n\torder,\n\torderBy,\n\torderByOptions = defaultOrderByOptions,\n\tonChange,\n} ) {\n\treturn (\n\t\t<SelectControl\n\t\t\tlabel={ __( 'Order by' ) }\n\t\t\tvalue={ `${ orderBy }/${ order }` }\n\t\t\toptions={ orderByOptions }\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"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,qBAAqB;AAC9B,SAAS,UAAU;AA8BjB;AA5BF,IAAM,wBAAwB;AAAA,EAC7B;AAAA,IACC,OAAO,GAAI,kBAAmB;AAAA,IAC9B,OAAO;AAAA,EACR;AAAA,EACA;AAAA,IACC,OAAO,GAAI,kBAAmB;AAAA,IAC9B,OAAO;AAAA,EACR;AAAA,EACA;AAAA;AAAA,IAEC,OAAO,GAAI,OAAQ;AAAA,IACnB,OAAO;AAAA,EACR;AAAA,EACA;AAAA;AAAA,IAEC,OAAO,GAAI,OAAQ;AAAA,IACnB,OAAO;AAAA,EACR;AACD;AAEA,SAAS,aAAc;AAAA,EACtB;AAAA,EACA;AAAA,EACA,iBAAiB;AAAA,EACjB;AACD,GAAI;AACH,SACC;AAAA,IAAC;AAAA;AAAA,MACA,OAAQ,GAAI,UAAW;AAAA,MACvB,OAAQ,GAAI,OAAQ,IAAK,KAAM;AAAA,MAC/B,SAAU;AAAA,MACV,UAAW,CAAE,UAAW;AACvB,cAAM,CAAE,YAAY,QAAS,IAAI,MAAM,MAAO,GAAI;AAClD,iBAAU,EAAE,OAAO,UAAU,SAAS,WAAW,CAAE;AAAA,MACpD;AAAA;AAAA,EACD;AAEF;AAEA,IAAO,wBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/query/edit/inspector-controls/pages-control.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __experimentalNumberControl as NumberControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nexport const PagesControl = ( { pages, onChange } ) => {\n\treturn (\n\t\t<NumberControl\n\t\t\
|
|
5
|
-
"mappings": ";AAGA,SAAS,+BAA+B,qBAAqB;AAC7D,SAAS,UAAU;AAIjB;AAFK,IAAM,eAAe,CAAE,EAAE,OAAO,SAAS,MAAO;AACtD,SACC;AAAA,IAAC;AAAA;AAAA,MACA,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __experimentalNumberControl as NumberControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nexport const PagesControl = ( { pages, onChange } ) => {\n\treturn (\n\t\t<NumberControl\n\t\t\tlabel={ __( 'Max pages to show' ) }\n\t\t\tvalue={ pages }\n\t\t\tmin={ 0 }\n\t\t\tonChange={ ( newPages ) => {\n\t\t\t\tif ( isNaN( newPages ) || newPages < 0 ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tonChange( { pages: newPages } );\n\t\t\t} }\n\t\t\thelp={ __(\n\t\t\t\t'Limit the pages you want to show, even if the query has more results. To show all pages use 0 (zero).'\n\t\t\t) }\n\t\t/>\n\t);\n};\n\nexport default PagesControl;\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,+BAA+B,qBAAqB;AAC7D,SAAS,UAAU;AAIjB;AAFK,IAAM,eAAe,CAAE,EAAE,OAAO,SAAS,MAAO;AACtD,SACC;AAAA,IAAC;AAAA;AAAA,MACA,OAAQ,GAAI,mBAAoB;AAAA,MAChC,OAAQ;AAAA,MACR,KAAM;AAAA,MACN,UAAW,CAAE,aAAc;AAC1B,YAAK,MAAO,QAAS,KAAK,WAAW,GAAI;AACxC;AAAA,QACD;AACA,iBAAU,EAAE,OAAO,SAAS,CAAE;AAAA,MAC/B;AAAA,MACA,MAAO;AAAA,QACN;AAAA,MACD;AAAA;AAAA,EACD;AAEF;AAEA,IAAO,wBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/query/edit/inspector-controls/parent-control.js"],
|
|
4
|
-
"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, postType, 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, postType ]\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\
|
|
5
|
-
"mappings": ";AAGA,SAAS,UAAU;AACnB,SAAS,sBAAsB;AAC/B,SAAS,iBAAiB;AAC1B,SAAS,SAAS,iBAAiB;AACnC,SAAS,UAAU,WAAW,eAAe;AAC7C,SAAS,mBAAmB;AAK5B,SAAS,iBAAiB,0BAA0B;AAwHlD;AAtHF,IAAM,cAAc,CAAC;AACrB,IAAM,aAAa;AAAA,EAClB,OAAO;AAAA,EACP,SAAS;AAAA,EACT,SAAS;AACV;AAEA,SAAS,cAAe,EAAE,SAAS,UAAU,SAAS,GAAI;AACzD,QAAM,CAAE,QAAQ,SAAU,IAAI,SAAU,EAAG;AAC3C,QAAM,CAAE,OAAO,QAAS,IAAI,SAAU,WAAY;AAClD,QAAM,CAAE,aAAa,cAAe,IAAI,SAAU,WAAY;AAC9D,QAAM,kBAAkB,YA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;AACA,aAAO;AAAA,IACR,GAAG,CAAC,CAAE;AACN,aAAU,cAAe;AAAA,EAC1B,GAAG,CAAE,SAAS,cAAe,CAAE;AAE/B,QAAM,eAAe,QAAS,MAAM;AACnC,QAAK,CAAE,eAAe,QAAS;AAC9B,aAAO;AAAA,IACR;AACA,WAAO;AAAA,MACN,mBAAoB,eAAe,gBAAiB;AAAA,IACrD;AAAA,EACD,GAAG,CAAE,aAAc,CAAE;AAErB,YAAW,MAAM;AAChB,QAAK,CAAE,mBAAoB;AAC1B;AAAA,IACD;AACA,mBAAgB,aAAa,KAAM;AAAA,EACpC,GAAG,CAAE,aAAa,OAAO,iBAAkB,CAAE;AAE7C,QAAM,eAAe,CAAE,sBAAsB,WAAY;AACxD,UAAM,KAAK,QAAQ,MAAM,uBAAwB,MAAO,GAAG;AAC3D,QAAK,IAAK;AACT,aAAO;AAAA,IACR;AAAA,EACD;AACA,QAAM,iBAAiB,CAAE,aAAc;AACtC,UAAM,MAAM,MAAM;AAAA,MACjB,SAAS,OAAQ,CAAE,aAAa,WAAY;AAE3C,cAAM,KAAK,aAAc,aAAa,WAAW,MAAO;AACxD,YAAK,IAAK;AACT,sBAAY,IAAK,EAAG;AAAA,QACrB;AACA,eAAO;AAAA,MACR,GAAG,oBAAI,IAAI,CAAE;AAAA,IACd;AACA,mBAAgB,WAAY;AAC5B,aAAU,EAAE,SAAS,IAAI,CAAE;AAAA,EAC5B;AACA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,
|
|
4
|
+
"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, postType, 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, postType ]\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\thelp=\"\"\n\t\t/>\n\t);\n}\n\nexport default ParentControl;\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,UAAU;AACnB,SAAS,sBAAsB;AAC/B,SAAS,iBAAiB;AAC1B,SAAS,SAAS,iBAAiB;AACnC,SAAS,UAAU,WAAW,eAAe;AAC7C,SAAS,mBAAmB;AAK5B,SAAS,iBAAiB,0BAA0B;AAwHlD;AAtHF,IAAM,cAAc,CAAC;AACrB,IAAM,aAAa;AAAA,EAClB,OAAO;AAAA,EACP,SAAS;AAAA,EACT,SAAS;AACV;AAEA,SAAS,cAAe,EAAE,SAAS,UAAU,SAAS,GAAI;AACzD,QAAM,CAAE,QAAQ,SAAU,IAAI,SAAU,EAAG;AAC3C,QAAM,CAAE,OAAO,QAAS,IAAI,SAAU,WAAY;AAClD,QAAM,CAAE,aAAa,cAAe,IAAI,SAAU,WAAY;AAC9D,QAAM,kBAAkB,YAAa,WAAW,GAAI;AACpD,QAAM,EAAE,eAAe,kBAAkB,IAAI;AAAA,IAC5C,CAAE,WAAY;AACb,UAAK,CAAE,QAAS;AACf,eAAO,EAAE,eAAe,aAAa,mBAAmB,KAAK;AAAA,MAC9D;AACA,YAAM,EAAE,kBAAkB,sBAAsB,IAC/C,OAAQ,SAAU;AACnB,YAAM,eAAe;AAAA,QACpB;AAAA,QACA;AAAA,QACA;AAAA,UACC,GAAG;AAAA,UACH;AAAA,UACA,SAAS;AAAA,UACT,SAAS;AAAA,UACT,UAAU;AAAA,QACX;AAAA,MACD;AACA,aAAO;AAAA,QACN,eAAe,iBAAkB,GAAG,YAAa;AAAA,QACjD,mBAAmB;AAAA,UAClB;AAAA,UACA;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,IACA,CAAE,QAAQ,UAAU,OAAQ;AA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ACT,aAAO;AAAA,IACR;AAAA,EACD;AACA,QAAM,iBAAiB,CAAE,aAAc;AACtC,UAAM,MAAM,MAAM;AAAA,MACjB,SAAS,OAAQ,CAAE,aAAa,WAAY;AAE3C,cAAM,KAAK,aAAc,aAAa,WAAW,MAAO;AACxD,YAAK,IAAK;AACT,sBAAY,IAAK,EAAG;AAAA,QACrB;AACA,eAAO;AAAA,MACR,GAAG,oBAAI,IAAI,CAAE;AAAA,IACd;AACA,mBAAgB,WAAY;AAC5B,aAAU,EAAE,SAAS,IAAI,CAAE;AAAA,EAC5B;AACA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,OAAQ,GAAI,SAAU;AAAA,MACtB;AAAA,MACA,eAAgB;AAAA,MAChB;AAAA,MACA,UAAW;AAAA,MACX,MAAK;AAAA;AAAA,EACN;AAEF;AAEA,IAAO,yBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/query/edit/inspector-controls/per-page-control.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { RangeControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nconst MIN_POSTS_PER_PAGE = 1;\nconst MAX_POSTS_PER_PAGE = 100;\n\nconst PerPageControl = ( { perPage, offset = 0, onChange } ) => {\n\treturn (\n\t\t<RangeControl\n\t\t\
|
|
5
|
-
"mappings": ";AAGA,SAAS,oBAAoB;AAC7B,SAAS,UAAU;AAOjB;AALF,IAAM,qBAAqB;AAC3B,IAAM,qBAAqB;AAE3B,IAAM,iBAAiB,CAAE,EAAE,SAAS,SAAS,GAAG,SAAS,MAAO;AAC/D,SACC;AAAA,IAAC;AAAA;AAAA,MACA,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { RangeControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nconst MIN_POSTS_PER_PAGE = 1;\nconst MAX_POSTS_PER_PAGE = 100;\n\nconst PerPageControl = ( { perPage, offset = 0, onChange } ) => {\n\treturn (\n\t\t<RangeControl\n\t\t\tlabel={ __( 'Items per page' ) }\n\t\t\tmin={ MIN_POSTS_PER_PAGE }\n\t\t\tmax={ MAX_POSTS_PER_PAGE }\n\t\t\tonChange={ ( newPerPage ) => {\n\t\t\t\tif (\n\t\t\t\t\tisNaN( newPerPage ) ||\n\t\t\t\t\tnewPerPage < MIN_POSTS_PER_PAGE ||\n\t\t\t\t\tnewPerPage > MAX_POSTS_PER_PAGE\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tonChange( { perPage: newPerPage, offset } );\n\t\t\t} }\n\t\t\tvalue={ parseInt( perPage, 10 ) }\n\t\t/>\n\t);\n};\n\nexport default PerPageControl;\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,oBAAoB;AAC7B,SAAS,UAAU;AAOjB;AALF,IAAM,qBAAqB;AAC3B,IAAM,qBAAqB;AAE3B,IAAM,iBAAiB,CAAE,EAAE,SAAS,SAAS,GAAG,SAAS,MAAO;AAC/D,SACC;AAAA,IAAC;AAAA;AAAA,MACA,OAAQ,GAAI,gBAAiB;AAAA,MAC7B,KAAM;AAAA,MACN,KAAM;AAAA,MACN,UAAW,CAAE,eAAgB;AAC5B,YACC,MAAO,UAAW,KAClB,aAAa,sBACb,aAAa,oBACZ;AACD;AAAA,QACD;AACA,iBAAU,EAAE,SAAS,YAAY,OAAO,CAAE;AAAA,MAC3C;AAAA,MACA,OAAQ,SAAU,SAAS,EAAG;AAAA;AAAA,EAC/B;AAEF;AAEA,IAAO,2BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/query/edit/inspector-controls/sticky-control.js"],
|
|
4
|
-
"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: __( 'Ignore' ), value: 'ignore' },\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\
|
|
5
|
-
"mappings": ";AAGA,SAAS,qBAAqB;AAC9B,SAAS,UAAU;AAWjB;AATF,IAAM,gBAAgB;AAAA,EACrB,EAAE,OAAO,GAAI,SAAU,GAAG,OAAO,GAAG;AAAA,EACpC,EAAE,OAAO,GAAI,QAAS,GAAG,OAAO,SAAS;AAAA,EACzC,EAAE,OAAO,GAAI,SAAU,GAAG,OAAO,UAAU;AAAA,EAC3C,EAAE,OAAO,GAAI,MAAO,GAAG,OAAO,OAAO;AACtC;AAEe,SAAR,cAAgC,EAAE,OAAO,SAAS,GAAI;AAC5D,SACC;AAAA,IAAC;AAAA;AAAA,MACA,
|
|
4
|
+
"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: __( 'Ignore' ), value: 'ignore' },\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\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'Sticky posts always appear first, regardless of their publish date.'\n\t\t\t) }\n\t\t/>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,qBAAqB;AAC9B,SAAS,UAAU;AAWjB;AATF,IAAM,gBAAgB;AAAA,EACrB,EAAE,OAAO,GAAI,SAAU,GAAG,OAAO,GAAG;AAAA,EACpC,EAAE,OAAO,GAAI,QAAS,GAAG,OAAO,SAAS;AAAA,EACzC,EAAE,OAAO,GAAI,SAAU,GAAG,OAAO,UAAU;AAAA,EAC3C,EAAE,OAAO,GAAI,MAAO,GAAG,OAAO,OAAO;AACtC;AAEe,SAAR,cAAgC,EAAE,OAAO,SAAS,GAAI;AAC5D,SACC;AAAA,IAAC;AAAA;AAAA,MACA,OAAQ,GAAI,cAAe;AAAA,MAC3B,SAAU;AAAA,MACV;AAAA,MACA;AAAA,MACA,MAAO;AAAA,QACN;AAAA,MACD;AAAA;AAAA,EACD;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/query/edit/inspector-controls/taxonomy-controls.js"],
|
|
4
|
-
"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, Fragment } from '@wordpress/element';\nimport { useDebounce } from '@wordpress/compose';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { sprintf, __ } from '@wordpress/i18n';\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?.length ) {\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 includeTermIds =\n\t\t\t\t\ttaxQuery?.include?.[ taxonomy.slug ] || [];\n\t\t\t\tconst excludeTermIds =\n\t\t\t\t\ttaxQuery?.exclude?.[ taxonomy.slug ] || [];\n\t\t\t\tconst onChangeTaxQuery = (\n\t\t\t\t\tnewTermIds,\n\t\t\t\t\t/** @type {'include'|'exclude'} */ key\n\t\t\t\t) => {\n\t\t\t\t\tconst newPartialTaxQuery = {\n\t\t\t\t\t\t...taxQuery?.[ key ],\n\t\t\t\t\t\t[ taxonomy.slug ]: newTermIds,\n\t\t\t\t\t};\n\t\t\t\t\t// Remove empty arrays from the partial `taxQuery` (include|exclude).\n\t\t\t\t\tif ( ! newTermIds.length ) {\n\t\t\t\t\t\tdelete newPartialTaxQuery[ taxonomy.slug ];\n\t\t\t\t\t}\n\t\t\t\t\tconst newTaxQuery = {\n\t\t\t\t\t\t...taxQuery,\n\t\t\t\t\t\t[ key ]: !! Object.keys( newPartialTaxQuery ).length\n\t\t\t\t\t\t\t? newPartialTaxQuery\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t};\n\t\t\t\t\tonChange( {\n\t\t\t\t\t\t// Clean up `taxQuery` if all filters are removed.\n\t\t\t\t\t\ttaxQuery: Object.values( newTaxQuery ).every(\n\t\t\t\t\t\t\t( value ) => ! value\n\t\t\t\t\t\t)\n\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t: newTaxQuery,\n\t\t\t\t\t} );\n\t\t\t\t};\n\t\t\t\treturn (\n\t\t\t\t\t<Fragment key={ taxonomy.slug }>\n\t\t\t\t\t\t<TaxonomyItem\n\t\t\t\t\t\t\ttaxonomy={ taxonomy }\n\t\t\t\t\t\t\ttermIds={ includeTermIds }\n\t\t\t\t\t\t\toppositeTermIds={ excludeTermIds }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tonChangeTaxQuery( value, 'include' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlabel={ taxonomy.name }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<TaxonomyItem\n\t\t\t\t\t\t\ttaxonomy={ taxonomy }\n\t\t\t\t\t\t\ttermIds={ excludeTermIds }\n\t\t\t\t\t\t\toppositeTermIds={ includeTermIds }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tonChangeTaxQuery( value, 'exclude' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\t/* translators: %s: taxonomy name */\n\t\t\t\t\t\t\t\tsprintf( __( 'Exclude: %s' ), taxonomy.name )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Fragment>\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 {number[]} props.oppositeTermIds An array with the opposite control's term ids (to exclude from suggestions).\n * @param {Function} props.onChange Callback `onChange` function.\n * @param {string} props.label Label of the control.\n * @return {React.JSX.Element} The rendered component.\n */\nfunction TaxonomyItem( {\n\ttaxonomy,\n\ttermIds,\n\toppositeTermIds,\n\tonChange,\n\tlabel,\n} ) {\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\n\t\t\t// Combine current terms and opposite terms for exclusion, to prevent\n\t\t\t// users from selecting the same term in both include and exclude controls.\n\t\t\tconst combinedExclude = [ ...termIds, ...oppositeTermIds ];\n\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: combinedExclude,\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, taxonomy.slug, termIds, oppositeTermIds ]\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[ taxonomy.slug, 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={ label }\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\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AAO,IAAK,CAAE;AAAA,EAChE,GAAG,CAAE,eAAe,iBAAkB,CAAE;AACxC,QAAM,gBAAgB,CAAE,kBAAmB;AAC1C,UAAM,aAAa,oBAAI,IAAI;AAC3B,eAAY,aAAa,eAAgB;AACxC,YAAM,SAAS,qBAAsB,eAAe,SAAU;AAC9D,UAAK,QAAS;AACb,mBAAW,IAAK,MAAO;AAAA,MACxB;AAAA,IACD;AACA,mBAAgB,WAAY;AAC5B,aAAU,MAAM,KAAM,UAAW,CAAE;AAAA,EACpC;AACA,SACC,oBAAC,SAAI,WAAU,mDACd;AAAA,IAAC;AAAA;AAAA,MACA;AAAA,MACA;AAAA,MACA,eAAgB;AAAA,MAChB;AAAA,MACA,kBAAmB;AAAA,MACnB,UAAW;AAAA,MACX,MAAK;AAAA
|
|
4
|
+
"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, Fragment } from '@wordpress/element';\nimport { useDebounce } from '@wordpress/compose';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { sprintf, __ } from '@wordpress/i18n';\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?.length ) {\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 includeTermIds =\n\t\t\t\t\ttaxQuery?.include?.[ taxonomy.slug ] || [];\n\t\t\t\tconst excludeTermIds =\n\t\t\t\t\ttaxQuery?.exclude?.[ taxonomy.slug ] || [];\n\t\t\t\tconst onChangeTaxQuery = (\n\t\t\t\t\tnewTermIds,\n\t\t\t\t\t/** @type {'include'|'exclude'} */ key\n\t\t\t\t) => {\n\t\t\t\t\tconst newPartialTaxQuery = {\n\t\t\t\t\t\t...taxQuery?.[ key ],\n\t\t\t\t\t\t[ taxonomy.slug ]: newTermIds,\n\t\t\t\t\t};\n\t\t\t\t\t// Remove empty arrays from the partial `taxQuery` (include|exclude).\n\t\t\t\t\tif ( ! newTermIds.length ) {\n\t\t\t\t\t\tdelete newPartialTaxQuery[ taxonomy.slug ];\n\t\t\t\t\t}\n\t\t\t\t\tconst newTaxQuery = {\n\t\t\t\t\t\t...taxQuery,\n\t\t\t\t\t\t[ key ]: !! Object.keys( newPartialTaxQuery ).length\n\t\t\t\t\t\t\t? newPartialTaxQuery\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t};\n\t\t\t\t\tonChange( {\n\t\t\t\t\t\t// Clean up `taxQuery` if all filters are removed.\n\t\t\t\t\t\ttaxQuery: Object.values( newTaxQuery ).every(\n\t\t\t\t\t\t\t( value ) => ! value\n\t\t\t\t\t\t)\n\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t: newTaxQuery,\n\t\t\t\t\t} );\n\t\t\t\t};\n\t\t\t\treturn (\n\t\t\t\t\t<Fragment key={ taxonomy.slug }>\n\t\t\t\t\t\t<TaxonomyItem\n\t\t\t\t\t\t\ttaxonomy={ taxonomy }\n\t\t\t\t\t\t\ttermIds={ includeTermIds }\n\t\t\t\t\t\t\toppositeTermIds={ excludeTermIds }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tonChangeTaxQuery( value, 'include' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlabel={ taxonomy.name }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<TaxonomyItem\n\t\t\t\t\t\t\ttaxonomy={ taxonomy }\n\t\t\t\t\t\t\ttermIds={ excludeTermIds }\n\t\t\t\t\t\t\toppositeTermIds={ includeTermIds }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tonChangeTaxQuery( value, 'exclude' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\t/* translators: %s: taxonomy name */\n\t\t\t\t\t\t\t\tsprintf( __( 'Exclude: %s' ), taxonomy.name )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Fragment>\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 {number[]} props.oppositeTermIds An array with the opposite control's term ids (to exclude from suggestions).\n * @param {Function} props.onChange Callback `onChange` function.\n * @param {string} props.label Label of the control.\n * @return {React.JSX.Element} The rendered component.\n */\nfunction TaxonomyItem( {\n\ttaxonomy,\n\ttermIds,\n\toppositeTermIds,\n\tonChange,\n\tlabel,\n} ) {\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\n\t\t\t// Combine current terms and opposite terms for exclusion, to prevent\n\t\t\t// users from selecting the same term in both include and exclude controls.\n\t\t\tconst combinedExclude = [ ...termIds, ...oppositeTermIds ];\n\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: combinedExclude,\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, taxonomy.slug, termIds, oppositeTermIds ]\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[ taxonomy.slug, 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={ label }\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\thelp=\"\"\n\t\t\t/>\n\t\t</div>\n\t);\n}\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e,iBAAkB,CAAE;AACxC,QAAM,gBAAgB,CAAE,kBAAmB;AAC1C,UAAM,aAAa,oBAAI,IAAI;AAC3B,eAAY,aAAa,eAAgB;AACxC,YAAM,SAAS,qBAAsB,eAAe,SAAU;AAC9D,UAAK,QAAS;AACb,mBAAW,IAAK,MAAO;AAAA,MACxB;AAAA,IACD;AACA,mBAAgB,WAAY;AAC5B,aAAU,MAAM,KAAM,UAAW,CAAE;AAAA,EACpC;AACA,SACC,oBAAC,SAAI,WAAU,mDACd;AAAA,IAAC;AAAA;AAAA,MACA;AAAA,MACA;AAAA,MACA,eAAgB;AAAA,MAChB;AAAA,MACA,kBAAmB;AAAA,MACnB,UAAW;AAAA,MACX,MAAK;AAAA;AAAA,EACN,GACD;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -36,8 +36,8 @@ function QueryContent({
|
|
|
36
36
|
tagName: TagName = "div",
|
|
37
37
|
query: { inherit } = {}
|
|
38
38
|
} = attributes;
|
|
39
|
-
const { templateSlug } = context;
|
|
40
|
-
const { isSingular } = getQueryContextFromTemplate(templateSlug);
|
|
39
|
+
const { templateSlug, postType } = context;
|
|
40
|
+
const { isSingular, templateType } = getQueryContextFromTemplate(templateSlug);
|
|
41
41
|
const { __unstableMarkNextChangeAsNotPersistent } = useDispatch(blockEditorStore);
|
|
42
42
|
const instanceId = useInstanceId(QueryContent);
|
|
43
43
|
const blockProps = useBlockProps();
|
|
@@ -56,6 +56,7 @@ function QueryContent({
|
|
|
56
56
|
postsPerPage: editedSettingPerPage || settingPerPage || DEFAULTS_POSTS_PER_PAGE
|
|
57
57
|
};
|
|
58
58
|
}, []);
|
|
59
|
+
const shouldExcludeCurrentPost = isSingular && !inherit && (query.postType === postType || query.postType === templateType);
|
|
59
60
|
const updateQuery = useCallback(
|
|
60
61
|
(newQuery) => setAttributes((prevAttributes) => ({
|
|
61
62
|
query: { ...prevAttributes.query, ...newQuery }
|
|
@@ -69,14 +70,19 @@ function QueryContent({
|
|
|
69
70
|
} else if (!query.perPage && postsPerPage) {
|
|
70
71
|
newQuery.perPage = postsPerPage;
|
|
71
72
|
}
|
|
73
|
+
if (!shouldExcludeCurrentPost && query.excludeCurrent !== null) {
|
|
74
|
+
newQuery.excludeCurrent = null;
|
|
75
|
+
}
|
|
72
76
|
if (!!Object.keys(newQuery).length) {
|
|
73
77
|
__unstableMarkNextChangeAsNotPersistent();
|
|
74
78
|
updateQuery(newQuery);
|
|
75
79
|
}
|
|
76
80
|
}, [
|
|
77
81
|
query.perPage,
|
|
82
|
+
query.excludeCurrent,
|
|
78
83
|
inherit,
|
|
79
84
|
postsPerPage,
|
|
85
|
+
shouldExcludeCurrentPost,
|
|
80
86
|
__unstableMarkNextChangeAsNotPersistent,
|
|
81
87
|
updateQuery
|
|
82
88
|
]);
|
|
@@ -116,7 +122,8 @@ function QueryContent({
|
|
|
116
122
|
setQuery: updateQuery,
|
|
117
123
|
setAttributes,
|
|
118
124
|
clientId,
|
|
119
|
-
isSingular
|
|
125
|
+
isSingular,
|
|
126
|
+
shouldExcludeCurrentPost
|
|
120
127
|
}
|
|
121
128
|
) }),
|
|
122
129
|
/* @__PURE__ */ jsxs(InspectorControls, { group: "advanced", children: [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/query/edit/query-content.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useInstanceId } from '@wordpress/compose';\nimport { useEffect, useCallback } from '@wordpress/element';\nimport {\n\tInspectorControls,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n\tuseInnerBlocksProps,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport EnhancedPaginationControl from './inspector-controls/enhanced-pagination-control';\nimport { unlock } from '../../lock-unlock';\nimport QueryInspectorControls from './inspector-controls';\nimport EnhancedPaginationModal from './enhanced-pagination-modal';\nimport { getQueryContextFromTemplate } from '../utils';\nimport QueryToolbar from './query-toolbar';\n\nconst { HTMLElementControl } = unlock( blockEditorPrivateApis );\n\nconst DEFAULTS_POSTS_PER_PAGE = 3;\n\nconst TEMPLATE = [ [ 'core/post-template' ] ];\nexport default function QueryContent( {\n\tattributes,\n\tsetAttributes,\n\tclientId,\n\tcontext,\n\tname,\n\tisSelected,\n} ) {\n\tconst {\n\t\tqueryId,\n\t\tquery,\n\t\tenhancedPagination,\n\t\ttagName: TagName = 'div',\n\t\tquery: { inherit } = {},\n\t} = attributes;\n\tconst { templateSlug } = context;\n\tconst { isSingular }
|
|
5
|
-
"mappings": ";AAGA,SAAS,WAAW,mBAAmB;AACvC,SAAS,qBAAqB;AAC9B,SAAS,WAAW,mBAAmB;AACvC;AAAA,EACC;AAAA,EACA;AAAA,EACA,SAAS;AAAA,EACT;AAAA,EACA,eAAe;AAAA,OACT;AACP,SAAS,UAAU;AACnB,SAAS,SAAS,iBAAiB;AAKnC,OAAO,+BAA+B;AACtC,SAAS,cAAc;AACvB,OAAO,4BAA4B;AACnC,OAAO,6BAA6B;AACpC,SAAS,mCAAmC;AAC5C,OAAO,kBAAkB;
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useInstanceId } from '@wordpress/compose';\nimport { useEffect, useCallback } from '@wordpress/element';\nimport {\n\tInspectorControls,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n\tuseInnerBlocksProps,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport EnhancedPaginationControl from './inspector-controls/enhanced-pagination-control';\nimport { unlock } from '../../lock-unlock';\nimport QueryInspectorControls from './inspector-controls';\nimport EnhancedPaginationModal from './enhanced-pagination-modal';\nimport { getQueryContextFromTemplate } from '../utils';\nimport QueryToolbar from './query-toolbar';\n\nconst { HTMLElementControl } = unlock( blockEditorPrivateApis );\n\nconst DEFAULTS_POSTS_PER_PAGE = 3;\n\nconst TEMPLATE = [ [ 'core/post-template' ] ];\nexport default function QueryContent( {\n\tattributes,\n\tsetAttributes,\n\tclientId,\n\tcontext,\n\tname,\n\tisSelected,\n} ) {\n\tconst {\n\t\tqueryId,\n\t\tquery,\n\t\tenhancedPagination,\n\t\ttagName: TagName = 'div',\n\t\tquery: { inherit } = {},\n\t} = attributes;\n\tconst { templateSlug, postType } = context;\n\tconst { isSingular, templateType } =\n\t\tgetQueryContextFromTemplate( templateSlug );\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\n\t// Whether the \"exclude current\" filter applies: we're in a singular template\n\t// and the post type matches the query.\n\tconst shouldExcludeCurrentPost =\n\t\tisSingular &&\n\t\t! inherit &&\n\t\t( query.postType === postType || query.postType === templateType );\n\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\tconst updateQuery = useCallback(\n\t\t( newQuery ) =>\n\t\t\tsetAttributes( ( prevAttributes ) => ( {\n\t\t\t\tquery: { ...prevAttributes.query, ...newQuery },\n\t\t\t} ) ),\n\t\t[ setAttributes ]\n\t);\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\t// Remove the exclusion when it no longer applies, so the filters stay\n\t\t// clean. We never force it on: enabling the exclusion is left to the user.\n\t\tif ( ! shouldExcludeCurrentPost && query.excludeCurrent !== null ) {\n\t\t\tnewQuery.excludeCurrent = null;\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}, [\n\t\tquery.perPage,\n\t\tquery.excludeCurrent,\n\t\tinherit,\n\t\tpostsPerPage,\n\t\tshouldExcludeCurrentPost,\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\tupdateQuery,\n\t] );\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}, [\n\t\tqueryId,\n\t\tinstanceId,\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\tsetAttributes,\n\t] );\n\n\treturn (\n\t\t<>\n\t\t\t{ isSelected && (\n\t\t\t\t<QueryToolbar\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\thasInnerBlocks\n\t\t\t\t/>\n\t\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\tname={ name }\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetQuery={ updateQuery }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tisSingular={ isSingular }\n\t\t\t\t\tshouldExcludeCurrentPost={ shouldExcludeCurrentPost }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t<HTMLElementControl\n\t\t\t\t\ttagName={ 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\tclientId={ clientId }\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/>\n\t\t\t\t<EnhancedPaginationControl\n\t\t\t\t\tenhancedPagination={ enhancedPagination }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t/>\n\t\t\t</Inspector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AAc;AAAA;AAAA,IACf;AAAA,IAED;AAAA,MAAC;AAAA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACD;AAAA,IACA,oBAAC,qBACA;AAAA,MAAC;AAAA;AAAA,QACA;AAAA,QACA;AAAA,QACA,UAAW;AAAA,QACX;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACD,GACD;AAAA,IACA,qBAAC,qBAAkB,OAAM,YACxB;AAAA;AAAA,QAAC;AAAA;AAAA,UACA,SAAU;AAAA,UACV,UAAW,CAAE,UACZ,cAAe,EAAE,SAAS,MAAM,CAAE;AAAA,UAEnC;AAAA,UACA,SAAU;AAAA,YACT,EAAE,OAAO,GAAI,iBAAkB,GAAG,OAAO,MAAM;AAAA,YAC/C,EAAE,OAAO,UAAU,OAAO,OAAO;AAAA,YACjC,EAAE,OAAO,aAAa,OAAO,UAAU;AAAA,YACvC,EAAE,OAAO,WAAW,OAAO,QAAQ;AAAA,UACpC;AAAA;AAAA,MACD;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA;AAAA,MACD;AAAA,OACD;AAAA,IACA,oBAAC,WAAU,GAAG,kBAAmB;AAAA,KAClC;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/query/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { loop as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport save from './save';\nimport variations from './variations';\nimport deprecated from './deprecated';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\texample: {\n\t\tviewportWidth: 650,\n\t\tattributes: {\n\t\t\tnamespace: 'core/posts-list',\n\t\t\tquery: {\n\t\t\t\tperPage: 4,\n\t\t\t\tpages: 1,\n\t\t\t\toffset: 0,\n\t\t\t\tpostType: 'post',\n\t\t\t\torder: 'desc',\n\t\t\t\torderBy: 'date',\n\t\t\t\tauthor: '',\n\t\t\t\tsearch: '',\n\t\t\t\tsticky: 'exclude',\n\t\t\t\tinherit: false,\n\t\t\t},\n\t\t},\n\t\tinnerBlocks: [\n\t\t\t{\n\t\t\t\tname: 'core/post-template',\n\t\t\t\tattributes: {\n\t\t\t\t\tlayout: {\n\t\t\t\t\t\ttype: 'grid',\n\t\t\t\t\t\tcolumnCount: 2,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tinnerBlocks: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'core/post-title',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'core/post-date',\n\t\t\t\t\t\tattributes: {\n\t\t\t\t\t\t\tmetadata: {\n\t\t\t\t\t\t\t\tbindings: {\n\t\t\t\t\t\t\t\t\tdatetime: {\n\t\t\t\t\t\t\t\t\t\tsource: 'core/post-data',\n\t\t\t\t\t\t\t\t\t\targs: { field: 'date' },\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},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'core/post-excerpt',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t},\n\tsave,\n\tvariations,\n\tdeprecated,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],
|
|
5
|
-
"mappings": ";AAGA,SAAS,QAAQ,YAAY;AAK7B,OAAO,eAAe;AACtB,OAAO,cAAc;AACrB,OAAO,UAAU;AACjB,OAAO,UAAU;AACjB,OAAO,gBAAgB;AACvB,OAAO,gBAAgB;AAEvB,IAAM,EAAE,KAAK,IAAI;AAGV,IAAM,WAAW;AAAA,EACvB;AAAA,EACA;AAAA,EACA,SAAS;AAAA,IACR,eAAe;AAAA,IACf,YAAY;AAAA,MACX,WAAW;AAAA,MACX,OAAO;AAAA,QACN,SAAS;AAAA,QACT,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,UAAU;AAAA,QACV,OAAO;AAAA,QACP,SAAS;AAAA,QACT,QAAQ;AAAA,QACR,QAAQ;AAAA,QACR,QAAQ;AAAA,QACR,SAAS;AAAA,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { loop as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport save from './save';\nimport variations from './variations';\nimport deprecated from './deprecated';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\texample: {\n\t\tviewportWidth: 650,\n\t\tattributes: {\n\t\t\tnamespace: 'core/posts-list',\n\t\t\tquery: {\n\t\t\t\tperPage: 4,\n\t\t\t\tpages: 1,\n\t\t\t\toffset: 0,\n\t\t\t\tpostType: 'post',\n\t\t\t\torder: 'desc',\n\t\t\t\torderBy: 'date',\n\t\t\t\tauthor: '',\n\t\t\t\tsearch: '',\n\t\t\t\tsticky: 'exclude',\n\t\t\t\tinherit: false,\n\t\t\t\texcludeCurrent: null,\n\t\t\t},\n\t\t},\n\t\tinnerBlocks: [\n\t\t\t{\n\t\t\t\tname: 'core/post-template',\n\t\t\t\tattributes: {\n\t\t\t\t\tlayout: {\n\t\t\t\t\t\ttype: 'grid',\n\t\t\t\t\t\tcolumnCount: 2,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tinnerBlocks: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'core/post-title',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'core/post-date',\n\t\t\t\t\t\tattributes: {\n\t\t\t\t\t\t\tmetadata: {\n\t\t\t\t\t\t\t\tbindings: {\n\t\t\t\t\t\t\t\t\tdatetime: {\n\t\t\t\t\t\t\t\t\t\tsource: 'core/post-data',\n\t\t\t\t\t\t\t\t\t\targs: { field: 'date' },\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},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'core/post-excerpt',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t},\n\tsave,\n\tvariations,\n\tdeprecated,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,QAAQ,YAAY;AAK7B,OAAO,eAAe;AACtB,OAAO,cAAc;AACrB,OAAO,UAAU;AACjB,OAAO,UAAU;AACjB,OAAO,gBAAgB;AACvB,OAAO,gBAAgB;AAEvB,IAAM,EAAE,KAAK,IAAI;AAGV,IAAM,WAAW;AAAA,EACvB;AAAA,EACA;AAAA,EACA,SAAS;AAAA,IACR,eAAe;AAAA,IACf,YAAY;AAAA,MACX,WAAW;AAAA,MACX,OAAO;AAAA,QACN,SAAS;AAAA,QACT,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,UAAU;AAAA,QACV,OAAO;AAAA,QACP,SAAS;AAAA,QACT,QAAQ;AAAA,QACR,QAAQ;AAAA,QACR,QAAQ;AAAA,QACR,SAAS;AAAA,QACT,gBAAgB;AAAA,MACjB;AAAA,IACD;AAAA,IACA,aAAa;AAAA,MACZ;AAAA,QACC,MAAM;AAAA,QACN,YAAY;AAAA,UACX,QAAQ;AAAA,YACP,MAAM;AAAA,YACN,aAAa;AAAA,UACd;AAAA,QACD;AAAA,QACA,aAAa;AAAA,UACZ;AAAA,YACC,MAAM;AAAA,UACP;AAAA,UACA;AAAA,YACC,MAAM;AAAA,YACN,YAAY;AAAA,cACX,UAAU;AAAA,gBACT,UAAU;AAAA,kBACT,UAAU;AAAA,oBACT,QAAQ;AAAA,oBACR,MAAM,EAAE,OAAO,OAAO;AAAA,kBACvB;AAAA,gBACD;AAAA,cACD;AAAA,YACD;AAAA,UACD;AAAA,UACA;AAAA,YACC,MAAM;AAAA,UACP;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AAEO,IAAM,OAAO,MAAM,UAAW,EAAE,MAAM,UAAU,SAAS,CAAE;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/query-pagination/query-pagination-arrow-controls.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n} from '@wordpress/components';\n\nexport function QueryPaginationArrowControls( { value, onChange } ) {\n\treturn (\n\t\t<ToggleGroupControl\n\t\t\
|
|
5
|
-
"mappings": ";AAGA,SAAS,IAAI,UAAU;AACvB;AAAA,EACC,oCAAoC;AAAA,EACpC,0CAA0C;AAAA,OACpC;AAIL,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n} from '@wordpress/components';\n\nexport function QueryPaginationArrowControls( { value, onChange } ) {\n\treturn (\n\t\t<ToggleGroupControl\n\t\t\tlabel={ __( 'Arrow' ) }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\thelp={ __(\n\t\t\t\t'A decorative arrow appended to the next and previous page link.'\n\t\t\t) }\n\t\t\tisBlock\n\t\t>\n\t\t\t<ToggleGroupControlOption\n\t\t\t\tvalue=\"none\"\n\t\t\t\tlabel={ _x(\n\t\t\t\t\t'None',\n\t\t\t\t\t'Arrow option for Query Pagination Next/Previous blocks'\n\t\t\t\t) }\n\t\t\t/>\n\t\t\t<ToggleGroupControlOption\n\t\t\t\tvalue=\"arrow\"\n\t\t\t\tlabel={ _x(\n\t\t\t\t\t'Arrow',\n\t\t\t\t\t'Arrow option for Query Pagination Next/Previous blocks'\n\t\t\t\t) }\n\t\t\t/>\n\t\t\t<ToggleGroupControlOption\n\t\t\t\tvalue=\"chevron\"\n\t\t\t\tlabel={ _x(\n\t\t\t\t\t'Chevron',\n\t\t\t\t\t'Arrow option for Query Pagination Next/Previous blocks'\n\t\t\t\t) }\n\t\t\t/>\n\t\t</ToggleGroupControl>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,IAAI,UAAU;AACvB;AAAA,EACC,oCAAoC;AAAA,EACpC,0CAA0C;AAAA,OACpC;AAIL,SASC,KATD;AAFK,SAAS,6BAA8B,EAAE,OAAO,SAAS,GAAI;AACnE,SACC;AAAA,IAAC;AAAA;AAAA,MACA,OAAQ,GAAI,OAAQ;AAAA,MACpB;AAAA,MACA;AAAA,MACA,MAAO;AAAA,QACN;AAAA,MACD;AAAA,MACA,SAAO;AAAA,MAEP;AAAA;AAAA,UAAC;AAAA;AAAA,YACA,OAAM;AAAA,YACN,OAAQ;AAAA,cACP;AAAA,cACA;AAAA,YACD;AAAA;AAAA,QACD;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACA,OAAM;AAAA,YACN,OAAQ;AAAA,cACP;AAAA,cACA;AAAA,YACD;AAAA;AAAA,QACD;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACA,OAAM;AAAA,YACN,OAAQ;AAAA,cACP;AAAA,cACA;AAAA,YACD;AAAA;AAAA,QACD;AAAA;AAAA;AAAA,EACD;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -50,7 +50,6 @@ function QueryPaginationNumbersEdit({
|
|
|
50
50
|
children: /* @__PURE__ */ jsx(
|
|
51
51
|
RangeControl,
|
|
52
52
|
{
|
|
53
|
-
__next40pxDefaultSize: true,
|
|
54
53
|
label: __("Number of links"),
|
|
55
54
|
help: __(
|
|
56
55
|
"Specify how many links can appear before and after the current page number. Links to the first, current and last page are always visible."
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/query-pagination-numbers/edit.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { InspectorControls, useBlockProps } from '@wordpress/block-editor';\nimport {\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\tRangeControl,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\nconst createPaginationItem = ( content, Tag = 'a', extraClass = '' ) => (\n\t<Tag key={ content } className={ `page-numbers ${ extraClass }` }>\n\t\t{ content }\n\t</Tag>\n);\n\nconst previewPaginationNumbers = ( midSize ) => {\n\tconst paginationItems = [];\n\n\t// First set of pagination items.\n\tfor ( let i = 1; i <= midSize; i++ ) {\n\t\tpaginationItems.push( createPaginationItem( i ) );\n\t}\n\n\t// Current pagination item.\n\tpaginationItems.push(\n\t\tcreatePaginationItem( midSize + 1, 'span', 'current' )\n\t);\n\n\t// Second set of pagination items.\n\tfor ( let i = 1; i <= midSize; i++ ) {\n\t\tpaginationItems.push( createPaginationItem( midSize + 1 + i ) );\n\t}\n\n\t// Dots.\n\tpaginationItems.push( createPaginationItem( '...', 'span', 'dots' ) );\n\n\t// Last pagination item.\n\tpaginationItems.push( createPaginationItem( midSize * 2 + 3 ) );\n\n\treturn <>{ paginationItems }</>;\n};\n\nexport default function QueryPaginationNumbersEdit( {\n\tattributes,\n\tsetAttributes,\n} ) {\n\tconst { midSize } = attributes;\n\tconst paginationNumbers = previewPaginationNumbers(\n\t\tparseInt( midSize, 10 )\n\t);\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\tresetAll={ () => setAttributes( { midSize: 2 } ) }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Number of links' ) }\n\t\t\t\t\t\thasValue={ () => midSize !== 2 }\n\t\t\t\t\t\tonDeselect={ () => setAttributes( { midSize: 2 } ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t>\n\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\
|
|
5
|
-
"mappings": ";AAGA,SAAS,UAAU;AACnB,SAAS,mBAAmB,qBAAqB;AACjD;AAAA,EACC,4BAA4B;AAAA,EAC5B,gCAAgC;AAAA,EAChC;AAAA,OACM;AAKP,SAAS,sCAAsC;AAG9C,SA6BO,UA7BP,KA2CC,YA3CD;AADD,IAAM,uBAAuB,CAAE,SAAS,MAAM,KAAK,aAAa,OAC/D,oBAAC,OAAoB,WAAY,gBAAiB,UAAW,IAC1D,qBADQ,OAEX;AAGD,IAAM,2BAA2B,CAAE,YAAa;AAC/C,QAAM,kBAAkB,CAAC;AAGzB,WAAU,IAAI,GAAG,KAAK,SAAS,KAAM;AACpC,oBAAgB,KAAM,qBAAsB,CAAE,CAAE;AAAA,EACjD;AAGA,kBAAgB;AAAA,IACf,qBAAsB,UAAU,GAAG,QAAQ,SAAU;AAAA,EACtD;AAGA,WAAU,IAAI,GAAG,KAAK,SAAS,KAAM;AACpC,oBAAgB,KAAM,qBAAsB,UAAU,IAAI,CAAE,CAAE;AAAA,EAC/D;AAGA,kBAAgB,KAAM,qBAAsB,OAAO,QAAQ,MAAO,CAAE;AAGpE,kBAAgB,KAAM,qBAAsB,UAAU,IAAI,CAAE,CAAE;AAE9D,SAAO,gCAAI,2BAAiB;AAC7B;AAEe,SAAR,2BAA6C;AAAA,EACnD;AAAA,EACA;AACD,GAAI;AACH,QAAM,EAAE,QAAQ,IAAI;AACpB,QAAM,oBAAoB;AAAA,IACzB,SAAU,SAAS,EAAG;AAAA,EACvB;AACA,QAAM,oBAAoB,+BAA+B;AAEzD,SACC,iCACC;AAAA,wBAAC,qBACA;AAAA,MAAC;AAAA;AAAA,QACA,OAAQ,GAAI,UAAW;AAAA,QACvB,UAAW,MAAM,cAAe,EAAE,SAAS,EAAE,CAAE;AAAA,QAC/C;AAAA,QAEA;AAAA,UAAC;AAAA;AAAA,YACA,OAAQ,GAAI,iBAAkB;AAAA,YAC9B,UAAW,MAAM,YAAY;AAAA,YAC7B,YAAa,MAAM,cAAe,EAAE,SAAS,EAAE,CAAE;AAAA,YACjD,kBAAgB;AAAA,YAEhB;AAAA,cAAC;AAAA;AAAA,gBACA,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { InspectorControls, useBlockProps } from '@wordpress/block-editor';\nimport {\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\tRangeControl,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\nconst createPaginationItem = ( content, Tag = 'a', extraClass = '' ) => (\n\t<Tag key={ content } className={ `page-numbers ${ extraClass }` }>\n\t\t{ content }\n\t</Tag>\n);\n\nconst previewPaginationNumbers = ( midSize ) => {\n\tconst paginationItems = [];\n\n\t// First set of pagination items.\n\tfor ( let i = 1; i <= midSize; i++ ) {\n\t\tpaginationItems.push( createPaginationItem( i ) );\n\t}\n\n\t// Current pagination item.\n\tpaginationItems.push(\n\t\tcreatePaginationItem( midSize + 1, 'span', 'current' )\n\t);\n\n\t// Second set of pagination items.\n\tfor ( let i = 1; i <= midSize; i++ ) {\n\t\tpaginationItems.push( createPaginationItem( midSize + 1 + i ) );\n\t}\n\n\t// Dots.\n\tpaginationItems.push( createPaginationItem( '...', 'span', 'dots' ) );\n\n\t// Last pagination item.\n\tpaginationItems.push( createPaginationItem( midSize * 2 + 3 ) );\n\n\treturn <>{ paginationItems }</>;\n};\n\nexport default function QueryPaginationNumbersEdit( {\n\tattributes,\n\tsetAttributes,\n} ) {\n\tconst { midSize } = attributes;\n\tconst paginationNumbers = previewPaginationNumbers(\n\t\tparseInt( midSize, 10 )\n\t);\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\tresetAll={ () => setAttributes( { midSize: 2 } ) }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Number of links' ) }\n\t\t\t\t\t\thasValue={ () => midSize !== 2 }\n\t\t\t\t\t\tonDeselect={ () => setAttributes( { midSize: 2 } ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t>\n\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\tlabel={ __( 'Number of links' ) }\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Specify how many links can appear before and after the current page number. Links to the first, current and last page are always visible.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tvalue={ midSize }\n\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tmidSize: parseInt( value, 10 ),\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\tmax={ 5 }\n\t\t\t\t\t\t\twithInputField={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t</ToolsPanel>\n\t\t\t</InspectorControls>\n\t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AAkB;AAAA,YAC9B,UAAW,MAAM,YAAY;AAAA,YAC7B,YAAa,MAAM,cAAe,EAAE,SAAS,EAAE,CAAE;AAAA,YACjD,kBAAgB;AAAA,YAEhB;AAAA,cAAC;AAAA;AAAA,gBACA,OAAQ,GAAI,iBAAkB;AAAA,gBAC9B,MAAO;AAAA,kBACN;AAAA,gBACD;AAAA,gBACA,OAAQ;AAAA,gBACR,UAAW,CAAE,UAAW;AACvB,gCAAe;AAAA,oBACd,SAAS,SAAU,OAAO,EAAG;AAAA,kBAC9B,CAAE;AAAA,gBACH;AAAA,gBACA,KAAM;AAAA,gBACN,KAAM;AAAA,gBACN,gBAAiB;AAAA;AAAA,YAClB;AAAA;AAAA,QACD;AAAA;AAAA,IACD,GACD;AAAA,IACA,oBAAC,SAAM,GAAG,cAAc,GAAM,6BAAmB;AAAA,KAClD;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
// packages/block-library/src/quote/transforms.js
|
|
2
2
|
import { RichText } from "@wordpress/block-editor";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
createBlock,
|
|
5
|
+
cloneSanitizedBlock,
|
|
6
|
+
switchToBlockType
|
|
7
|
+
} from "@wordpress/blocks";
|
|
4
8
|
var transforms = {
|
|
5
9
|
from: [
|
|
6
10
|
{
|
|
@@ -85,13 +89,7 @@ var transforms = {
|
|
|
85
89
|
__experimentalConvert: (blocks) => createBlock(
|
|
86
90
|
"core/quote",
|
|
87
91
|
{},
|
|
88
|
-
blocks.map(
|
|
89
|
-
(block) => createBlock(
|
|
90
|
-
block.name,
|
|
91
|
-
block.attributes,
|
|
92
|
-
block.innerBlocks
|
|
93
|
-
)
|
|
94
|
-
)
|
|
92
|
+
blocks.map((block) => cloneSanitizedBlock(block))
|
|
95
93
|
)
|
|
96
94
|
}
|
|
97
95
|
],
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/quote/transforms.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { RichText } from '@wordpress/block-editor';\nimport {
|
|
5
|
-
"mappings": ";AAGA,SAAS,gBAAgB;AACzB,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { RichText } from '@wordpress/block-editor';\nimport {\n\tcreateBlock,\n\tcloneSanitizedBlock,\n\tswitchToBlockType,\n} from '@wordpress/blocks';\n\nconst transforms = {\n\tfrom: [\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/verse' ],\n\t\t\ttransform: ( { content } ) => {\n\t\t\t\treturn createBlock( 'core/quote', {}, [\n\t\t\t\t\tcreateBlock( 'core/paragraph', { content } ),\n\t\t\t\t] );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/pullquote' ],\n\t\t\ttransform: ( {\n\t\t\t\tvalue,\n\t\t\t\talign,\n\t\t\t\tcitation,\n\t\t\t\tanchor,\n\t\t\t\tfontSize,\n\t\t\t\tstyle,\n\t\t\t} ) => {\n\t\t\t\treturn createBlock(\n\t\t\t\t\t'core/quote',\n\t\t\t\t\t{\n\t\t\t\t\t\talign,\n\t\t\t\t\t\tcitation,\n\t\t\t\t\t\tanchor,\n\t\t\t\t\t\tfontSize,\n\t\t\t\t\t\tstyle,\n\t\t\t\t\t},\n\t\t\t\t\t[ createBlock( 'core/paragraph', { content: value } ) ]\n\t\t\t\t);\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttype: 'prefix',\n\t\t\tprefix: '>',\n\t\t\ttransform: ( content ) =>\n\t\t\t\tcreateBlock( 'core/quote', {}, [\n\t\t\t\t\tcreateBlock( 'core/paragraph', { content } ),\n\t\t\t\t] ),\n\t\t},\n\t\t{\n\t\t\ttype: 'raw',\n\t\t\tschema: () => ( {\n\t\t\t\tblockquote: {\n\t\t\t\t\tchildren: '*',\n\t\t\t\t},\n\t\t\t} ),\n\t\t\tselector: 'blockquote',\n\t\t\ttransform: ( node, handler ) => {\n\t\t\t\treturn createBlock(\n\t\t\t\t\t'core/quote',\n\t\t\t\t\t// Don't try to parse any `cite` out of this content.\n\t\t\t\t\t// * There may be more than one cite.\n\t\t\t\t\t// * There may be more attribution text than just the cite.\n\t\t\t\t\t// * If the cite is nested in the quoted text, it's wrong to\n\t\t\t\t\t// remove it.\n\t\t\t\t\t{},\n\t\t\t\t\thandler( {\n\t\t\t\t\t\tHTML: node.innerHTML,\n\t\t\t\t\t\tmode: 'BLOCKS',\n\t\t\t\t\t} )\n\t\t\t\t);\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tisMultiBlock: true,\n\t\t\tblocks: [ '*' ],\n\t\t\tisMatch: ( {}, blocks ) => {\n\t\t\t\t// When a single block is selected make the transformation\n\t\t\t\t// available only to specific blocks that make sense.\n\t\t\t\tif ( blocks.length === 1 ) {\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'core/paragraph',\n\t\t\t\t\t\t'core/heading',\n\t\t\t\t\t\t'core/list',\n\t\t\t\t\t\t'core/pullquote',\n\t\t\t\t\t].includes( blocks[ 0 ].name );\n\t\t\t\t}\n\t\t\t\treturn ! blocks.some( ( { name } ) => name === 'core/quote' );\n\t\t\t},\n\t\t\t__experimentalConvert: ( blocks ) =>\n\t\t\t\tcreateBlock(\n\t\t\t\t\t'core/quote',\n\t\t\t\t\t{},\n\t\t\t\t\tblocks.map( ( block ) => cloneSanitizedBlock( block ) )\n\t\t\t\t),\n\t\t},\n\t],\n\tto: [\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/pullquote' ],\n\t\t\tisMatch: ( {}, block ) => {\n\t\t\t\treturn block.innerBlocks.every(\n\t\t\t\t\t( { name } ) => name === 'core/paragraph'\n\t\t\t\t);\n\t\t\t},\n\t\t\ttransform: (\n\t\t\t\t{ align, citation, anchor, fontSize, style },\n\t\t\t\tinnerBlocks\n\t\t\t) => {\n\t\t\t\tconst value = innerBlocks\n\t\t\t\t\t.map( ( { attributes } ) => `${ attributes.content }` )\n\t\t\t\t\t.join( '<br>' );\n\t\t\t\treturn createBlock( 'core/pullquote', {\n\t\t\t\t\tvalue,\n\t\t\t\t\talign,\n\t\t\t\t\tcitation,\n\t\t\t\t\tanchor,\n\t\t\t\t\tfontSize,\n\t\t\t\t\tstyle,\n\t\t\t\t} );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/verse' ],\n\t\t\tisMatch: ( {}, block ) => {\n\t\t\t\treturn block.innerBlocks.every( ( innerBlock ) => {\n\t\t\t\t\t// Paragraphs are already in the target format\n\t\t\t\t\tif ( innerBlock.name === 'core/paragraph' ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\t// Check if other blocks can be converted to paragraphs\n\t\t\t\t\tconst converted = switchToBlockType(\n\t\t\t\t\t\tinnerBlock,\n\t\t\t\t\t\t'core/paragraph'\n\t\t\t\t\t);\n\t\t\t\t\treturn converted !== null;\n\t\t\t\t} );\n\t\t\t},\n\t\t\ttransform: ( {}, innerBlocks ) => {\n\t\t\t\tconst paragraphs = innerBlocks.flatMap( ( innerBlock ) => {\n\t\t\t\t\t// If already a paragraph, use it directly\n\t\t\t\t\tif ( innerBlock.name === 'core/paragraph' ) {\n\t\t\t\t\t\treturn innerBlock;\n\t\t\t\t\t}\n\t\t\t\t\t// Otherwise convert to paragraph\n\t\t\t\t\treturn (\n\t\t\t\t\t\tswitchToBlockType( innerBlock, 'core/paragraph' ) || []\n\t\t\t\t\t);\n\t\t\t\t} );\n\t\t\t\tconst content = paragraphs\n\t\t\t\t\t.map( ( { attributes } ) => attributes.content || '' )\n\t\t\t\t\t.filter( Boolean )\n\t\t\t\t\t.join( '<br>' );\n\t\t\t\treturn createBlock( 'core/verse', { content } );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/paragraph' ],\n\t\t\tisMatch: ( { citation }, block ) => {\n\t\t\t\tconst innerBlocks = block.innerBlocks;\n\t\t\t\tif ( ! innerBlocks.length ) {\n\t\t\t\t\treturn ! RichText.isEmpty( citation );\n\t\t\t\t}\n\n\t\t\t\treturn innerBlocks.every( ( innerBlock ) => {\n\t\t\t\t\tif ( innerBlock.name === 'core/paragraph' ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tconst converted = switchToBlockType(\n\t\t\t\t\t\tinnerBlock,\n\t\t\t\t\t\t'core/paragraph'\n\t\t\t\t\t);\n\t\t\t\t\treturn converted !== null;\n\t\t\t\t} );\n\t\t\t},\n\t\t\ttransform: ( { citation }, innerBlocks ) => {\n\t\t\t\tconst paragraphs = innerBlocks.flatMap( ( innerBlock ) => {\n\t\t\t\t\tif ( innerBlock.name === 'core/paragraph' ) {\n\t\t\t\t\t\treturn innerBlock;\n\t\t\t\t\t}\n\t\t\t\t\treturn (\n\t\t\t\t\t\tswitchToBlockType( innerBlock, 'core/paragraph' ) || []\n\t\t\t\t\t);\n\t\t\t\t} );\n\t\t\t\treturn RichText.isEmpty( citation )\n\t\t\t\t\t? paragraphs\n\t\t\t\t\t: [\n\t\t\t\t\t\t\t...paragraphs,\n\t\t\t\t\t\t\tcreateBlock( 'core/paragraph', {\n\t\t\t\t\t\t\t\tcontent: citation,\n\t\t\t\t\t\t\t} ),\n\t\t\t\t\t ];\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/group' ],\n\t\t\ttransform: ( { citation, anchor }, innerBlocks ) =>\n\t\t\t\tcreateBlock(\n\t\t\t\t\t'core/group',\n\t\t\t\t\t{ anchor },\n\t\t\t\t\tRichText.isEmpty( citation )\n\t\t\t\t\t\t? innerBlocks\n\t\t\t\t\t\t: [\n\t\t\t\t\t\t\t\t...innerBlocks,\n\t\t\t\t\t\t\t\tcreateBlock( 'core/paragraph', {\n\t\t\t\t\t\t\t\t\tcontent: citation,\n\t\t\t\t\t\t\t\t} ),\n\t\t\t\t\t\t ]\n\t\t\t\t),\n\t\t},\n\t],\n\tungroup: ( { citation }, innerBlocks ) =>\n\t\tRichText.isEmpty( citation )\n\t\t\t? innerBlocks\n\t\t\t: [\n\t\t\t\t\t...innerBlocks,\n\t\t\t\t\tcreateBlock( 'core/paragraph', {\n\t\t\t\t\t\tcontent: citation,\n\t\t\t\t\t} ),\n\t\t\t ],\n};\n\nexport default transforms;\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,gBAAgB;AACzB;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAEP,IAAM,aAAa;AAAA,EAClB,MAAM;AAAA,IACL;AAAA,MACC,MAAM;AAAA,MACN,QAAQ,CAAE,YAAa;AAAA,MACvB,WAAW,CAAE,EAAE,QAAQ,MAAO;AAC7B,eAAO,YAAa,cAAc,CAAC,GAAG;AAAA,UACrC,YAAa,kBAAkB,EAAE,QAAQ,CAAE;AAAA,QAC5C,CAAE;AAAA,MACH;AAAA,IACD;AAAA,IACA;AAAA,MACC,MAAM;AAAA,MACN,QAAQ,CAAE,gBAAiB;AAAA,MAC3B,WAAW,CAAE;AAAA,QACZ;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACD,MAAO;AACN,eAAO;AAAA,UACN;AAAA,UACA;AAAA,YACC;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,UACD;AAAA,UACA,CAAE,YAAa,kBAAkB,EAAE,SAAS,MAAM,CAAE,CAAE;AAAA,QACvD;AAAA,MACD;AAAA,IACD;AAAA,IACA;AAAA,MACC,MAAM;AAAA,MACN,QAAQ;AAAA,MACR,WAAW,CAAE,YACZ,YAAa,cAAc,CAAC,GAAG;AAAA,QAC9B,YAAa,kBAAkB,EAAE,QAAQ,CAAE;AAAA,MAC5C,CAAE;AAAA,IACJ;AAAA,IACA;AAAA,M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AAiB;AAC3C,cAAM,aAAa,YAAY,QAAS,CAAE,eAAgB;AACzD,cAAK,WAAW,SAAS,kBAAmB;AAC3C,mBAAO;AAAA,UACR;AACA,iBACC,kBAAmB,YAAY,gBAAiB,KAAK,CAAC;AAAA,QAExD,CAAE;AACF,eAAO,SAAS,QAAS,QAAS,IAC/B,aACA;AAAA,UACA,GAAG;AAAA,UACH,YAAa,kBAAkB;AAAA,YAC9B,SAAS;AAAA,UACV,CAAE;AAAA,QACF;AAAA,MACJ;AAAA,IACD;AAAA,IACA;AAAA,MACC,MAAM;AAAA,MACN,QAAQ,CAAE,YAAa;AAAA,MACvB,WAAW,CAAE,EAAE,UAAU,OAAO,GAAG,gBAClC;AAAA,QACC;AAAA,QACA,EAAE,OAAO;AAAA,QACT,SAAS,QAAS,QAAS,IACxB,cACA;AAAA,UACA,GAAG;AAAA,UACH,YAAa,kBAAkB;AAAA,YAC9B,SAAS;AAAA,UACV,CAAE;AAAA,QACF;AAAA,MACJ;AAAA,IACF;AAAA,EACD;AAAA,EACA,SAAS,CAAE,EAAE,SAAS,GAAG,gBACxB,SAAS,QAAS,QAAS,IACxB,cACA;AAAA,IACA,GAAG;AAAA,IACH,YAAa,kBAAkB;AAAA,MAC9B,SAAS;AAAA,IACV,CAAE;AAAA,EACF;AACL;AAEA,IAAO,qBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -82,7 +82,6 @@ function RSSEdit({ attributes, setAttributes, name }) {
|
|
|
82
82
|
/* @__PURE__ */ jsx(
|
|
83
83
|
InputControl,
|
|
84
84
|
{
|
|
85
|
-
__next40pxDefaultSize: true,
|
|
86
85
|
label,
|
|
87
86
|
type: "url",
|
|
88
87
|
hideLabelFromVision: true,
|
|
@@ -155,7 +154,6 @@ function RSSEdit({ attributes, setAttributes, name }) {
|
|
|
155
154
|
children: /* @__PURE__ */ jsx(
|
|
156
155
|
RangeControl,
|
|
157
156
|
{
|
|
158
|
-
__next40pxDefaultSize: true,
|
|
159
157
|
label: __("Number of items"),
|
|
160
158
|
value: itemsToShow,
|
|
161
159
|
onChange: (value) => setAttributes({ itemsToShow: value }),
|
|
@@ -227,7 +225,6 @@ function RSSEdit({ attributes, setAttributes, name }) {
|
|
|
227
225
|
children: /* @__PURE__ */ jsx(
|
|
228
226
|
RangeControl,
|
|
229
227
|
{
|
|
230
|
-
__next40pxDefaultSize: true,
|
|
231
228
|
label: __("Max number of words in excerpt"),
|
|
232
229
|
value: excerptLength,
|
|
233
230
|
onChange: (value) => setAttributes({ excerptLength: value }),
|
|
@@ -248,7 +245,6 @@ function RSSEdit({ attributes, setAttributes, name }) {
|
|
|
248
245
|
children: /* @__PURE__ */ jsx(
|
|
249
246
|
RangeControl,
|
|
250
247
|
{
|
|
251
|
-
__next40pxDefaultSize: true,
|
|
252
248
|
label: __("Columns"),
|
|
253
249
|
value: columns,
|
|
254
250
|
onChange: (value) => setAttributes({ columns: value }),
|