@wordpress/block-library 7.5.0 → 7.6.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 +6 -0
- package/README.md +3 -2
- package/babel-plugin.js +154 -0
- package/build/audio/edit.js +1 -1
- package/build/audio/edit.js.map +1 -1
- package/build/block/edit.js +10 -9
- package/build/block/edit.js.map +1 -1
- package/build/button/index.js +1 -0
- package/build/button/index.js.map +1 -1
- package/build/categories/edit.js +1 -1
- package/build/categories/edit.js.map +1 -1
- package/build/categories/index.js +1 -1
- package/build/comment-author-avatar/index.js +1 -0
- package/build/comment-author-avatar/index.js.map +1 -1
- package/build/comments-title/deprecated.js +110 -0
- package/build/comments-title/deprecated.js.map +1 -0
- package/build/comments-title/edit.js +35 -37
- package/build/comments-title/edit.js.map +1 -1
- package/build/comments-title/index.js +5 -8
- package/build/comments-title/index.js.map +1 -1
- package/build/cover/controls.native.js +2 -3
- package/build/cover/controls.native.js.map +1 -1
- package/build/cover/edit/block-controls.js +115 -0
- package/build/cover/edit/block-controls.js.map +1 -0
- package/build/cover/edit/cover-placeholder.js +49 -0
- package/build/cover/edit/cover-placeholder.js.map +1 -0
- package/build/cover/edit/index.js +333 -0
- package/build/cover/edit/index.js.map +1 -0
- package/build/cover/edit/inspector-controls.js +224 -0
- package/build/cover/edit/inspector-controls.js.map +1 -0
- package/build/cover/edit/resizable-cover.js +67 -0
- package/build/cover/edit/resizable-cover.js.map +1 -0
- package/build/cover/{use-cover-is-dark.js → edit/use-cover-is-dark.js} +0 -0
- package/build/cover/edit/use-cover-is-dark.js.map +1 -0
- package/build/cover/edit.native.js +0 -1
- package/build/cover/edit.native.js.map +1 -1
- package/build/cover/focal-point-settings-button.native.js.map +1 -1
- package/build/cover/shared.js +9 -0
- package/build/cover/shared.js.map +1 -1
- package/build/embed/embed-preview.js +1 -1
- package/build/embed/embed-preview.js.map +1 -1
- package/build/file/edit.native.js +0 -1
- package/build/file/edit.native.js.map +1 -1
- package/build/gallery/edit.js +2 -1
- package/build/gallery/edit.js.map +1 -1
- package/build/gallery/gallery.js +1 -1
- package/build/gallery/gallery.js.map +1 -1
- package/build/gallery/shared.js +2 -2
- package/build/gallery/shared.js.map +1 -1
- package/build/gallery/use-get-media.js +2 -1
- package/build/gallery/use-get-media.js.map +1 -1
- package/build/gallery/use-short-code-transform.js +19 -18
- package/build/gallery/use-short-code-transform.js.map +1 -1
- package/build/gallery/v1/gallery.js +1 -1
- package/build/gallery/v1/gallery.js.map +1 -1
- package/build/heading/edit.js +6 -2
- package/build/heading/edit.js.map +1 -1
- package/build/heading/index.js +1 -0
- package/build/heading/index.js.map +1 -1
- package/build/heading/transforms.js +1 -0
- package/build/heading/transforms.js.map +1 -1
- package/build/image/edit.js +5 -2
- package/build/image/edit.js.map +1 -1
- package/build/image/edit.native.js +0 -1
- package/build/image/edit.native.js.map +1 -1
- package/build/image/image.js +1 -1
- package/build/image/image.js.map +1 -1
- package/build/index.js +46 -10
- package/build/index.js.map +1 -1
- package/build/is-block-metadata-experimental.js +18 -0
- package/build/is-block-metadata-experimental.js.map +1 -0
- package/build/latest-posts/edit.js +30 -4
- package/build/latest-posts/edit.js.map +1 -1
- package/build/list/transforms.js +6 -0
- package/build/list/transforms.js.map +1 -1
- package/build/list/v2/edit.js +2 -1
- package/build/list/v2/edit.js.map +1 -1
- package/build/list/v2/migrate.js +1 -0
- package/build/list/v2/migrate.js.map +1 -1
- package/build/list/v2/transforms.js +46 -9
- package/build/list/v2/transforms.js.map +1 -1
- package/build/list-item/edit.js +7 -9
- package/build/list-item/edit.js.map +1 -1
- package/build/list-item/hooks/index.js +24 -0
- package/build/list-item/hooks/index.js.map +1 -1
- package/build/list-item/hooks/use-backspace.js +59 -0
- package/build/list-item/hooks/use-backspace.js.map +1 -0
- package/build/list-item/hooks/use-enter.js +6 -9
- package/build/list-item/hooks/use-enter.js.map +1 -1
- package/build/list-item/hooks/use-indent-list-item.js +33 -39
- package/build/list-item/hooks/use-indent-list-item.js.map +1 -1
- package/build/list-item/hooks/use-space.js +54 -0
- package/build/list-item/hooks/use-space.js.map +1 -0
- package/build/list-item/hooks/use-split.js +30 -0
- package/build/list-item/hooks/use-split.js.map +1 -0
- package/build/list-item/index.js +1 -0
- package/build/list-item/index.js.map +1 -1
- package/build/list-item/utils.js +1 -1
- package/build/list-item/utils.js.map +1 -1
- package/build/media-text/edit.native.js +2 -1
- package/build/media-text/edit.native.js.map +1 -1
- package/build/media-text/media-container.native.js +2 -4
- package/build/media-text/media-container.native.js.map +1 -1
- package/build/media-text/transforms.js +137 -8
- package/build/media-text/transforms.js.map +1 -1
- package/build/navigation/edit/index.js +86 -81
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/inner-blocks.js +1 -5
- package/build/navigation/edit/inner-blocks.js.map +1 -1
- package/build/navigation/use-navigation-entities.js +3 -3
- package/build/navigation/use-navigation-entities.js.map +1 -1
- package/build/navigation-link/fallback-variations.js +1 -1
- package/build/navigation-link/fallback-variations.js.map +1 -1
- package/build/navigation-link/hooks.js +1 -1
- package/build/navigation-link/hooks.js.map +1 -1
- package/build/page-list/convert-to-links-modal.js +1 -1
- package/build/page-list/convert-to-links-modal.js.map +1 -1
- package/build/page-list/edit.js +1 -1
- package/build/page-list/edit.js.map +1 -1
- package/build/post-author/edit.js +1 -1
- package/build/post-author/edit.js.map +1 -1
- package/build/post-author-name/index.js +1 -0
- package/build/post-author-name/index.js.map +1 -1
- package/build/post-comment/index.js +1 -0
- package/build/post-comment/index.js.map +1 -1
- package/build/post-comments/edit.js +34 -16
- package/build/post-comments/edit.js.map +1 -1
- package/build/post-comments-count/index.js +1 -0
- package/build/post-comments-count/index.js.map +1 -1
- package/build/post-comments-form/form.js +1 -1
- package/build/post-comments-form/form.js.map +1 -1
- package/build/post-comments-link/index.js +1 -0
- package/build/post-comments-link/index.js.map +1 -1
- package/build/post-featured-image/edit.js +1 -1
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/post-template/edit.js +7 -2
- package/build/post-template/edit.js.map +1 -1
- package/build/post-terms/edit.js +11 -2
- package/build/post-terms/edit.js.map +1 -1
- package/build/post-terms/hooks.js +33 -0
- package/build/post-terms/hooks.js.map +1 -0
- package/build/post-terms/index.js +12 -5
- package/build/post-terms/index.js.map +1 -1
- package/build/post-title/index.js +1 -1
- package/build/post-title/index.js.map +1 -1
- package/build/pullquote/edit.js +1 -1
- package/build/pullquote/edit.js.map +1 -1
- package/build/pullquote/edit.native.js +1 -1
- package/build/pullquote/edit.native.js.map +1 -1
- package/build/query/edit/inspector-controls/index.js +26 -17
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/edit/inspector-controls/parent-control.js +148 -0
- package/build/query/edit/inspector-controls/parent-control.js.map +1 -0
- package/build/query/edit/inspector-controls/sticky-control.js +41 -0
- package/build/query/edit/inspector-controls/sticky-control.js.map +1 -0
- package/build/query/index.js +2 -1
- package/build/query/index.js.map +1 -1
- package/build/query/utils.js +28 -2
- package/build/query/utils.js.map +1 -1
- package/build/query-title/index.js +1 -1
- package/build/query-title/index.js.map +1 -1
- package/build/query-title/variations.js +1 -1
- package/build/query-title/variations.js.map +1 -1
- package/build/quote/edit.js +3 -2
- package/build/quote/edit.js.map +1 -1
- package/build/quote/v2/edit.js +1 -1
- package/build/quote/v2/edit.js.map +1 -1
- package/build/search/edit.js +1 -0
- package/build/search/edit.js.map +1 -1
- package/build/site-logo/edit.js +1 -1
- package/build/site-logo/edit.js.map +1 -1
- package/build/table/edit.js +15 -2
- package/build/table/edit.js.map +1 -1
- package/build/table-of-contents/edit.js +138 -66
- package/build/table-of-contents/edit.js.map +1 -1
- package/build/table-of-contents/index.js +13 -3
- package/build/table-of-contents/index.js.map +1 -1
- package/build/table-of-contents/list.js +16 -9
- package/build/table-of-contents/list.js.map +1 -1
- package/build/table-of-contents/save.js +40 -0
- package/build/table-of-contents/save.js.map +1 -0
- package/build/table-of-contents/utils.js +11 -77
- package/build/table-of-contents/utils.js.map +1 -1
- package/build/template-part/edit/index.js +7 -3
- package/build/template-part/edit/index.js.map +1 -1
- package/build/template-part/edit/inner-blocks.js +3 -8
- package/build/template-part/edit/inner-blocks.js.map +1 -1
- package/build/video/edit.js +1 -1
- package/build/video/edit.js.map +1 -1
- package/build-module/audio/edit.js +2 -2
- package/build-module/audio/edit.js.map +1 -1
- package/build-module/block/edit.js +11 -10
- package/build-module/block/edit.js.map +1 -1
- package/build-module/button/index.js +1 -0
- package/build-module/button/index.js.map +1 -1
- package/build-module/categories/edit.js +1 -1
- package/build-module/categories/edit.js.map +1 -1
- package/build-module/categories/index.js +1 -1
- package/build-module/comment-author-avatar/index.js +1 -0
- package/build-module/comment-author-avatar/index.js.map +1 -1
- package/build-module/comments-title/deprecated.js +102 -0
- package/build-module/comments-title/deprecated.js.map +1 -0
- package/build-module/comments-title/edit.js +38 -40
- package/build-module/comments-title/edit.js.map +1 -1
- package/build-module/comments-title/index.js +4 -8
- package/build-module/comments-title/index.js.map +1 -1
- package/build-module/cover/controls.native.js +2 -3
- package/build-module/cover/controls.native.js.map +1 -1
- package/build-module/cover/edit/block-controls.js +104 -0
- package/build-module/cover/edit/block-controls.js.map +1 -0
- package/build-module/cover/edit/cover-placeholder.js +38 -0
- package/build-module/cover/edit/cover-placeholder.js.map +1 -0
- package/build-module/cover/edit/index.js +307 -0
- package/build-module/cover/edit/index.js.map +1 -0
- package/build-module/cover/edit/inspector-controls.js +215 -0
- package/build-module/cover/edit/inspector-controls.js.map +1 -0
- package/build-module/cover/edit/resizable-cover.js +55 -0
- package/build-module/cover/edit/resizable-cover.js.map +1 -0
- package/build-module/cover/{use-cover-is-dark.js → edit/use-cover-is-dark.js} +0 -0
- package/build-module/cover/edit/use-cover-is-dark.js.map +1 -0
- package/build-module/cover/edit.native.js +0 -1
- package/build-module/cover/edit.native.js.map +1 -1
- package/build-module/cover/focal-point-settings-button.native.js.map +1 -1
- package/build-module/cover/shared.js +7 -0
- package/build-module/cover/shared.js.map +1 -1
- package/build-module/embed/embed-preview.js +2 -2
- package/build-module/embed/embed-preview.js.map +1 -1
- package/build-module/file/edit.native.js +0 -1
- package/build-module/file/edit.native.js.map +1 -1
- package/build-module/gallery/edit.js +2 -1
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/gallery/gallery.js +2 -2
- package/build-module/gallery/gallery.js.map +1 -1
- package/build-module/gallery/shared.js +2 -2
- package/build-module/gallery/shared.js.map +1 -1
- package/build-module/gallery/use-get-media.js +2 -1
- package/build-module/gallery/use-get-media.js.map +1 -1
- package/build-module/gallery/use-short-code-transform.js +19 -18
- package/build-module/gallery/use-short-code-transform.js.map +1 -1
- package/build-module/gallery/v1/gallery.js +2 -2
- package/build-module/gallery/v1/gallery.js.map +1 -1
- package/build-module/heading/edit.js +6 -2
- package/build-module/heading/edit.js.map +1 -1
- package/build-module/heading/index.js +1 -0
- package/build-module/heading/index.js.map +1 -1
- package/build-module/heading/transforms.js +1 -0
- package/build-module/heading/transforms.js.map +1 -1
- package/build-module/image/edit.js +6 -3
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/edit.native.js +0 -1
- package/build-module/image/edit.native.js.map +1 -1
- package/build-module/image/image.js +2 -2
- package/build-module/image/image.js.map +1 -1
- package/build-module/index.js +42 -10
- package/build-module/index.js.map +1 -1
- package/build-module/is-block-metadata-experimental.js +16 -0
- package/build-module/is-block-metadata-experimental.js.map +1 -0
- package/build-module/latest-posts/edit.js +29 -5
- package/build-module/latest-posts/edit.js.map +1 -1
- package/build-module/list/transforms.js +6 -0
- package/build-module/list/transforms.js.map +1 -1
- package/build-module/list/v2/edit.js +2 -1
- package/build-module/list/v2/edit.js.map +1 -1
- package/build-module/list/v2/migrate.js +1 -3
- package/build-module/list/v2/migrate.js.map +1 -1
- package/build-module/list/v2/transforms.js +46 -9
- package/build-module/list/v2/transforms.js.map +1 -1
- package/build-module/list-item/edit.js +8 -9
- package/build-module/list-item/edit.js.map +1 -1
- package/build-module/list-item/hooks/index.js +3 -0
- package/build-module/list-item/hooks/index.js.map +1 -1
- package/build-module/list-item/hooks/use-backspace.js +44 -0
- package/build-module/list-item/hooks/use-backspace.js.map +1 -0
- package/build-module/list-item/hooks/use-enter.js +6 -9
- package/build-module/list-item/hooks/use-enter.js.map +1 -1
- package/build-module/list-item/hooks/use-indent-list-item.js +33 -38
- package/build-module/list-item/hooks/use-indent-list-item.js.map +1 -1
- package/build-module/list-item/hooks/use-space.js +40 -0
- package/build-module/list-item/hooks/use-space.js.map +1 -0
- package/build-module/list-item/hooks/use-split.js +19 -0
- package/build-module/list-item/hooks/use-split.js.map +1 -0
- package/build-module/list-item/index.js +1 -0
- package/build-module/list-item/index.js.map +1 -1
- package/build-module/list-item/utils.js +1 -1
- package/build-module/list-item/utils.js.map +1 -1
- package/build-module/media-text/edit.native.js +2 -1
- package/build-module/media-text/edit.native.js.map +1 -1
- package/build-module/media-text/media-container.native.js +2 -4
- package/build-module/media-text/media-container.native.js.map +1 -1
- package/build-module/media-text/transforms.js +137 -8
- package/build-module/media-text/transforms.js.map +1 -1
- package/build-module/navigation/edit/index.js +87 -82
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/inner-blocks.js +2 -6
- package/build-module/navigation/edit/inner-blocks.js.map +1 -1
- package/build-module/navigation/use-navigation-entities.js +1 -1
- package/build-module/navigation/use-navigation-entities.js.map +1 -1
- package/build-module/navigation-link/fallback-variations.js +1 -1
- package/build-module/navigation-link/fallback-variations.js.map +1 -1
- package/build-module/navigation-link/hooks.js +2 -2
- package/build-module/navigation-link/hooks.js.map +1 -1
- package/build-module/page-list/convert-to-links-modal.js +1 -1
- package/build-module/page-list/convert-to-links-modal.js.map +1 -1
- package/build-module/page-list/edit.js +1 -1
- package/build-module/page-list/edit.js.map +1 -1
- package/build-module/post-author/edit.js +1 -1
- package/build-module/post-author/edit.js.map +1 -1
- package/build-module/post-author-name/index.js +1 -0
- package/build-module/post-author-name/index.js.map +1 -1
- package/build-module/post-comment/index.js +1 -0
- package/build-module/post-comment/index.js.map +1 -1
- package/build-module/post-comments/edit.js +35 -16
- package/build-module/post-comments/edit.js.map +1 -1
- package/build-module/post-comments-count/index.js +1 -0
- package/build-module/post-comments-count/index.js.map +1 -1
- package/build-module/post-comments-form/form.js +1 -1
- package/build-module/post-comments-form/form.js.map +1 -1
- package/build-module/post-comments-link/index.js +1 -0
- package/build-module/post-comments-link/index.js.map +1 -1
- package/build-module/post-featured-image/edit.js +1 -1
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/post-template/edit.js +7 -2
- package/build-module/post-template/edit.js.map +1 -1
- package/build-module/post-terms/edit.js +10 -3
- package/build-module/post-terms/edit.js.map +1 -1
- package/build-module/post-terms/hooks.js +25 -0
- package/build-module/post-terms/hooks.js.map +1 -0
- package/build-module/post-terms/index.js +10 -8
- package/build-module/post-terms/index.js.map +1 -1
- package/build-module/post-title/index.js +1 -1
- package/build-module/post-title/index.js.map +1 -1
- package/build-module/pullquote/edit.js +2 -2
- package/build-module/pullquote/edit.js.map +1 -1
- package/build-module/pullquote/edit.native.js +2 -2
- package/build-module/pullquote/edit.native.js.map +1 -1
- package/build-module/query/edit/inspector-controls/index.js +24 -17
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/query/edit/inspector-controls/parent-control.js +135 -0
- package/build-module/query/edit/inspector-controls/parent-control.js.map +1 -0
- package/build-module/query/edit/inspector-controls/sticky-control.js +31 -0
- package/build-module/query/edit/inspector-controls/sticky-control.js.map +1 -0
- package/build-module/query/index.js +2 -1
- package/build-module/query/index.js.map +1 -1
- package/build-module/query/utils.js +21 -0
- package/build-module/query/utils.js.map +1 -1
- package/build-module/query-title/index.js +1 -1
- package/build-module/query-title/index.js.map +1 -1
- package/build-module/query-title/variations.js +2 -2
- package/build-module/query-title/variations.js.map +1 -1
- package/build-module/quote/edit.js +4 -3
- package/build-module/quote/edit.js.map +1 -1
- package/build-module/quote/v2/edit.js +2 -2
- package/build-module/quote/v2/edit.js.map +1 -1
- package/build-module/search/edit.js +1 -0
- package/build-module/search/edit.js.map +1 -1
- package/build-module/site-logo/edit.js +1 -1
- package/build-module/site-logo/edit.js.map +1 -1
- package/build-module/table/edit.js +17 -4
- package/build-module/table/edit.js.map +1 -1
- package/build-module/table-of-contents/edit.js +136 -68
- package/build-module/table-of-contents/edit.js.map +1 -1
- package/build-module/table-of-contents/index.js +12 -3
- package/build-module/table-of-contents/index.js.map +1 -1
- package/build-module/table-of-contents/list.js +18 -10
- package/build-module/table-of-contents/list.js.map +1 -1
- package/build-module/table-of-contents/save.js +28 -0
- package/build-module/table-of-contents/save.js.map +1 -0
- package/build-module/table-of-contents/utils.js +11 -73
- package/build-module/table-of-contents/utils.js.map +1 -1
- package/build-module/template-part/edit/index.js +8 -4
- package/build-module/template-part/edit/index.js.map +1 -1
- package/build-module/template-part/edit/inner-blocks.js +4 -9
- package/build-module/template-part/edit/inner-blocks.js.map +1 -1
- package/build-module/video/edit.js +2 -2
- package/build-module/video/edit.js.map +1 -1
- package/build-style/editor-rtl.css +4 -6
- package/build-style/editor.css +4 -6
- package/build-style/image/editor-rtl.css +1 -1
- package/build-style/image/editor.css +1 -1
- package/build-style/post-comments/style-rtl.css +22 -0
- package/build-style/post-comments/style.css +22 -0
- package/build-style/post-comments-form/style-rtl.css +1 -3
- package/build-style/post-comments-form/style.css +1 -3
- package/build-style/separator/editor-rtl.css +1 -0
- package/build-style/separator/editor.css +1 -0
- package/build-style/style-rtl.css +23 -3
- package/build-style/style.css +23 -3
- package/build-style/video/editor-rtl.css +2 -5
- package/build-style/video/editor.css +2 -5
- package/build-types/table-of-contents/list.d.ts +12 -0
- package/build-types/table-of-contents/list.d.ts.map +1 -0
- package/build-types/table-of-contents/utils.d.ts +24 -0
- package/build-types/table-of-contents/utils.d.ts.map +1 -0
- package/package.json +30 -29
- package/src/audio/edit.js +4 -2
- package/src/avatar/block.json +0 -1
- package/src/avatar/index.php +2 -2
- package/src/block/edit.js +39 -42
- package/src/block/test/edit.native.js +1 -1
- package/src/button/block.json +1 -0
- package/src/categories/block.json +1 -1
- package/src/categories/edit.js +1 -1
- package/src/comment-author-avatar/block.json +1 -0
- package/src/comments-title/block.json +0 -6
- package/src/comments-title/deprecated.js +34 -0
- package/src/comments-title/edit.js +44 -100
- package/src/comments-title/index.js +3 -1
- package/src/comments-title/index.php +41 -23
- package/src/cover/controls.native.js +1 -2
- package/src/cover/edit/block-controls.js +119 -0
- package/src/cover/edit/cover-placeholder.js +39 -0
- package/src/cover/edit/index.js +381 -0
- package/src/cover/edit/inspector-controls.js +286 -0
- package/src/cover/edit/resizable-cover.js +55 -0
- package/src/cover/{use-cover-is-dark.js → edit/use-cover-is-dark.js} +0 -0
- package/src/cover/edit.native.js +0 -1
- package/src/cover/editor.scss +1 -1
- package/src/cover/focal-point-settings-button.native.js +1 -1
- package/src/cover/index.php +20 -37
- package/src/cover/shared.js +4 -0
- package/src/cover/test/block-controls.js +62 -0
- package/src/embed/embed-preview.js +4 -2
- package/src/file/edit.native.js +0 -1
- package/src/gallery/edit.js +2 -1
- package/src/gallery/gallery.js +2 -2
- package/src/gallery/shared.js +3 -2
- package/src/gallery/use-get-media.js +2 -1
- package/src/gallery/use-short-code-transform.js +19 -16
- package/src/gallery/v1/gallery.js +2 -2
- package/src/heading/block.json +1 -0
- package/src/heading/edit.js +5 -2
- package/src/image/edit.js +9 -1
- package/src/image/edit.native.js +0 -1
- package/src/image/editor.scss +1 -1
- package/src/image/image.js +8 -2
- package/src/image/test/edit.native.js +7 -7
- package/src/index.js +50 -27
- package/src/is-block-metadata-experimental.js +19 -0
- package/src/latest-posts/edit.js +27 -2
- package/src/latest-posts/index.php +12 -6
- package/src/list/transforms.js +7 -0
- package/src/list/v2/edit.js +1 -0
- package/src/list/v2/migrate.js +1 -1
- package/src/list/v2/transforms.js +35 -0
- package/src/list-item/block.json +2 -1
- package/src/list-item/edit.js +17 -10
- package/src/list-item/hooks/index.js +3 -0
- package/src/list-item/hooks/use-backspace.js +52 -0
- package/src/list-item/hooks/use-enter.js +9 -16
- package/src/list-item/hooks/use-indent-list-item.js +50 -63
- package/src/list-item/hooks/use-space.js +48 -0
- package/src/list-item/hooks/use-split.js +24 -0
- package/src/list-item/utils.js +1 -1
- package/src/media-text/edit.native.js +3 -1
- package/src/media-text/media-container.native.js +2 -4
- package/src/media-text/transforms.js +154 -0
- package/src/navigation/edit/index.js +175 -169
- package/src/navigation/edit/inner-blocks.js +1 -8
- package/src/navigation/index.php +40 -0
- package/src/navigation/use-navigation-entities.js +1 -1
- package/src/navigation-link/fallback-variations.js +1 -1
- package/src/navigation-link/hooks.js +2 -2
- package/src/navigation-link/test/__snapshots__/hooks.js.snap +4 -4
- package/src/page-list/convert-to-links-modal.js +1 -1
- package/src/page-list/edit.js +1 -4
- package/src/post-author/edit.js +24 -22
- package/src/post-author-name/block.json +1 -0
- package/src/post-comment/block.json +1 -0
- package/src/post-comments/edit.js +54 -22
- package/src/post-comments/style.scss +26 -0
- package/src/post-comments-count/block.json +1 -0
- package/src/post-comments-form/form.js +1 -4
- package/src/post-comments-form/style.scss +1 -4
- package/src/post-comments-link/block.json +1 -0
- package/src/post-featured-image/edit.js +1 -1
- package/src/post-template/edit.js +5 -0
- package/src/post-template/index.php +30 -0
- package/src/post-terms/edit.js +19 -0
- package/src/post-terms/hooks.js +27 -0
- package/src/post-terms/index.js +14 -7
- package/src/post-terms/index.php +40 -2
- package/src/post-title/index.js +1 -1
- package/src/pullquote/edit.js +2 -2
- package/src/pullquote/edit.native.js +2 -2
- package/src/query/block.json +2 -1
- package/src/query/edit/inspector-controls/index.js +25 -11
- package/src/query/edit/inspector-controls/parent-control.js +133 -0
- package/src/query/edit/inspector-controls/sticky-control.js +25 -0
- package/src/query/utils.js +22 -0
- package/src/query-title/index.js +1 -1
- package/src/query-title/variations.js +2 -2
- package/src/quote/edit.js +5 -2
- package/src/quote/v2/edit.js +4 -2
- package/src/search/edit.js +1 -0
- package/src/search/index.php +1 -1
- package/src/separator/editor.scss +1 -0
- package/src/site-logo/edit.js +1 -1
- package/src/table/edit.js +19 -4
- package/src/table-of-contents/block.json +9 -2
- package/src/table-of-contents/edit.js +155 -75
- package/src/table-of-contents/index.js +2 -0
- package/src/table-of-contents/list.tsx +46 -0
- package/src/table-of-contents/save.js +25 -0
- package/src/table-of-contents/utils.ts +71 -0
- package/src/tag-cloud/block.json +1 -1
- package/src/template-part/edit/index.js +25 -15
- package/src/template-part/edit/inner-blocks.js +2 -10
- package/src/video/edit.js +4 -2
- package/src/video/editor.scss +3 -6
- package/test/babel-plugin.js +67 -0
- package/tsconfig.json +11 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/build/cover/edit.js +0 -598
- package/build/cover/edit.js.map +0 -1
- package/build/cover/use-cover-is-dark.js.map +0 -1
- package/build/post-terms/variations.js +0 -37
- package/build/post-terms/variations.js.map +0 -1
- package/build-module/cover/edit.js +0 -575
- package/build-module/cover/edit.js.map +0 -1
- package/build-module/cover/use-cover-is-dark.js.map +0 -1
- package/build-module/post-terms/variations.js +0 -27
- package/build-module/post-terms/variations.js.map +0 -1
- package/src/cover/edit.js +0 -757
- package/src/post-terms/variations.js +0 -28
- package/src/table-of-contents/index.php +0 -346
- package/src/table-of-contents/list.js +0 -28
- package/src/table-of-contents/utils.js +0 -126
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _element = require("@wordpress/element");
|
|
9
|
+
|
|
10
|
+
var _i18n = require("@wordpress/i18n");
|
|
11
|
+
|
|
12
|
+
var _components = require("@wordpress/components");
|
|
13
|
+
|
|
14
|
+
var _data = require("@wordpress/data");
|
|
15
|
+
|
|
16
|
+
var _coreData = require("@wordpress/core-data");
|
|
17
|
+
|
|
18
|
+
var _compose = require("@wordpress/compose");
|
|
19
|
+
|
|
20
|
+
var _utils = require("../../utils");
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* WordPress dependencies
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Internal dependencies
|
|
28
|
+
*/
|
|
29
|
+
const EMPTY_ARRAY = [];
|
|
30
|
+
const BASE_QUERY = {
|
|
31
|
+
order: 'asc',
|
|
32
|
+
_fields: 'id,title',
|
|
33
|
+
context: 'view'
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
function ParentControl(_ref) {
|
|
37
|
+
let {
|
|
38
|
+
parents,
|
|
39
|
+
postType,
|
|
40
|
+
onChange
|
|
41
|
+
} = _ref;
|
|
42
|
+
const [search, setSearch] = (0, _element.useState)('');
|
|
43
|
+
const [value, setValue] = (0, _element.useState)(EMPTY_ARRAY);
|
|
44
|
+
const [suggestions, setSuggestions] = (0, _element.useState)(EMPTY_ARRAY);
|
|
45
|
+
const debouncedSearch = (0, _compose.useDebounce)(setSearch, 250);
|
|
46
|
+
const {
|
|
47
|
+
searchResults,
|
|
48
|
+
searchHasResolved
|
|
49
|
+
} = (0, _data.useSelect)(select => {
|
|
50
|
+
if (!search) {
|
|
51
|
+
return {
|
|
52
|
+
searchResults: EMPTY_ARRAY,
|
|
53
|
+
searchHasResolved: true
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const {
|
|
58
|
+
getEntityRecords,
|
|
59
|
+
hasFinishedResolution
|
|
60
|
+
} = select(_coreData.store);
|
|
61
|
+
const selectorArgs = ['postType', postType, { ...BASE_QUERY,
|
|
62
|
+
search,
|
|
63
|
+
orderby: 'relevance',
|
|
64
|
+
exclude: parents,
|
|
65
|
+
per_page: 20
|
|
66
|
+
}];
|
|
67
|
+
return {
|
|
68
|
+
searchResults: getEntityRecords(...selectorArgs),
|
|
69
|
+
searchHasResolved: hasFinishedResolution('getEntityRecords', selectorArgs)
|
|
70
|
+
};
|
|
71
|
+
}, [search, parents]);
|
|
72
|
+
const currentParents = (0, _data.useSelect)(select => {
|
|
73
|
+
if (!(parents !== null && parents !== void 0 && parents.length)) return EMPTY_ARRAY;
|
|
74
|
+
const {
|
|
75
|
+
getEntityRecords
|
|
76
|
+
} = select(_coreData.store);
|
|
77
|
+
return getEntityRecords('postType', postType, { ...BASE_QUERY,
|
|
78
|
+
include: parents,
|
|
79
|
+
per_page: parents.length
|
|
80
|
+
});
|
|
81
|
+
}, [parents]); // Update the `value` state only after the selectors are resolved
|
|
82
|
+
// to avoid emptying the input when we're changing parents.
|
|
83
|
+
|
|
84
|
+
(0, _element.useEffect)(() => {
|
|
85
|
+
if (!(parents !== null && parents !== void 0 && parents.length)) {
|
|
86
|
+
setValue(EMPTY_ARRAY);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (!(currentParents !== null && currentParents !== void 0 && currentParents.length)) return;
|
|
90
|
+
const currentParentsInfo = (0, _utils.getEntitiesInfo)((0, _utils.mapToIHasNameAndId)(currentParents, 'title.rendered')); // Returns only the existing entity ids. This prevents the component
|
|
91
|
+
// from crashing in the editor, when non existing ids are provided.
|
|
92
|
+
|
|
93
|
+
const sanitizedValue = parents.reduce((accumulator, id) => {
|
|
94
|
+
const entity = currentParentsInfo.mapById[id];
|
|
95
|
+
|
|
96
|
+
if (entity) {
|
|
97
|
+
accumulator.push({
|
|
98
|
+
id,
|
|
99
|
+
value: entity.name
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return accumulator;
|
|
104
|
+
}, []);
|
|
105
|
+
setValue(sanitizedValue);
|
|
106
|
+
}, [parents, currentParents]);
|
|
107
|
+
const entitiesInfo = (0, _element.useMemo)(() => {
|
|
108
|
+
if (!(searchResults !== null && searchResults !== void 0 && searchResults.length)) return EMPTY_ARRAY;
|
|
109
|
+
return (0, _utils.getEntitiesInfo)((0, _utils.mapToIHasNameAndId)(searchResults, 'title.rendered'));
|
|
110
|
+
}, [searchResults]); // Update suggestions only when the query has resolved.
|
|
111
|
+
|
|
112
|
+
(0, _element.useEffect)(() => {
|
|
113
|
+
if (!searchHasResolved) return;
|
|
114
|
+
setSuggestions(entitiesInfo.names);
|
|
115
|
+
}, [entitiesInfo.names, searchHasResolved]);
|
|
116
|
+
|
|
117
|
+
const getIdByValue = (entitiesMappedByName, entity) => {
|
|
118
|
+
var _entitiesMappedByName;
|
|
119
|
+
|
|
120
|
+
const id = (entity === null || entity === void 0 ? void 0 : entity.id) || (entitiesMappedByName === null || entitiesMappedByName === void 0 ? void 0 : (_entitiesMappedByName = entitiesMappedByName[entity]) === null || _entitiesMappedByName === void 0 ? void 0 : _entitiesMappedByName.id);
|
|
121
|
+
if (id) return id;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
const onParentChange = newValue => {
|
|
125
|
+
const ids = Array.from(newValue.reduce((accumulator, entity) => {
|
|
126
|
+
// Verify that new values point to existing entities.
|
|
127
|
+
const id = getIdByValue(entitiesInfo.mapByName, entity);
|
|
128
|
+
if (id) accumulator.add(id);
|
|
129
|
+
return accumulator;
|
|
130
|
+
}, new Set()));
|
|
131
|
+
setSuggestions(EMPTY_ARRAY);
|
|
132
|
+
onChange({
|
|
133
|
+
parents: ids
|
|
134
|
+
});
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
return (0, _element.createElement)(_components.FormTokenField, {
|
|
138
|
+
label: (0, _i18n.__)('Parents'),
|
|
139
|
+
value: value,
|
|
140
|
+
onInputChange: debouncedSearch,
|
|
141
|
+
suggestions: suggestions,
|
|
142
|
+
onChange: onParentChange
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
var _default = ParentControl;
|
|
147
|
+
exports.default = _default;
|
|
148
|
+
//# sourceMappingURL=parent-control.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/query/edit/inspector-controls/parent-control.js"],"names":["EMPTY_ARRAY","BASE_QUERY","order","_fields","context","ParentControl","parents","postType","onChange","search","setSearch","value","setValue","suggestions","setSuggestions","debouncedSearch","searchResults","searchHasResolved","select","getEntityRecords","hasFinishedResolution","coreStore","selectorArgs","orderby","exclude","per_page","currentParents","length","include","currentParentsInfo","sanitizedValue","reduce","accumulator","id","entity","mapById","push","name","entitiesInfo","names","getIdByValue","entitiesMappedByName","onParentChange","newValue","ids","Array","from","mapByName","add","Set"],"mappings":";;;;;;;AAOA;;AAJA;;AACA;;AACA;;AACA;;AAEA;;AAKA;;AAbA;AACA;AACA;;AAQA;AACA;AACA;AAGA,MAAMA,WAAW,GAAG,EAApB;AACA,MAAMC,UAAU,GAAG;AAClBC,EAAAA,KAAK,EAAE,KADW;AAElBC,EAAAA,OAAO,EAAE,UAFS;AAGlBC,EAAAA,OAAO,EAAE;AAHS,CAAnB;;AAMA,SAASC,aAAT,OAA0D;AAAA,MAAlC;AAAEC,IAAAA,OAAF;AAAWC,IAAAA,QAAX;AAAqBC,IAAAA;AAArB,GAAkC;AACzD,QAAM,CAAEC,MAAF,EAAUC,SAAV,IAAwB,uBAAU,EAAV,CAA9B;AACA,QAAM,CAAEC,KAAF,EAASC,QAAT,IAAsB,uBAAUZ,WAAV,CAA5B;AACA,QAAM,CAAEa,WAAF,EAAeC,cAAf,IAAkC,uBAAUd,WAAV,CAAxC;AACA,QAAMe,eAAe,GAAG,0BAAaL,SAAb,EAAwB,GAAxB,CAAxB;AACA,QAAM;AAAEM,IAAAA,aAAF;AAAiBC,IAAAA;AAAjB,MAAuC,qBAC1CC,MAAF,IAAc;AACb,QAAK,CAAET,MAAP,EAAgB;AACf,aAAO;AAAEO,QAAAA,aAAa,EAAEhB,WAAjB;AAA8BiB,QAAAA,iBAAiB,EAAE;AAAjD,OAAP;AACA;;AACD,UAAM;AAAEE,MAAAA,gBAAF;AAAoBC,MAAAA;AAApB,QAA8CF,MAAM,CACzDG,eADyD,CAA1D;AAGA,UAAMC,YAAY,GAAG,CACpB,UADoB,EAEpBf,QAFoB,EAGpB,EACC,GAAGN,UADJ;AAECQ,MAAAA,MAFD;AAGCc,MAAAA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E,GAAGO,YAAY,CAAEF,YAAY,CAACS,SAAf,EAA0Bb,MAA1B,CAAvB;AACA,UAAKD,EAAL,EAAUD,WAAW,CAACgB,GAAZ,CAAiBf,EAAjB;AACV,aAAOD,WAAP;AACA,KALD,EAKG,IAAIiB,GAAJ,EALH,CADW,CAAZ;AAQAnC,IAAAA,cAAc,CAAEd,WAAF,CAAd;AACAQ,IAAAA,QAAQ,CAAE;AAAEF,MAAAA,OAAO,EAAEsC;AAAX,KAAF,CAAR;AACA,GAXD;;AAYA,SACC,4BAAC,0BAAD;AACC,IAAA,KAAK,EAAG,cAAI,SAAJ,CADT;AAEC,IAAA,KAAK,EAAGjC,KAFT;AAGC,IAAA,aAAa,EAAGI,eAHjB;AAIC,IAAA,WAAW,EAAGF,WAJf;AAKC,IAAA,QAAQ,EAAG6B;AALZ,IADD;AASA;;eAEcrC,a","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 } = select(\n\t\t\t\tcoreStore\n\t\t\t);\n\t\t\tconst selectorArgs = [\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\t{\n\t\t\t\t\t...BASE_QUERY,\n\t\t\t\t\tsearch,\n\t\t\t\t\torderby: 'relevance',\n\t\t\t\t\texclude: parents,\n\t\t\t\t\tper_page: 20,\n\t\t\t\t},\n\t\t\t];\n\t\t\treturn {\n\t\t\t\tsearchResults: getEntityRecords( ...selectorArgs ),\n\t\t\t\tsearchHasResolved: hasFinishedResolution(\n\t\t\t\t\t'getEntityRecords',\n\t\t\t\t\tselectorArgs\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[ search, parents ]\n\t);\n\tconst currentParents = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! parents?.length ) return EMPTY_ARRAY;\n\t\t\tconst { getEntityRecords } = select( coreStore );\n\t\t\treturn getEntityRecords( 'postType', postType, {\n\t\t\t\t...BASE_QUERY,\n\t\t\t\tinclude: parents,\n\t\t\t\tper_page: parents.length,\n\t\t\t} );\n\t\t},\n\t\t[ parents ]\n\t);\n\t// Update the `value` state only after the selectors are resolved\n\t// to avoid emptying the input when we're changing parents.\n\tuseEffect( () => {\n\t\tif ( ! parents?.length ) {\n\t\t\tsetValue( EMPTY_ARRAY );\n\t\t}\n\t\tif ( ! currentParents?.length ) return;\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 ) return EMPTY_ARRAY;\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 ) return;\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 ) return id;\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 ) accumulator.add( id );\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/>\n\t);\n}\n\nexport default ParentControl;\n"]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = StickyControl;
|
|
7
|
+
|
|
8
|
+
var _element = require("@wordpress/element");
|
|
9
|
+
|
|
10
|
+
var _components = require("@wordpress/components");
|
|
11
|
+
|
|
12
|
+
var _i18n = require("@wordpress/i18n");
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* WordPress dependencies
|
|
16
|
+
*/
|
|
17
|
+
const stickyOptions = [{
|
|
18
|
+
label: (0, _i18n.__)('Include'),
|
|
19
|
+
value: ''
|
|
20
|
+
}, {
|
|
21
|
+
label: (0, _i18n.__)('Exclude'),
|
|
22
|
+
value: 'exclude'
|
|
23
|
+
}, {
|
|
24
|
+
label: (0, _i18n.__)('Only'),
|
|
25
|
+
value: 'only'
|
|
26
|
+
}];
|
|
27
|
+
|
|
28
|
+
function StickyControl(_ref) {
|
|
29
|
+
let {
|
|
30
|
+
value,
|
|
31
|
+
onChange
|
|
32
|
+
} = _ref;
|
|
33
|
+
return (0, _element.createElement)(_components.SelectControl, {
|
|
34
|
+
label: (0, _i18n.__)('Sticky posts'),
|
|
35
|
+
options: stickyOptions,
|
|
36
|
+
value: value,
|
|
37
|
+
onChange: onChange,
|
|
38
|
+
help: (0, _i18n.__)('Blog posts can be "stickied", a feature that places them at the top of the front page of posts, keeping it there until new sticky posts are published.')
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=sticky-control.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/query/edit/inspector-controls/sticky-control.js"],"names":["stickyOptions","label","value","StickyControl","onChange"],"mappings":";;;;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;AAIA,MAAMA,aAAa,GAAG,CACrB;AAAEC,EAAAA,KAAK,EAAE,cAAI,SAAJ,CAAT;AAA0BC,EAAAA,KAAK,EAAE;AAAjC,CADqB,EAErB;AAAED,EAAAA,KAAK,EAAE,cAAI,SAAJ,CAAT;AAA0BC,EAAAA,KAAK,EAAE;AAAjC,CAFqB,EAGrB;AAAED,EAAAA,KAAK,EAAE,cAAI,MAAJ,CAAT;AAAuBC,EAAAA,KAAK,EAAE;AAA9B,CAHqB,CAAtB;;AAMe,SAASC,aAAT,OAA8C;AAAA,MAAtB;AAAED,IAAAA,KAAF;AAASE,IAAAA;AAAT,GAAsB;AAC5D,SACC,4BAAC,yBAAD;AACC,IAAA,KAAK,EAAG,cAAI,cAAJ,CADT;AAEC,IAAA,OAAO,EAAGJ,aAFX;AAGC,IAAA,KAAK,EAAGE,KAHT;AAIC,IAAA,QAAQ,EAAGE,QAJZ;AAKC,IAAA,IAAI,EAAG,cACN,wJADM;AALR,IADD;AAWA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SelectControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nconst stickyOptions = [\n\t{ label: __( 'Include' ), value: '' },\n\t{ label: __( 'Exclude' ), value: 'exclude' },\n\t{ label: __( 'Only' ), value: 'only' },\n];\n\nexport default function StickyControl( { value, onChange } ) {\n\treturn (\n\t\t<SelectControl\n\t\t\tlabel={ __( 'Sticky posts' ) }\n\t\t\toptions={ stickyOptions }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\thelp={ __(\n\t\t\t\t'Blog posts can be \"stickied\", a feature that places them at the top of the front page of posts, keeping it there until new sticky posts are published.'\n\t\t\t) }\n\t\t/>\n\t);\n}\n"]}
|
package/build/query/index.js
CHANGED
package/build/query/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/query/index.js"],"names":["name","metadata","settings","icon","edit","save","variations","deprecated","queryInspectorControls"],"mappings":";;;;;;;;;AAGA;;AACA;;AAMA;;AACA;;AACA;;AACA;;AACA;;AAdA;AACA;AACA;;AAIA;AACA;AACA
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/query/index.js"],"names":["name","metadata","settings","icon","edit","save","variations","deprecated","queryInspectorControls"],"mappings":";;;;;;;;;AAGA;;AACA;;AAMA;;AACA;;AACA;;AACA;;AACA;;AAdA;AACA;AACA;;AAIA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAGO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,WADuB;AAEvBC,EAAAA,IAAI,EAAJA,aAFuB;AAGvBC,EAAAA,IAAI,EAAJA,aAHuB;AAIvBC,EAAAA,UAAU,EAAVA,mBAJuB;AAKvBC,EAAAA,UAAU,EAAVA;AALuB,CAAjB,C,CAQP;AACA;;;AACA,sBAAW,kBAAX,EAA+B,YAA/B,EAA6CC,eAA7C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { loop as icon } from '@wordpress/icons';\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport metadata from './block.json';\nimport edit from './edit';\nimport save from './save';\nimport variations from './variations';\nimport deprecated from './deprecated';\nimport queryInspectorControls from './hooks';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\tsave,\n\tvariations,\n\tdeprecated,\n};\n\n// Importing this file includes side effects and is whitelisted\n// in block-library/package.json under `sideEffects`.\naddFilter( 'editor.BlockEdit', 'core/query', queryInspectorControls );\n"]}
|
package/build/query/utils.js
CHANGED
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.useTaxonomies = exports.usePostTypes = exports.getFirstQueryClientIdFromBlocks = exports.getEntitiesInfo = void 0;
|
|
6
|
+
exports.useTaxonomies = exports.usePostTypes = exports.mapToIHasNameAndId = exports.getFirstQueryClientIdFromBlocks = exports.getEntitiesInfo = void 0;
|
|
7
|
+
|
|
8
|
+
var _lodash = require("lodash");
|
|
7
9
|
|
|
8
10
|
var _data = require("@wordpress/data");
|
|
9
11
|
|
|
@@ -11,6 +13,12 @@ var _element = require("@wordpress/element");
|
|
|
11
13
|
|
|
12
14
|
var _coreData = require("@wordpress/core-data");
|
|
13
15
|
|
|
16
|
+
var _htmlEntities = require("@wordpress/html-entities");
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* External dependencies
|
|
20
|
+
*/
|
|
21
|
+
|
|
14
22
|
/**
|
|
15
23
|
* WordPress dependencies
|
|
16
24
|
*/
|
|
@@ -61,6 +69,24 @@ const getEntitiesInfo = entities => {
|
|
|
61
69
|
...mapping
|
|
62
70
|
};
|
|
63
71
|
};
|
|
72
|
+
/**
|
|
73
|
+
* Helper util to map records to add a `name` prop from a
|
|
74
|
+
* provided path, in order to handle all entities in the same
|
|
75
|
+
* fashion(implementing`IHasNameAndId` interface).
|
|
76
|
+
*
|
|
77
|
+
* @param {Object[]} entities The array of entities.
|
|
78
|
+
* @param {string} path The path to map a `name` property from the entity.
|
|
79
|
+
* @return {IHasNameAndId[]} An array of enitities that now implement the `IHasNameAndId` interface.
|
|
80
|
+
*/
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
exports.getEntitiesInfo = getEntitiesInfo;
|
|
84
|
+
|
|
85
|
+
const mapToIHasNameAndId = (entities, path) => {
|
|
86
|
+
return (entities || []).map(entity => ({ ...entity,
|
|
87
|
+
name: (0, _htmlEntities.decodeEntities)((0, _lodash.get)(entity, path))
|
|
88
|
+
}));
|
|
89
|
+
};
|
|
64
90
|
/**
|
|
65
91
|
* Returns a helper object that contains:
|
|
66
92
|
* 1. An `options` object from the available post types, to be passed to a `SelectControl`.
|
|
@@ -70,7 +96,7 @@ const getEntitiesInfo = entities => {
|
|
|
70
96
|
*/
|
|
71
97
|
|
|
72
98
|
|
|
73
|
-
exports.
|
|
99
|
+
exports.mapToIHasNameAndId = mapToIHasNameAndId;
|
|
74
100
|
|
|
75
101
|
const usePostTypes = () => {
|
|
76
102
|
const postTypes = (0, _data.useSelect)(select => {
|
package/build/query/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/query/utils.js"],"names":["getEntitiesInfo","entities","mapping","reduce","accumulator","entity","mapById","mapByName","names","id","name","push","usePostTypes","postTypes","select","getPostTypes","coreStore","excludedPostTypes","filteredPostTypes","per_page","filter","viewable","slug","includes","postTypesTaxonomiesMap","length","type","taxonomies","postTypesSelectOptions","
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/query/utils.js"],"names":["getEntitiesInfo","entities","mapping","reduce","accumulator","entity","mapById","mapByName","names","id","name","push","mapToIHasNameAndId","path","map","usePostTypes","postTypes","select","getPostTypes","coreStore","excludedPostTypes","filteredPostTypes","per_page","filter","viewable","slug","includes","postTypesTaxonomiesMap","length","type","taxonomies","postTypesSelectOptions","labels","label","singular_name","value","useTaxonomies","postType","getTaxonomies","filteredTaxonomies","context","getFirstQueryClientIdFromBlocks","blocks","blocksQueue","block","shift","clientId","innerBlocks","forEach","innerBlock"],"mappings":";;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AAXA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,eAAe,GAAKC,QAAF,IAAgB;AAC9C,QAAMC,OAAO,GAAGD,QAAH,aAAGA,QAAH,uBAAGA,QAAQ,CAAEE,MAAV,CACf,CAAEC,WAAF,EAAeC,MAAf,KAA2B;AAC1B,UAAM;AAAEC,MAAAA,OAAF;AAAWC,MAAAA,SAAX;AAAsBC,MAAAA;AAAtB,QAAgCJ,WAAtC;AACAE,IAAAA,OAAO,CAAED,MAAM,CAACI,EAAT,CAAP,GAAuBJ,MAAvB;AACAE,IAAAA,SAAS,CAAEF,MAAM,CAACK,IAAT,CAAT,GAA2BL,MAA3B;AACAG,IAAAA,KAAK,CAACG,IAAN,CAAYN,MAAM,CAACK,IAAnB;AACA,WAAON,WAAP;AACA,GAPc,EAQf;AAAEE,IAAAA,OAAO,EAAE,EAAX;AAAeC,IAAAA,SAAS,EAAE,EAA1B;AAA8BC,IAAAA,KAAK,EAAE;AAArC,GARe,CAAhB;AAUA,SAAO;AACNP,IAAAA,QADM;AAEN,OAAGC;AAFG,GA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AACG,WAAN,0EAAmBC,OAAnB,CAA8BC,UAAF,IAAkB;AAC7CN,MAAAA,WAAW,CAAChC,IAAZ,CAAkBsC,UAAlB;AACA,KAFD;AAGA;AACD,CAXM","sourcesContent":["/**\n * External dependencies\n */\nimport { get } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * @typedef IHasNameAndId\n * @property {string|number} id The entity's id.\n * @property {string} name The entity's name.\n */\n\n/**\n * The object used in Query block that contains info and helper mappings\n * from an array of IHasNameAndId objects.\n *\n * @typedef {Object} QueryEntitiesInfo\n * @property {IHasNameAndId[]} entities The array of entities.\n * @property {Object<string, IHasNameAndId>} mapById Object mapping with the id as key and the entity as value.\n * @property {Object<string, IHasNameAndId>} mapByName Object mapping with the name as key and the entity as value.\n * @property {string[]} names Array with the entities' names.\n */\n\n/**\n * Returns a helper object with mapping from Objects that implement\n * the `IHasNameAndId` interface. The returned object is used for\n * integration with `FormTokenField` component.\n *\n * @param {IHasNameAndId[]} entities The entities to extract of helper object.\n * @return {QueryEntitiesInfo} The object with the entities information.\n */\nexport const getEntitiesInfo = ( entities ) => {\n\tconst mapping = entities?.reduce(\n\t\t( accumulator, entity ) => {\n\t\t\tconst { mapById, mapByName, names } = accumulator;\n\t\t\tmapById[ entity.id ] = entity;\n\t\t\tmapByName[ entity.name ] = entity;\n\t\t\tnames.push( entity.name );\n\t\t\treturn accumulator;\n\t\t},\n\t\t{ mapById: {}, mapByName: {}, names: [] }\n\t);\n\treturn {\n\t\tentities,\n\t\t...mapping,\n\t};\n};\n\n/**\n * Helper util to map records to add a `name` prop from a\n * provided path, in order to handle all entities in the same\n * fashion(implementing`IHasNameAndId` interface).\n *\n * @param {Object[]} entities The array of entities.\n * @param {string} path The path to map a `name` property from the entity.\n * @return {IHasNameAndId[]} An array of enitities that now implement the `IHasNameAndId` interface.\n */\nexport const mapToIHasNameAndId = ( entities, path ) => {\n\treturn ( entities || [] ).map( ( entity ) => ( {\n\t\t...entity,\n\t\tname: decodeEntities( get( entity, path ) ),\n\t} ) );\n};\n\n/**\n * Returns a helper object that contains:\n * 1. An `options` object from the available post types, to be passed to a `SelectControl`.\n * 2. A helper map with available taxonomies per post type.\n *\n * @return {Object} The helper object related to post types.\n */\nexport const usePostTypes = () => {\n\tconst postTypes = useSelect( ( select ) => {\n\t\tconst { getPostTypes } = select( coreStore );\n\t\tconst excludedPostTypes = [ 'attachment' ];\n\t\tconst filteredPostTypes = getPostTypes( { per_page: -1 } )?.filter(\n\t\t\t( { viewable, slug } ) =>\n\t\t\t\tviewable && ! excludedPostTypes.includes( slug )\n\t\t);\n\t\treturn filteredPostTypes;\n\t}, [] );\n\tconst postTypesTaxonomiesMap = useMemo( () => {\n\t\tif ( ! postTypes?.length ) return;\n\t\treturn postTypes.reduce( ( accumulator, type ) => {\n\t\t\taccumulator[ type.slug ] = type.taxonomies;\n\t\t\treturn accumulator;\n\t\t}, {} );\n\t}, [ postTypes ] );\n\tconst postTypesSelectOptions = useMemo(\n\t\t() =>\n\t\t\t( postTypes || [] ).map( ( { labels, slug } ) => ( {\n\t\t\t\tlabel: labels.singular_name,\n\t\t\t\tvalue: slug,\n\t\t\t} ) ),\n\t\t[ postTypes ]\n\t);\n\treturn { postTypesTaxonomiesMap, postTypesSelectOptions };\n};\n\n/**\n * Hook that returns the taxonomies associated with a specific post type.\n *\n * @param {string} postType The post type from which to retrieve the associated taxonomies.\n * @return {Object[]} An array of the associated taxonomies.\n */\nexport const useTaxonomies = ( postType ) => {\n\tconst taxonomies = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getTaxonomies } = select( coreStore );\n\t\t\tconst filteredTaxonomies = getTaxonomies( {\n\t\t\t\ttype: postType,\n\t\t\t\tper_page: -1,\n\t\t\t\tcontext: 'view',\n\t\t\t} );\n\t\t\treturn filteredTaxonomies;\n\t\t},\n\t\t[ postType ]\n\t);\n\treturn taxonomies;\n};\n\n/**\n * Recurses over a list of blocks and returns the first found\n * Query Loop block's clientId.\n *\n * @param {WPBlock[]} blocks The list of blocks to look through.\n * @return {string=} The first found Query Loop's clientId.\n */\nexport const getFirstQueryClientIdFromBlocks = ( blocks ) => {\n\tconst blocksQueue = [ ...blocks ];\n\twhile ( blocksQueue.length > 0 ) {\n\t\tconst block = blocksQueue.shift();\n\t\tif ( block.name === 'core/query' ) {\n\t\t\treturn block.clientId;\n\t\t}\n\t\tblock.innerBlocks?.forEach( ( innerBlock ) => {\n\t\t\tblocksQueue.push( innerBlock );\n\t\t} );\n\t}\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/query-title/index.js"],"names":["name","metadata","settings","icon","edit","variations","deprecated"],"mappings":";;;;;;;;;AAIA;;AACA;;AACA;;AAKA;;AAXA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAGO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/query-title/index.js"],"names":["name","metadata","settings","icon","edit","variations","deprecated"],"mappings":";;;;;;;;;AAIA;;AACA;;AACA;;AAKA;;AAXA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAGO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,YADuB;AAEvBC,EAAAA,IAAI,EAAJA,aAFuB;AAGvBC,EAAAA,UAAU,EAAVA,mBAHuB;AAIvBC,EAAAA,UAAU,EAAVA;AAJuB,CAAjB","sourcesContent":["/**\n * Internal dependencies\n */\nimport metadata from './block.json';\nimport edit from './edit';\nimport variations from './variations';\nimport deprecated from './deprecated';\n\n/**\n * WordPress dependencies\n */\nimport { title as icon } from '@wordpress/icons';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\tvariations,\n\tdeprecated,\n};\n"]}
|
|
@@ -17,7 +17,7 @@ const variations = [{
|
|
|
17
17
|
name: 'archive-title',
|
|
18
18
|
title: (0, _i18n.__)('Archive Title'),
|
|
19
19
|
description: (0, _i18n.__)('Display the archive title based on the queried object.'),
|
|
20
|
-
icon: _icons.
|
|
20
|
+
icon: _icons.title,
|
|
21
21
|
attributes: {
|
|
22
22
|
type: 'archive'
|
|
23
23
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/query-title/variations.js"],"names":["variations","isDefault","name","title","description","icon","
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/query-title/variations.js"],"names":["variations","isDefault","name","title","description","icon","attributes","type","scope","forEach","variation","isActive","blockAttributes","variationAttributes"],"mappings":";;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;AAGA,MAAMA,UAAU,GAAG,CAClB;AACCC,EAAAA,SAAS,EAAE,IADZ;AAECC,EAAAA,IAAI,EAAE,eAFP;AAGCC,EAAAA,KAAK,EAAE,cAAI,eAAJ,CAHR;AAICC,EAAAA,WAAW,EAAE,cACZ,wDADY,CAJd;AAOCC,EAAAA,IAAI,EAAEF,YAPP;AAQCG,EAAAA,UAAU,EAAE;AACXC,IAAAA,IAAI,EAAE;AADK,GARb;AAWCC,EAAAA,KAAK,EAAE,CAAE,UAAF;AAXR,CADkB,CAAnB;AAgBA;AACA;AACA;AACA;AACA;;AACAR,UAAU,CAACS,OAAX,CAAsBC,SAAF,IAAiB;AACpC,MAAKA,SAAS,CAACC,QAAf,EAA0B;;AAC1BD,EAAAA,SAAS,CAACC,QAAV,GAAqB,CAAEC,eAAF,EAAmBC,mBAAnB,KACpBD,eAAe,CAACL,IAAhB,KAAyBM,mBAAmB,CAACN,IAD9C;AAEA,CAJD;eAMeP,U","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { title } from '@wordpress/icons';\nconst variations = [\n\t{\n\t\tisDefault: true,\n\t\tname: 'archive-title',\n\t\ttitle: __( 'Archive Title' ),\n\t\tdescription: __(\n\t\t\t'Display the archive title based on the queried object.'\n\t\t),\n\t\ticon: title,\n\t\tattributes: {\n\t\t\ttype: 'archive',\n\t\t},\n\t\tscope: [ 'inserter' ],\n\t},\n];\n\n/**\n * Add `isActive` function to all `query-title` variations, if not defined.\n * `isActive` function is used to find a variation match from a created\n * Block by providing its attributes.\n */\nvariations.forEach( ( variation ) => {\n\tif ( variation.isActive ) return;\n\tvariation.isActive = ( blockAttributes, variationAttributes ) =>\n\t\tblockAttributes.type === variationAttributes.type;\n} );\n\nexport default variations;\n"]}
|
package/build/quote/edit.js
CHANGED
|
@@ -82,7 +82,8 @@ function QuoteEdit(_ref) {
|
|
|
82
82
|
value: piece
|
|
83
83
|
}),
|
|
84
84
|
__unstableOnSplitMiddle: () => (0, _blocks.createBlock)('core/paragraph'),
|
|
85
|
-
textAlign: align
|
|
85
|
+
textAlign: align,
|
|
86
|
+
__unstableEmbedURLOnPaste: true
|
|
86
87
|
}), (!_blockEditor.RichText.isEmpty(citation) || isSelected) && (0, _element.createElement)(_blockEditor.RichText, {
|
|
87
88
|
identifier: "citation",
|
|
88
89
|
tagName: isWebPlatform ? 'cite' : undefined,
|
|
@@ -99,7 +100,7 @@ function QuoteEdit(_ref) {
|
|
|
99
100
|
(0, _i18n.__)('Add citation'),
|
|
100
101
|
className: "wp-block-quote__citation",
|
|
101
102
|
textAlign: align,
|
|
102
|
-
__unstableOnSplitAtEnd: () => insertBlocksAfter((0, _blocks.createBlock)(
|
|
103
|
+
__unstableOnSplitAtEnd: () => insertBlocksAfter((0, _blocks.createBlock)((0, _blocks.getDefaultBlockName)()))
|
|
103
104
|
})));
|
|
104
105
|
}
|
|
105
106
|
//# sourceMappingURL=edit.js.map
|
package/build/quote/edit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/quote/edit.js"],"names":["isWebPlatform","Platform","OS","QuoteEdit","attributes","setAttributes","isSelected","mergeBlocks","onReplace","className","insertBlocksAfter","style","align","value","citation","blockProps","nextAlign","nextValue","forward","hasEmptyCitation","length","piece","RichText","isEmpty","undefined","display","nextCitation"],"mappings":";;;;;;;;;AAiBA;;AAdA;;AAKA;;AACA;;AAMA;;AACA;;AAhBA;AACA;AACA;;AAGA;AACA;AACA;AAYA,MAAMA,aAAa,GAAGC,kBAASC,EAAT,KAAgB,KAAtC;;AAEe,SAASC,SAAT,OASX;AAAA,MAT+B;AAClCC,IAAAA,UADkC;AAElCC,IAAAA,aAFkC;AAGlCC,IAAAA,UAHkC;AAIlCC,IAAAA,WAJkC;AAKlCC,IAAAA,SALkC;AAMlCC,IAAAA,SANkC;AAOlCC,IAAAA,iBAPkC;AAQlCC,IAAAA;AARkC,GAS/B;AACH,QAAM;AAAEC,IAAAA,KAAF;AAASC,IAAAA,KAAT;AAAgBC,IAAAA;AAAhB,MAA6BV,UAAnC;AACA,QAAMW,UAAU,GAAG,gCAAe;AACjCN,IAAAA,SAAS,EAAE,yBAAYA,SAAZ,EAAuB;AACjC,OAAG,kBAAkBG,KAAO,EAA5B,GAAiCA;AADA,KAAvB,CADsB;AAIjCD,IAAAA;AAJiC,GAAf,CAAnB;AAOA,SACC,qDACC,4BAAC,0BAAD;AAAe,IAAA,KAAK,EAAC;AAArB,KACC,4BAAC,6BAAD;AACC,IAAA,KAAK,EAAGC,KADT;AAEC,IAAA,QAAQ,EAAKI,SAAF,IAAiB;AAC3BX,MAAAA,aAAa,CAAE;AAAEO,QAAAA,KAAK,EAAEI;AAAT,OAAF,CAAb;AACA;AAJF,IADD,CADD,EASC,4BAAC,0BAAD,EAAqBD,UAArB,EACC,4BAAC,qBAAD;AACC,IAAA,UAAU,EAAC,OADZ;AAEC,IAAA,SAAS,MAFV;AAGC,IAAA,KAAK,EAAGF,KAHT;AAIC,IAAA,QAAQ,EAAKI,SAAF,IACVZ,aAAa,CAAE;AACdQ,MAAAA,KAAK,EAAEI;AADO,KAAF,CALf;AASC,IAAA,OAAO,EAAGV,WATX;AAUC,IAAA,QAAQ,EAAKW,OAAF,IAAe;AACzB,YAAMC,gBAAgB,GACrB,CAAEL,QAAF,IAAcA,QAAQ,CAACM,MAAT,KAAoB,CADnC;;AAEA,UAAK,CAAEF,OAAF,IAAaC,gBAAlB,EAAqC;AACpCX,QAAAA,SAAS,CAAE,EAAF,CAAT;AACA;AACD,KAhBF;AAiBC,kBAAa,cAAI,YAAJ,CAjBd;AAkBC,IAAA,WAAW,EACV;AACA,kBAAI,WAAJ,CApBF;AAsBC,IAAA,SAAS,EAAGA,SAtBb;AAuBC,IAAA,OAAO,EAAKa,KAAF,IACT,yBAAa,YAAb,EAA2B,EAC1B,GAAGjB,UADuB;AAE1BS,MAAAA,KAAK,EAAEQ;AAFmB,KAA3B,CAxBF;AA6BC,IAAA,uBAAuB,EAAG,MACzB,yBAAa,gBAAb,CA9BF;AAgCC,IAAA,SAAS,EAAGT;
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/quote/edit.js"],"names":["isWebPlatform","Platform","OS","QuoteEdit","attributes","setAttributes","isSelected","mergeBlocks","onReplace","className","insertBlocksAfter","style","align","value","citation","blockProps","nextAlign","nextValue","forward","hasEmptyCitation","length","piece","RichText","isEmpty","undefined","display","nextCitation"],"mappings":";;;;;;;;;AAiBA;;AAdA;;AAKA;;AACA;;AAMA;;AACA;;AAhBA;AACA;AACA;;AAGA;AACA;AACA;AAYA,MAAMA,aAAa,GAAGC,kBAASC,EAAT,KAAgB,KAAtC;;AAEe,SAASC,SAAT,OASX;AAAA,MAT+B;AAClCC,IAAAA,UADkC;AAElCC,IAAAA,aAFkC;AAGlCC,IAAAA,UAHkC;AAIlCC,IAAAA,WAJkC;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Ka,KAAF,IACT,yBAAa,YAAb,EAA2B,EAC1B,GAAGjB,UADuB;AAE1BS,MAAAA,KAAK,EAAEQ;AAFmB,KAA3B,CAxBF;AA6BC,IAAA,uBAAuB,EAAG,MACzB,yBAAa,gBAAb,CA9BF;AAgCC,IAAA,SAAS,EAAGT,KAhCb;AAiCC,IAAA,yBAAyB;AAjC1B,IADD,EAoCG,CAAE,CAAEU,sBAASC,OAAT,CAAkBT,QAAlB,CAAF,IAAkCR,UAApC,KACD,4BAAC,qBAAD;AACC,IAAA,UAAU,EAAC,UADZ;AAEC,IAAA,OAAO,EAAGN,aAAa,GAAG,MAAH,GAAYwB,SAFpC;AAGC,IAAA,KAAK,EAAG;AAAEC,MAAAA,OAAO,EAAE;AAAX,KAHT;AAIC,IAAA,KAAK,EAAGX,QAJT;AAKC,IAAA,QAAQ,EAAKY,YAAF,IACVrB,aAAa,CAAE;AACdS,MAAAA,QAAQ,EAAEY;AADI,KAAF,CANf;AAUC,IAAA,8BAA8B,MAV/B;AAWC,kBAAa,cAAI,qBAAJ,CAXd;AAYC,IAAA,WAAW,EACV;AACA,kBAAI,cAAJ,CAdF;AAgBC,IAAA,SAAS,EAAC,0BAhBX;AAiBC,IAAA,SAAS,EAAGd,KAjBb;AAkBC,IAAA,sBAAsB,EAAG,MACxBF,iBAAiB,CAChB,yBAAa,kCAAb,CADgB;AAnBnB,IArCF,CATD,CADD;AA2EA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tRichText,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport { BlockQuotation } from '@wordpress/components';\nimport { createBlock, getDefaultBlockName } from '@wordpress/blocks';\nimport { Platform } from '@wordpress/element';\n\nconst isWebPlatform = Platform.OS === 'web';\n\nexport default function QuoteEdit( {\n\tattributes,\n\tsetAttributes,\n\tisSelected,\n\tmergeBlocks,\n\tonReplace,\n\tclassName,\n\tinsertBlocksAfter,\n\tstyle,\n} ) {\n\tconst { align, value, citation } = attributes;\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classnames( className, {\n\t\t\t[ `has-text-align-${ align }` ]: align,\n\t\t} ),\n\t\tstyle,\n\t} );\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t<AlignmentControl\n\t\t\t\t\tvalue={ align }\n\t\t\t\t\tonChange={ ( nextAlign ) => {\n\t\t\t\t\t\tsetAttributes( { align: nextAlign } );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t\t<BlockQuotation { ...blockProps }>\n\t\t\t\t<RichText\n\t\t\t\t\tidentifier=\"value\"\n\t\t\t\t\tmultiline\n\t\t\t\t\tvalue={ value }\n\t\t\t\t\tonChange={ ( nextValue ) =>\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\tvalue: nextValue,\n\t\t\t\t\t\t} )\n\t\t\t\t\t}\n\t\t\t\t\tonMerge={ mergeBlocks }\n\t\t\t\t\tonRemove={ ( forward ) => {\n\t\t\t\t\t\tconst hasEmptyCitation =\n\t\t\t\t\t\t\t! citation || citation.length === 0;\n\t\t\t\t\t\tif ( ! forward && hasEmptyCitation ) {\n\t\t\t\t\t\t\tonReplace( [] );\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t\taria-label={ __( 'Quote text' ) }\n\t\t\t\t\tplaceholder={\n\t\t\t\t\t\t// translators: placeholder text used for the quote\n\t\t\t\t\t\t__( 'Add quote' )\n\t\t\t\t\t}\n\t\t\t\t\tonReplace={ onReplace }\n\t\t\t\t\tonSplit={ ( piece ) =>\n\t\t\t\t\t\tcreateBlock( 'core/quote', {\n\t\t\t\t\t\t\t...attributes,\n\t\t\t\t\t\t\tvalue: piece,\n\t\t\t\t\t\t} )\n\t\t\t\t\t}\n\t\t\t\t\t__unstableOnSplitMiddle={ () =>\n\t\t\t\t\t\tcreateBlock( 'core/paragraph' )\n\t\t\t\t\t}\n\t\t\t\t\ttextAlign={ align }\n\t\t\t\t\t__unstableEmbedURLOnPaste\n\t\t\t\t/>\n\t\t\t\t{ ( ! RichText.isEmpty( citation ) || isSelected ) && (\n\t\t\t\t\t<RichText\n\t\t\t\t\t\tidentifier=\"citation\"\n\t\t\t\t\t\ttagName={ isWebPlatform ? 'cite' : undefined }\n\t\t\t\t\t\tstyle={ { display: 'block' } }\n\t\t\t\t\t\tvalue={ citation }\n\t\t\t\t\t\tonChange={ ( nextCitation ) =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tcitation: nextCitation,\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t\t__unstableMobileNoFocusOnMount\n\t\t\t\t\t\taria-label={ __( 'Quote citation text' ) }\n\t\t\t\t\t\tplaceholder={\n\t\t\t\t\t\t\t// translators: placeholder text used for the citation\n\t\t\t\t\t\t\t__( 'Add citation' )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclassName=\"wp-block-quote__citation\"\n\t\t\t\t\t\ttextAlign={ align }\n\t\t\t\t\t\t__unstableOnSplitAtEnd={ () =>\n\t\t\t\t\t\t\tinsertBlocksAfter(\n\t\t\t\t\t\t\t\tcreateBlock( getDefaultBlockName() )\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) }\n\t\t\t</BlockQuotation>\n\t\t</>\n\t);\n}\n"]}
|
package/build/quote/v2/edit.js
CHANGED
|
@@ -131,7 +131,7 @@ function QuoteEdit(_ref) {
|
|
|
131
131
|
// citation
|
|
132
132
|
(0, _i18n.__)('Add citation'),
|
|
133
133
|
className: "wp-block-quote__citation",
|
|
134
|
-
__unstableOnSplitAtEnd: () => insertBlocksAfter((0, _blocks.createBlock)(
|
|
134
|
+
__unstableOnSplitAtEnd: () => insertBlocksAfter((0, _blocks.createBlock)((0, _blocks.getDefaultBlockName)()))
|
|
135
135
|
}, !isWebPlatform ? {
|
|
136
136
|
textAlign: align
|
|
137
137
|
} : {}))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/quote/v2/edit.js"],"names":["isWebPlatform","Platform","OS","TEMPLATE","useMigrateOnLoad","attributes","clientId","registry","updateBlockAttributes","replaceInnerBlocks","blockEditorStore","value","newAttributes","newInnerBlocks","since","version","alternative","batch","QuoteEdit","setAttributes","isSelected","insertBlocksAfter","className","style","citation","align","isAncestorOfSelectedBlock","select","hasSelectedInnerBlock","hasSelection","blockProps","innerBlocksProps","template","templateInsertUpdatesSelection","nextAlign","children","RichText","isEmpty","undefined","display","nextCitation","textAlign"],"mappings":";;;;;;;;;AAoBA;;;;AAjBA;;AAKA;;AACA;;AAQA;;AACA;;AACA;;AAEA;;AAKA;;AA1BA;AACA;AACA;;AAGA;AACA;AACA;;AAgBA;AACA;AACA;AAGA,MAAMA,aAAa,GAAGC,kBAASC,EAAT,KAAgB,KAAtC;AACA,MAAMC,QAAQ,GAAG,CAAE,CAAE,gBAAF,EAAoB,EAApB,CAAF,CAAjB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMC,gBAAgB,GAAG,CAAEC,UAAF,EAAcC,QAAd,KAA4B;AACpD,QAAMC,QAAQ,GAAG,wBAAjB;AACA,QAAM;AAAEC,IAAAA,qBAAF;AAAyBC,IAAAA;AAAzB,MAAgD,uBACrDC,kBADqD,CAAtD;AAGA,0BAAW,MAAM;AAChB;AAEA,QAAK,CAAEL,UAAU,CAACM,KAAlB,EAA0B;AACzB;AACA;AACA;;AAED,UAAM,CAAEC,aAAF,EAAiBC,cAAjB,IAAoC,mCACzCR,UADyC,CAA1C;AAIA,6BAAY,oCAAZ,EAAkD;AACjDS,MAAAA,KAAK,EAAE,KAD0C;AAEjDC,MAAAA,OAAO,EAAE,KAFwC;AAGjDC,MAAAA,WAAW,EAAE;AAHoC,KAAlD;AAMAT,IAAAA,Q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S,SAAF,IAAiB;AAC3Bf,MAAAA,aAAa,CAAE;AAAEM,QAAAA,KAAK,EAAES;AAAT,OAAF,CAAb;AACA;AAJF,IADD,CADD,EASC,4BAAC,0BAAD,EAAqBH,gBAArB,EACGA,gBAAgB,CAACI,QADpB,EAEG,CAAE,CAAEC,sBAASC,OAAT,CAAkBb,QAAlB,CAAF,IAAkCK,YAApC,KACD,4BAAC,qBAAD;AACC,IAAA,UAAU,EAAC,UADZ;AAEC,IAAA,OAAO,EAAG7B,aAAa,GAAG,MAAH,GAAYsC,SAFpC;AAGC,IAAA,KAAK,EAAG;AAAEC,MAAAA,OAAO,EAAE;AAAX,KAHT;AAIC,IAAA,KAAK,EAAGf,QAJT;AAKC,IAAA,QAAQ,EAAKgB,YAAF,IAAoB;AAC9BrB,MAAAA,aAAa,CAAE;AACdK,QAAAA,QAAQ,EAAEgB;AADI,OAAF,CAAb;AAGA,KATF;AAUC,IAAA,8BAA8B,MAV/B;AAWC,kBAAa,cAAI,gBAAJ,CAXd;AAYC,IAAA,WAAW,EACV;AACA;AACA,kBAAI,cAAJ,CAfF;AAiBC,IAAA,SAAS,EAAC,0BAjBX;AAkBC,IAAA,sBAAsB,EAAG,MACxBnB,iBAAiB,
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/quote/v2/edit.js"],"names":["isWebPlatform","Platform","OS","TEMPLATE","useMigrateOnLoad","attributes","clientId","registry","updateBlockAttributes","replaceInnerBlocks","blockEditorStore","value","newAttributes","newInnerBlocks","since","version","alternative","batch","QuoteEdit","setAttributes","isSelected","insertBlocksAfter","className","style","citation","align","isAncestorOfSelectedBlock","select","hasSelectedInnerBlock","hasSelection","blockProps","innerBlocksProps","template","templateInsertUpdatesSelection","nextAlign","children","RichText","isEmpty","undefined","display","nextCitation","textAlign"],"mappings":";;;;;;;;;AAoBA;;;;AAjBA;;AAKA;;AACA;;AAQA;;AACA;;AACA;;AAEA;;AAKA;;AA1BA;AACA;AACA;;AAGA;AACA;AACA;;AA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GA,KATF;AAUC,IAAA,8BAA8B,MAV/B;AAWC,kBAAa,cAAI,gBAAJ,CAXd;AAYC,IAAA,WAAW,EACV;AACA;AACA,kBAAI,cAAJ,CAfF;AAiBC,IAAA,SAAS,EAAC,0BAjBX;AAkBC,IAAA,sBAAsB,EAAG,MACxBnB,iBAAiB,CAChB,yBAAa,kCAAb,CADgB;AAnBnB,KAuBQ,CAAErB,aAAF,GAAkB;AAAEyC,IAAAA,SAAS,EAAEhB;AAAb,GAAlB,GAAyC,EAvBjD,EAHF,CATD,CADD;AA0CA","sourcesContent":["/**\n * External dependencies\n */\nimport classNames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tRichText,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { BlockQuotation } from '@wordpress/components';\nimport { useDispatch, useSelect, useRegistry } from '@wordpress/data';\nimport { createBlock, getDefaultBlockName } from '@wordpress/blocks';\nimport { Platform, useEffect } from '@wordpress/element';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { migrateToQuoteV2 } from './deprecated';\n\nconst isWebPlatform = Platform.OS === 'web';\nconst TEMPLATE = [ [ 'core/paragraph', {} ] ];\n\n/**\n * At the moment, deprecations don't handle create blocks from attributes\n * (like when using CPT templates). For this reason, this hook is necessary\n * to avoid breaking templates using the old quote block format.\n *\n * @param {Object} attributes Block attributes.\n * @param {string} clientId Block client ID.\n */\nconst useMigrateOnLoad = ( attributes, clientId ) => {\n\tconst registry = useRegistry();\n\tconst { updateBlockAttributes, replaceInnerBlocks } = useDispatch(\n\t\tblockEditorStore\n\t);\n\tuseEffect( () => {\n\t\t// As soon as the block is loaded, migrate it to the new version.\n\n\t\tif ( ! attributes.value ) {\n\t\t\t// No need to migrate if it doesn't have the value attribute.\n\t\t\treturn;\n\t\t}\n\n\t\tconst [ newAttributes, newInnerBlocks ] = migrateToQuoteV2(\n\t\t\tattributes\n\t\t);\n\n\t\tdeprecated( 'Value attribute on the quote block', {\n\t\t\tsince: '6.0',\n\t\t\tversion: '6.5',\n\t\t\talternative: 'inner blocks',\n\t\t} );\n\n\t\tregistry.batch( () => {\n\t\t\tupdateBlockAttributes( clientId, newAttributes );\n\t\t\treplaceInnerBlocks( clientId, newInnerBlocks );\n\t\t} );\n\t}, [ attributes.value ] );\n};\n\nexport default function QuoteEdit( {\n\tattributes,\n\tsetAttributes,\n\tisSelected,\n\tinsertBlocksAfter,\n\tclientId,\n\tclassName,\n\tstyle,\n} ) {\n\tconst { citation, align } = attributes;\n\n\tuseMigrateOnLoad( attributes, clientId );\n\n\tconst isAncestorOfSelectedBlock = useSelect( ( select ) =>\n\t\tselect( blockEditorStore ).hasSelectedInnerBlock( clientId )\n\t);\n\tconst hasSelection = isSelected || isAncestorOfSelectedBlock;\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classNames( className, {\n\t\t\t[ `has-text-align-${ align }` ]: align,\n\t\t} ),\n\t\t...( ! isWebPlatform && { style } ),\n\t} );\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\ttemplate: TEMPLATE,\n\t\ttemplateInsertUpdatesSelection: true,\n\t} );\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t<AlignmentControl\n\t\t\t\t\tvalue={ align }\n\t\t\t\t\tonChange={ ( nextAlign ) => {\n\t\t\t\t\t\tsetAttributes( { align: nextAlign } );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t\t<BlockQuotation { ...innerBlocksProps }>\n\t\t\t\t{ innerBlocksProps.children }\n\t\t\t\t{ ( ! RichText.isEmpty( citation ) || hasSelection ) && (\n\t\t\t\t\t<RichText\n\t\t\t\t\t\tidentifier=\"citation\"\n\t\t\t\t\t\ttagName={ isWebPlatform ? 'cite' : undefined }\n\t\t\t\t\t\tstyle={ { display: 'block' } }\n\t\t\t\t\t\tvalue={ citation }\n\t\t\t\t\t\tonChange={ ( nextCitation ) => {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tcitation: nextCitation,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\t__unstableMobileNoFocusOnMount\n\t\t\t\t\t\taria-label={ __( 'Quote citation' ) }\n\t\t\t\t\t\tplaceholder={\n\t\t\t\t\t\t\t// translators: placeholder text used for the\n\t\t\t\t\t\t\t// citation\n\t\t\t\t\t\t\t__( 'Add citation' )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclassName=\"wp-block-quote__citation\"\n\t\t\t\t\t\t__unstableOnSplitAtEnd={ () =>\n\t\t\t\t\t\t\tinsertBlocksAfter(\n\t\t\t\t\t\t\t\tcreateBlock( getDefaultBlockName() )\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t{ ...( ! isWebPlatform ? { textAlign: align } : {} ) }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</BlockQuotation>\n\t\t</>\n\t);\n}\n"]}
|
package/build/search/edit.js
CHANGED
|
@@ -184,6 +184,7 @@ function SearchEdit(_ref) {
|
|
|
184
184
|
borderRadius
|
|
185
185
|
} : borderProps.style;
|
|
186
186
|
return (0, _element.createElement)("input", {
|
|
187
|
+
type: "search",
|
|
187
188
|
className: textFieldClasses,
|
|
188
189
|
style: textFieldStyles,
|
|
189
190
|
"aria-label": (0, _i18n.__)('Optional placeholder text') // We hide the placeholder field's placeholder when there is a value. This
|