@wordpress/block-library 9.13.1-next.cd6172eb0.0 → 9.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/LICENSE.md +1 -1
- package/build/archives/edit.js +83 -36
- package/build/archives/edit.js.map +1 -1
- package/build/avatar/user-control.js +1 -0
- package/build/avatar/user-control.js.map +1 -1
- package/build/block/deprecated.js +1 -0
- package/build/block/deprecated.js.map +1 -1
- package/build/block/edit.js +1 -0
- package/build/block/edit.js.map +1 -1
- package/build/button/deprecated.js +183 -1
- package/build/button/deprecated.js.map +1 -1
- package/build/button/edit.js +49 -27
- package/build/button/edit.js.map +1 -1
- package/build/button/index.js +8 -2
- package/build/button/index.js.map +1 -1
- package/build/button/save.js +8 -5
- package/build/button/save.js.map +1 -1
- package/build/buttons/transforms.js +1 -0
- package/build/buttons/transforms.js.map +1 -1
- package/build/categories/edit.js +1 -0
- package/build/categories/edit.js.map +1 -1
- package/build/column/column-preview.native.js +1 -0
- package/build/column/column-preview.native.js.map +1 -1
- package/build/column/edit.js +33 -13
- package/build/column/edit.js.map +1 -1
- package/build/columns/columnCalculations.native.js +1 -0
- package/build/columns/columnCalculations.native.js.map +1 -1
- package/build/columns/deprecated.js +1 -0
- package/build/columns/deprecated.js.map +1 -1
- package/build/columns/edit.js +51 -27
- package/build/columns/edit.js.map +1 -1
- package/build/columns/edit.native.js +1 -0
- package/build/columns/edit.native.js.map +1 -1
- package/build/columns/transforms.js +1 -0
- package/build/columns/transforms.js.map +1 -1
- package/build/columns/utils.js +1 -0
- package/build/columns/utils.js.map +1 -1
- package/build/comment-template/edit.js +1 -0
- package/build/comment-template/edit.js.map +1 -1
- package/build/comment-template/hooks.js +1 -0
- package/build/comment-template/hooks.js.map +1 -1
- package/build/comment-template/util.js +1 -0
- package/build/comment-template/util.js.map +1 -1
- package/build/comments/index.js +1 -0
- package/build/comments/index.js.map +1 -1
- package/build/cover/edit/index.js +9 -3
- package/build/cover/edit/index.js.map +1 -1
- package/build/cover/edit.native.js +1 -1
- package/build/cover/edit.native.js.map +1 -1
- package/build/details/edit.js +29 -7
- package/build/details/edit.js.map +1 -1
- package/build/details/transforms.js +1 -0
- package/build/details/transforms.js.map +1 -1
- package/build/embed/embed-placeholder.native.js +1 -0
- package/build/embed/embed-placeholder.native.js.map +1 -1
- package/build/embed/util.js +1 -0
- package/build/embed/util.js.map +1 -1
- package/build/embed/variations.js +1 -0
- package/build/embed/variations.js.map +1 -1
- package/build/embed/wp-embed-preview.js +1 -0
- package/build/embed/wp-embed-preview.js.map +1 -1
- package/build/file/transforms.js +1 -0
- package/build/file/transforms.js.map +1 -1
- package/build/footnotes/edit.js +1 -0
- package/build/footnotes/edit.js.map +1 -1
- package/build/form/index.js +1 -2
- package/build/form/index.js.map +1 -1
- package/build/form/view.js +10 -5
- package/build/form/view.js.map +1 -1
- package/build/freeform/modal.js +1 -0
- package/build/freeform/modal.js.map +1 -1
- package/build/gallery/deprecated.js +1 -0
- package/build/gallery/deprecated.js.map +1 -1
- package/build/gallery/edit.js +1 -0
- package/build/gallery/edit.js.map +1 -1
- package/build/gallery/shared.js +1 -0
- package/build/gallery/shared.js.map +1 -1
- package/build/gallery/transforms.js +1 -0
- package/build/gallery/transforms.js.map +1 -1
- package/build/gallery/use-get-media.js +1 -0
- package/build/gallery/use-get-media.js.map +1 -1
- package/build/gallery/use-get-media.native.js +1 -0
- package/build/gallery/use-get-media.native.js.map +1 -1
- package/build/gallery/use-get-new-images.js +1 -0
- package/build/gallery/use-get-new-images.js.map +1 -1
- package/build/gallery/use-image-sizes.js +1 -0
- package/build/gallery/use-image-sizes.js.map +1 -1
- package/build/group/placeholder.js +1 -0
- package/build/group/placeholder.js.map +1 -1
- package/build/group/transforms.js +1 -0
- package/build/group/transforms.js.map +1 -1
- package/build/heading/transforms.js +1 -0
- package/build/heading/transforms.js.map +1 -1
- package/build/html/preview.js +1 -0
- package/build/html/preview.js.map +1 -1
- package/build/image/edit.js +1 -0
- package/build/image/edit.js.map +1 -1
- package/build/image/edit.native.js +1 -0
- package/build/image/edit.native.js.map +1 -1
- package/build/image/image.js +2 -1
- package/build/image/image.js.map +1 -1
- package/build/image/transforms.js +2 -0
- package/build/image/transforms.js.map +1 -1
- package/build/image/utils.js +1 -0
- package/build/image/utils.js.map +1 -1
- package/build/image/view.js +1 -3
- package/build/image/view.js.map +1 -1
- package/build/index.js +2 -1
- package/build/index.js.map +1 -1
- package/build/index.native.js +1 -0
- package/build/index.native.js.map +1 -1
- package/build/latest-posts/deprecated.js +12 -0
- package/build/latest-posts/deprecated.js.map +1 -1
- package/build/latest-posts/edit.js +1 -0
- package/build/latest-posts/edit.js.map +1 -1
- package/build/latest-posts/index.js +12 -0
- package/build/latest-posts/index.js.map +1 -1
- package/build/list/transforms.js +1 -0
- package/build/list/transforms.js.map +1 -1
- package/build/list/utils.js +1 -0
- package/build/list/utils.js.map +1 -1
- package/build/list-item/hooks/use-indent-list-item.js +1 -0
- package/build/list-item/hooks/use-indent-list-item.js.map +1 -1
- package/build/list-item/transforms.js +1 -0
- package/build/list-item/transforms.js.map +1 -1
- package/build/loginout/edit.js +42 -13
- package/build/loginout/edit.js.map +1 -1
- package/build/media-text/edit.js +60 -31
- package/build/media-text/edit.js.map +1 -1
- package/build/more/edit.js +28 -7
- package/build/more/edit.js.map +1 -1
- package/build/more/save.js +1 -0
- package/build/more/save.js.map +1 -1
- package/build/navigation/deprecated.js +1 -0
- package/build/navigation/deprecated.js.map +1 -1
- package/build/navigation/edit/index.js +1 -0
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/navigation-menu-selector.js +5 -3
- package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build/navigation/edit/use-generate-default-navigation-title.js +1 -0
- package/build/navigation/edit/use-generate-default-navigation-title.js.map +1 -1
- package/build/navigation/menu-items-to-blocks.js +1 -0
- package/build/navigation/menu-items-to-blocks.js.map +1 -1
- package/build/navigation/use-template-part-area-label.js +1 -0
- package/build/navigation/use-template-part-area-label.js.map +1 -1
- package/build/navigation/view.js +1 -0
- package/build/navigation/view.js.map +1 -1
- package/build/navigation-link/edit.js +96 -57
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-link/hooks.js +1 -0
- package/build/navigation-link/hooks.js.map +1 -1
- package/build/navigation-link/link-ui.js +3 -3
- package/build/navigation-link/link-ui.js.map +1 -1
- package/build/navigation-submenu/edit.js +105 -54
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/page-list/edit.js +45 -25
- package/build/page-list/edit.js.map +1 -1
- package/build/page-list/use-convert-to-navigation-links.js +1 -0
- package/build/page-list/use-convert-to-navigation-links.js.map +1 -1
- package/build/paragraph/edit.js +22 -6
- package/build/paragraph/edit.js.map +1 -1
- package/build/pattern/edit.js +1 -0
- package/build/pattern/edit.js.map +1 -1
- package/build/post-author/edit.js +16 -3
- package/build/post-author/edit.js.map +1 -1
- package/build/post-author/index.js +4 -2
- package/build/post-author/index.js.map +1 -1
- package/build/post-author-name/edit.js +11 -5
- package/build/post-author-name/edit.js.map +1 -1
- package/build/post-author-name/index.js +4 -2
- package/build/post-author-name/index.js.map +1 -1
- package/build/post-comments-form/index.js +6 -1
- package/build/post-comments-form/index.js.map +1 -1
- package/build/post-comments-link/index.js +8 -1
- package/build/post-comments-link/index.js.map +1 -1
- package/build/post-date/edit.js +58 -18
- package/build/post-date/edit.js.map +1 -1
- package/build/post-date/index.js +2 -1
- package/build/post-date/index.js.map +1 -1
- package/build/post-excerpt/edit.js +42 -18
- package/build/post-excerpt/edit.js.map +1 -1
- package/build/post-featured-image/dimension-controls.js +18 -19
- package/build/post-featured-image/dimension-controls.js.map +1 -1
- package/build/post-featured-image/edit.js +45 -11
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/post-featured-image/index.js +6 -3
- package/build/post-featured-image/index.js.map +1 -1
- package/build/post-navigation-link/edit.js +1 -0
- package/build/post-navigation-link/edit.js.map +1 -1
- package/build/post-navigation-link/index.js +11 -7
- package/build/post-navigation-link/index.js.map +1 -1
- package/build/post-navigation-link/variations.js +3 -2
- package/build/post-navigation-link/variations.js.map +1 -1
- package/build/post-template/edit.js +1 -0
- package/build/post-template/edit.js.map +1 -1
- package/build/post-template/index.js +12 -2
- package/build/post-template/index.js.map +1 -1
- package/build/post-terms/edit.js +1 -0
- package/build/post-terms/edit.js.map +1 -1
- package/build/post-terms/hooks.js +1 -0
- package/build/post-terms/hooks.js.map +1 -1
- package/build/post-title/index.js +6 -3
- package/build/post-title/index.js.map +1 -1
- package/build/pullquote/blockquote.native.js +1 -0
- package/build/pullquote/blockquote.native.js.map +1 -1
- package/build/pullquote/transforms.js +1 -0
- package/build/pullquote/transforms.js.map +1 -1
- package/build/query/deprecated.js +1 -0
- package/build/query/deprecated.js.map +1 -1
- package/build/query/edit/inspector-controls/author-control.js +1 -0
- package/build/query/edit/inspector-controls/author-control.js.map +1 -1
- package/build/query/edit/inspector-controls/format-controls.js +1 -0
- package/build/query/edit/inspector-controls/format-controls.js.map +1 -1
- package/build/query/edit/inspector-controls/index.js +1 -0
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/edit/inspector-controls/parent-control.js +1 -0
- package/build/query/edit/inspector-controls/parent-control.js.map +1 -1
- package/build/query/edit/inspector-controls/taxonomy-controls.js +1 -0
- package/build/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
- package/build/query/utils.js +1 -0
- package/build/query/utils.js.map +1 -1
- package/build/query-no-results/index.js +11 -10
- package/build/query-no-results/index.js.map +1 -1
- package/build/query-pagination/edit.js +47 -17
- package/build/query-pagination/edit.js.map +1 -1
- package/build/query-pagination/query-pagination-label-control.js +1 -1
- package/build/query-pagination/query-pagination-label-control.js.map +1 -1
- package/build/query-pagination-numbers/edit.js +33 -15
- package/build/query-pagination-numbers/edit.js.map +1 -1
- package/build/query-title/variations.js +1 -0
- package/build/query-title/variations.js.map +1 -1
- package/build/query-total/edit.js +90 -0
- package/build/query-total/edit.js.map +1 -0
- package/build/query-total/icons.js +46 -0
- package/build/query-total/icons.js.map +1 -0
- package/build/query-total/index.js +81 -0
- package/build/query-total/index.js.map +1 -0
- package/build/query-total/init.js +12 -0
- package/build/query-total/init.js.map +1 -0
- package/build/quote/deprecated.js +1 -0
- package/build/quote/deprecated.js.map +1 -1
- package/build/quote/transforms.js +1 -0
- package/build/quote/transforms.js.map +1 -1
- package/build/read-more/index.js +7 -1
- package/build/read-more/index.js.map +1 -1
- package/build/site-logo/index.js +4 -2
- package/build/site-logo/index.js.map +1 -1
- package/build/site-title/edit.js +41 -12
- package/build/site-title/edit.js.map +1 -1
- package/build/site-title/index.js +4 -2
- package/build/site-title/index.js.map +1 -1
- package/build/social-link/edit.js +19 -3
- package/build/social-link/edit.js.map +1 -1
- package/build/social-link/social-list.js +1 -0
- package/build/social-link/social-list.js.map +1 -1
- package/build/social-link/variations.js +1 -0
- package/build/social-link/variations.js.map +1 -1
- package/build/social-links/edit.js +42 -12
- package/build/social-links/edit.js.map +1 -1
- package/build/social-links/edit.native.js +1 -0
- package/build/social-links/edit.native.js.map +1 -1
- package/build/spacer/controls.js +35 -12
- package/build/spacer/controls.js.map +1 -1
- package/build/table/deprecated.js +1 -0
- package/build/table/deprecated.js.map +1 -1
- package/build/table/edit.js +49 -15
- package/build/table/edit.js.map +1 -1
- package/build/table/index.js +4 -1
- package/build/table/index.js.map +1 -1
- package/build/table/save.js +1 -0
- package/build/table/save.js.map +1 -1
- package/build/table/state.js +1 -0
- package/build/table/state.js.map +1 -1
- package/build/table/transforms.js +1 -0
- package/build/table/transforms.js.map +1 -1
- package/build/table-of-contents/edit.js +1 -1
- package/build/table-of-contents/edit.js.map +1 -1
- package/build/table-of-contents/index.js +24 -23
- package/build/table-of-contents/index.js.map +1 -1
- package/build/table-of-contents/list.js +1 -0
- package/build/table-of-contents/list.js.map +1 -1
- package/build/table-of-contents/utils.js +1 -0
- package/build/table-of-contents/utils.js.map +1 -1
- package/build/tag-cloud/edit.js +57 -11
- package/build/tag-cloud/edit.js.map +1 -1
- package/build/template-part/edit/advanced-controls.js +1 -0
- package/build/template-part/edit/advanced-controls.js.map +1 -1
- package/build/template-part/edit/import-controls.js +1 -0
- package/build/template-part/edit/import-controls.js.map +1 -1
- package/build/template-part/edit/selection-modal.js +1 -0
- package/build/template-part/edit/selection-modal.js.map +1 -1
- package/build/template-part/edit/utils/hooks.js +1 -0
- package/build/template-part/edit/utils/hooks.js.map +1 -1
- package/build/template-part/edit/utils/transformers.js +1 -0
- package/build/template-part/edit/utils/transformers.js.map +1 -1
- package/build/template-part/variations.js +1 -0
- package/build/template-part/variations.js.map +1 -1
- package/build/text-columns/edit.js +1 -0
- package/build/text-columns/edit.js.map +1 -1
- package/build/text-columns/save.js +1 -0
- package/build/text-columns/save.js.map +1 -1
- package/build/text-columns/transforms.js +1 -0
- package/build/text-columns/transforms.js.map +1 -1
- package/build/utils/get-transformed-metadata.js +1 -0
- package/build/utils/get-transformed-metadata.js.map +1 -1
- package/build/utils/search-patterns.js +1 -0
- package/build/utils/search-patterns.js.map +1 -1
- package/build/utils/transformation-categories.native.js +1 -0
- package/build/utils/transformation-categories.native.js.map +1 -1
- package/build/video/edit-common-settings.js +90 -30
- package/build/video/edit-common-settings.js.map +1 -1
- package/build/video/edit.js +20 -49
- package/build/video/edit.js.map +1 -1
- package/build/video/poster-image.js +81 -0
- package/build/video/poster-image.js.map +1 -0
- package/build/video/tracks-editor.js +2 -1
- package/build/video/tracks-editor.js.map +1 -1
- package/build/video/tracks.js +1 -0
- package/build/video/tracks.js.map +1 -1
- package/build-module/archives/edit.js +84 -37
- package/build-module/archives/edit.js.map +1 -1
- package/build-module/avatar/user-control.js +1 -0
- package/build-module/avatar/user-control.js.map +1 -1
- package/build-module/block/deprecated.js +1 -0
- package/build-module/block/deprecated.js.map +1 -1
- package/build-module/block/edit.js +1 -0
- package/build-module/block/edit.js.map +1 -1
- package/build-module/button/deprecated.js +184 -2
- package/build-module/button/deprecated.js.map +1 -1
- package/build-module/button/edit.js +50 -28
- package/build-module/button/edit.js.map +1 -1
- package/build-module/button/index.js +8 -2
- package/build-module/button/index.js.map +1 -1
- package/build-module/button/save.js +9 -6
- package/build-module/button/save.js.map +1 -1
- package/build-module/buttons/transforms.js +1 -0
- package/build-module/buttons/transforms.js.map +1 -1
- package/build-module/categories/edit.js +1 -0
- package/build-module/categories/edit.js.map +1 -1
- package/build-module/column/column-preview.native.js +1 -0
- package/build-module/column/column-preview.native.js.map +1 -1
- package/build-module/column/edit.js +34 -14
- package/build-module/column/edit.js.map +1 -1
- package/build-module/columns/columnCalculations.native.js +1 -0
- package/build-module/columns/columnCalculations.native.js.map +1 -1
- package/build-module/columns/deprecated.js +1 -0
- package/build-module/columns/deprecated.js.map +1 -1
- package/build-module/columns/edit.js +53 -29
- package/build-module/columns/edit.js.map +1 -1
- package/build-module/columns/edit.native.js +1 -0
- package/build-module/columns/edit.native.js.map +1 -1
- package/build-module/columns/transforms.js +1 -0
- package/build-module/columns/transforms.js.map +1 -1
- package/build-module/columns/utils.js +1 -0
- package/build-module/columns/utils.js.map +1 -1
- package/build-module/comment-template/edit.js +1 -0
- package/build-module/comment-template/edit.js.map +1 -1
- package/build-module/comment-template/hooks.js +1 -0
- package/build-module/comment-template/hooks.js.map +1 -1
- package/build-module/comment-template/util.js +1 -0
- package/build-module/comment-template/util.js.map +1 -1
- package/build-module/comments/index.js +1 -0
- package/build-module/comments/index.js.map +1 -1
- package/build-module/cover/edit/index.js +9 -3
- package/build-module/cover/edit/index.js.map +1 -1
- package/build-module/cover/edit.native.js +2 -2
- package/build-module/cover/edit.native.js.map +1 -1
- package/build-module/details/edit.js +30 -8
- package/build-module/details/edit.js.map +1 -1
- package/build-module/details/transforms.js +1 -0
- package/build-module/details/transforms.js.map +1 -1
- package/build-module/embed/embed-placeholder.native.js +1 -0
- package/build-module/embed/embed-placeholder.native.js.map +1 -1
- package/build-module/embed/util.js +1 -0
- package/build-module/embed/util.js.map +1 -1
- package/build-module/embed/variations.js +1 -0
- package/build-module/embed/variations.js.map +1 -1
- package/build-module/embed/wp-embed-preview.js +1 -0
- package/build-module/embed/wp-embed-preview.js.map +1 -1
- package/build-module/file/transforms.js +1 -0
- package/build-module/file/transforms.js.map +1 -1
- package/build-module/footnotes/edit.js +1 -0
- package/build-module/footnotes/edit.js.map +1 -1
- package/build-module/form/index.js +1 -2
- package/build-module/form/index.js.map +1 -1
- package/build-module/form/view.js +10 -5
- package/build-module/form/view.js.map +1 -1
- package/build-module/freeform/modal.js +1 -0
- package/build-module/freeform/modal.js.map +1 -1
- package/build-module/gallery/deprecated.js +1 -0
- package/build-module/gallery/deprecated.js.map +1 -1
- package/build-module/gallery/edit.js +1 -0
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/gallery/shared.js +1 -0
- package/build-module/gallery/shared.js.map +1 -1
- package/build-module/gallery/transforms.js +1 -0
- package/build-module/gallery/transforms.js.map +1 -1
- package/build-module/gallery/use-get-media.js +1 -0
- package/build-module/gallery/use-get-media.js.map +1 -1
- package/build-module/gallery/use-get-media.native.js +1 -0
- package/build-module/gallery/use-get-media.native.js.map +1 -1
- package/build-module/gallery/use-get-new-images.js +1 -0
- package/build-module/gallery/use-get-new-images.js.map +1 -1
- package/build-module/gallery/use-image-sizes.js +1 -0
- package/build-module/gallery/use-image-sizes.js.map +1 -1
- package/build-module/group/placeholder.js +1 -0
- package/build-module/group/placeholder.js.map +1 -1
- package/build-module/group/transforms.js +1 -0
- package/build-module/group/transforms.js.map +1 -1
- package/build-module/heading/transforms.js +1 -0
- package/build-module/heading/transforms.js.map +1 -1
- package/build-module/html/preview.js +1 -0
- package/build-module/html/preview.js.map +1 -1
- package/build-module/image/edit.js +1 -0
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/edit.native.js +1 -0
- package/build-module/image/edit.native.js.map +1 -1
- package/build-module/image/image.js +2 -1
- package/build-module/image/image.js.map +1 -1
- package/build-module/image/transforms.js +2 -0
- package/build-module/image/transforms.js.map +1 -1
- package/build-module/image/utils.js +1 -0
- package/build-module/image/utils.js.map +1 -1
- package/build-module/image/view.js +1 -3
- package/build-module/image/view.js.map +1 -1
- package/build-module/index.js +2 -1
- package/build-module/index.js.map +1 -1
- package/build-module/index.native.js +1 -0
- package/build-module/index.native.js.map +1 -1
- package/build-module/latest-posts/deprecated.js +12 -0
- package/build-module/latest-posts/deprecated.js.map +1 -1
- package/build-module/latest-posts/edit.js +1 -0
- package/build-module/latest-posts/edit.js.map +1 -1
- package/build-module/latest-posts/index.js +12 -0
- package/build-module/latest-posts/index.js.map +1 -1
- package/build-module/list/transforms.js +1 -0
- package/build-module/list/transforms.js.map +1 -1
- package/build-module/list/utils.js +1 -0
- package/build-module/list/utils.js.map +1 -1
- package/build-module/list-item/hooks/use-indent-list-item.js +1 -0
- package/build-module/list-item/hooks/use-indent-list-item.js.map +1 -1
- package/build-module/list-item/transforms.js +1 -0
- package/build-module/list-item/transforms.js.map +1 -1
- package/build-module/loginout/edit.js +42 -14
- package/build-module/loginout/edit.js.map +1 -1
- package/build-module/media-text/edit.js +60 -31
- package/build-module/media-text/edit.js.map +1 -1
- package/build-module/more/edit.js +28 -8
- package/build-module/more/edit.js.map +1 -1
- package/build-module/more/save.js +1 -0
- package/build-module/more/save.js.map +1 -1
- package/build-module/navigation/deprecated.js +1 -0
- package/build-module/navigation/deprecated.js.map +1 -1
- package/build-module/navigation/edit/index.js +1 -0
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/navigation-menu-selector.js +5 -3
- package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build-module/navigation/edit/use-generate-default-navigation-title.js +1 -0
- package/build-module/navigation/edit/use-generate-default-navigation-title.js.map +1 -1
- package/build-module/navigation/menu-items-to-blocks.js +1 -0
- package/build-module/navigation/menu-items-to-blocks.js.map +1 -1
- package/build-module/navigation/use-template-part-area-label.js +1 -0
- package/build-module/navigation/use-template-part-area-label.js.map +1 -1
- package/build-module/navigation/view.js +1 -0
- package/build-module/navigation/view.js.map +1 -1
- package/build-module/navigation-link/edit.js +97 -58
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-link/hooks.js +1 -0
- package/build-module/navigation-link/hooks.js.map +1 -1
- package/build-module/navigation-link/link-ui.js +1 -1
- package/build-module/navigation-link/link-ui.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +106 -55
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/page-list/edit.js +46 -26
- package/build-module/page-list/edit.js.map +1 -1
- package/build-module/page-list/use-convert-to-navigation-links.js +1 -0
- package/build-module/page-list/use-convert-to-navigation-links.js.map +1 -1
- package/build-module/paragraph/edit.js +23 -8
- package/build-module/paragraph/edit.js.map +1 -1
- package/build-module/pattern/edit.js +1 -0
- package/build-module/pattern/edit.js.map +1 -1
- package/build-module/post-author/edit.js +17 -4
- package/build-module/post-author/edit.js.map +1 -1
- package/build-module/post-author/index.js +4 -2
- package/build-module/post-author/index.js.map +1 -1
- package/build-module/post-author-name/edit.js +12 -6
- package/build-module/post-author-name/edit.js.map +1 -1
- package/build-module/post-author-name/index.js +4 -2
- package/build-module/post-author-name/index.js.map +1 -1
- package/build-module/post-comments-form/index.js +6 -1
- package/build-module/post-comments-form/index.js.map +1 -1
- package/build-module/post-comments-link/index.js +8 -1
- package/build-module/post-comments-link/index.js.map +1 -1
- package/build-module/post-date/edit.js +59 -19
- package/build-module/post-date/edit.js.map +1 -1
- package/build-module/post-date/index.js +2 -1
- package/build-module/post-date/index.js.map +1 -1
- package/build-module/post-excerpt/edit.js +44 -20
- package/build-module/post-excerpt/edit.js.map +1 -1
- package/build-module/post-featured-image/dimension-controls.js +19 -20
- package/build-module/post-featured-image/dimension-controls.js.map +1 -1
- package/build-module/post-featured-image/edit.js +47 -13
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/post-featured-image/index.js +6 -3
- package/build-module/post-featured-image/index.js.map +1 -1
- package/build-module/post-navigation-link/edit.js +1 -0
- package/build-module/post-navigation-link/edit.js.map +1 -1
- package/build-module/post-navigation-link/index.js +12 -7
- package/build-module/post-navigation-link/index.js.map +1 -1
- package/build-module/post-navigation-link/variations.js +3 -2
- package/build-module/post-navigation-link/variations.js.map +1 -1
- package/build-module/post-template/edit.js +1 -0
- package/build-module/post-template/edit.js.map +1 -1
- package/build-module/post-template/index.js +12 -2
- package/build-module/post-template/index.js.map +1 -1
- package/build-module/post-terms/edit.js +1 -0
- package/build-module/post-terms/edit.js.map +1 -1
- package/build-module/post-terms/hooks.js +1 -0
- package/build-module/post-terms/hooks.js.map +1 -1
- package/build-module/post-title/index.js +6 -3
- package/build-module/post-title/index.js.map +1 -1
- package/build-module/pullquote/blockquote.native.js +1 -0
- package/build-module/pullquote/blockquote.native.js.map +1 -1
- package/build-module/pullquote/transforms.js +1 -0
- package/build-module/pullquote/transforms.js.map +1 -1
- package/build-module/query/deprecated.js +1 -0
- package/build-module/query/deprecated.js.map +1 -1
- package/build-module/query/edit/inspector-controls/author-control.js +1 -0
- package/build-module/query/edit/inspector-controls/author-control.js.map +1 -1
- package/build-module/query/edit/inspector-controls/format-controls.js +1 -0
- package/build-module/query/edit/inspector-controls/format-controls.js.map +1 -1
- package/build-module/query/edit/inspector-controls/index.js +1 -0
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/query/edit/inspector-controls/parent-control.js +1 -0
- package/build-module/query/edit/inspector-controls/parent-control.js.map +1 -1
- package/build-module/query/edit/inspector-controls/taxonomy-controls.js +1 -0
- package/build-module/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
- package/build-module/query/utils.js +1 -0
- package/build-module/query/utils.js.map +1 -1
- package/build-module/query-no-results/index.js +11 -10
- package/build-module/query-no-results/index.js.map +1 -1
- package/build-module/query-pagination/edit.js +49 -19
- package/build-module/query-pagination/edit.js.map +1 -1
- package/build-module/query-pagination/query-pagination-label-control.js +1 -1
- package/build-module/query-pagination/query-pagination-label-control.js.map +1 -1
- package/build-module/query-pagination-numbers/edit.js +34 -16
- package/build-module/query-pagination-numbers/edit.js.map +1 -1
- package/build-module/query-title/variations.js +1 -0
- package/build-module/query-title/variations.js.map +1 -1
- package/build-module/query-total/edit.js +83 -0
- package/build-module/query-total/edit.js.map +1 -0
- package/build-module/query-total/icons.js +39 -0
- package/build-module/query-total/icons.js.map +1 -0
- package/build-module/query-total/index.js +74 -0
- package/build-module/query-total/index.js.map +1 -0
- package/build-module/query-total/init.js +6 -0
- package/build-module/query-total/init.js.map +1 -0
- package/build-module/quote/deprecated.js +1 -0
- package/build-module/quote/deprecated.js.map +1 -1
- package/build-module/quote/transforms.js +1 -0
- package/build-module/quote/transforms.js.map +1 -1
- package/build-module/read-more/index.js +7 -1
- package/build-module/read-more/index.js.map +1 -1
- package/build-module/site-logo/index.js +4 -2
- package/build-module/site-logo/index.js.map +1 -1
- package/build-module/site-title/edit.js +42 -13
- package/build-module/site-title/edit.js.map +1 -1
- package/build-module/site-title/index.js +4 -2
- package/build-module/site-title/index.js.map +1 -1
- package/build-module/social-link/edit.js +20 -4
- package/build-module/social-link/edit.js.map +1 -1
- package/build-module/social-link/social-list.js +1 -0
- package/build-module/social-link/social-list.js.map +1 -1
- package/build-module/social-link/variations.js +1 -0
- package/build-module/social-link/variations.js.map +1 -1
- package/build-module/social-links/edit.js +43 -13
- package/build-module/social-links/edit.js.map +1 -1
- package/build-module/social-links/edit.native.js +1 -0
- package/build-module/social-links/edit.native.js.map +1 -1
- package/build-module/spacer/controls.js +36 -13
- package/build-module/spacer/controls.js.map +1 -1
- package/build-module/table/deprecated.js +1 -0
- package/build-module/table/deprecated.js.map +1 -1
- package/build-module/table/edit.js +50 -16
- package/build-module/table/edit.js.map +1 -1
- package/build-module/table/index.js +4 -1
- package/build-module/table/index.js.map +1 -1
- package/build-module/table/save.js +1 -0
- package/build-module/table/save.js.map +1 -1
- package/build-module/table/state.js +1 -0
- package/build-module/table/state.js.map +1 -1
- package/build-module/table/transforms.js +1 -0
- package/build-module/table/transforms.js.map +1 -1
- package/build-module/table-of-contents/edit.js +1 -1
- package/build-module/table-of-contents/edit.js.map +1 -1
- package/build-module/table-of-contents/index.js +26 -25
- package/build-module/table-of-contents/index.js.map +1 -1
- package/build-module/table-of-contents/list.js +1 -0
- package/build-module/table-of-contents/list.js.map +1 -1
- package/build-module/table-of-contents/utils.js +1 -0
- package/build-module/table-of-contents/utils.js.map +1 -1
- package/build-module/tag-cloud/edit.js +58 -12
- package/build-module/tag-cloud/edit.js.map +1 -1
- package/build-module/template-part/edit/advanced-controls.js +1 -0
- package/build-module/template-part/edit/advanced-controls.js.map +1 -1
- package/build-module/template-part/edit/import-controls.js +1 -0
- package/build-module/template-part/edit/import-controls.js.map +1 -1
- package/build-module/template-part/edit/selection-modal.js +1 -0
- package/build-module/template-part/edit/selection-modal.js.map +1 -1
- package/build-module/template-part/edit/utils/hooks.js +1 -0
- package/build-module/template-part/edit/utils/hooks.js.map +1 -1
- package/build-module/template-part/edit/utils/transformers.js +1 -0
- package/build-module/template-part/edit/utils/transformers.js.map +1 -1
- package/build-module/template-part/variations.js +1 -0
- package/build-module/template-part/variations.js.map +1 -1
- package/build-module/text-columns/edit.js +1 -0
- package/build-module/text-columns/edit.js.map +1 -1
- package/build-module/text-columns/save.js +1 -0
- package/build-module/text-columns/save.js.map +1 -1
- package/build-module/text-columns/transforms.js +1 -0
- package/build-module/text-columns/transforms.js.map +1 -1
- package/build-module/utils/get-transformed-metadata.js +1 -0
- package/build-module/utils/get-transformed-metadata.js.map +1 -1
- package/build-module/utils/search-patterns.js +1 -0
- package/build-module/utils/search-patterns.js.map +1 -1
- package/build-module/utils/transformation-categories.native.js +1 -0
- package/build-module/utils/transformation-categories.native.js.map +1 -1
- package/build-module/video/edit-common-settings.js +91 -31
- package/build-module/video/edit-common-settings.js.map +1 -1
- package/build-module/video/edit.js +24 -53
- package/build-module/video/edit.js.map +1 -1
- package/build-module/video/poster-image.js +74 -0
- package/build-module/video/poster-image.js.map +1 -0
- package/build-module/video/tracks-editor.js +2 -1
- package/build-module/video/tracks-editor.js.map +1 -1
- package/build-module/video/tracks.js +1 -0
- package/build-module/video/tracks.js.map +1 -1
- package/build-style/button/style-rtl.css +3 -3
- package/build-style/button/style.css +3 -3
- package/build-style/comment-template/style-rtl.css +0 -1
- package/build-style/comment-template/style.css +0 -1
- package/build-style/comments/editor-rtl.css +1 -1
- package/build-style/comments/editor.css +1 -1
- package/build-style/comments/style-rtl.css +1 -1
- package/build-style/comments/style.css +1 -1
- package/build-style/common-rtl.css +17 -17
- package/build-style/common.css +17 -17
- package/build-style/editor-rtl.css +45 -60
- package/build-style/editor.css +45 -60
- package/build-style/form-input/style-rtl.css +0 -2
- package/build-style/form-input/style.css +0 -2
- package/build-style/freeform/editor-rtl.css +4 -8
- package/build-style/freeform/editor.css +4 -8
- package/build-style/gallery/style-rtl.css +2 -2
- package/build-style/gallery/style.css +2 -2
- package/build-style/heading/style-rtl.css +11 -11
- package/build-style/heading/style.css +11 -11
- package/build-style/image/style-rtl.css +1 -1
- package/build-style/image/style.css +1 -1
- package/build-style/latest-comments/style-rtl.css +4 -4
- package/build-style/latest-comments/style.css +4 -4
- package/build-style/latest-posts/style-rtl.css +2 -1
- package/build-style/latest-posts/style.css +2 -1
- package/build-style/more/editor-rtl.css +1 -1
- package/build-style/more/editor.css +1 -1
- package/build-style/nextpage/editor-rtl.css +1 -1
- package/build-style/nextpage/editor.css +1 -1
- package/build-style/post-comments-form/style-rtl.css +2 -2
- package/build-style/post-comments-form/style.css +2 -2
- package/build-style/{post-template/editor.css → post-comments-link/style-rtl.css} +2 -4
- package/build-style/{post-template/editor-rtl.css → post-comments-link/style.css} +2 -4
- package/build-style/post-featured-image/editor-rtl.css +27 -27
- package/build-style/post-featured-image/editor.css +27 -27
- package/build-style/post-template/style-rtl.css +1 -0
- package/build-style/post-template/style.css +1 -0
- package/build-style/query-total/style-rtl.css +103 -0
- package/build-style/query-total/style.css +103 -0
- package/build-style/read-more/style-rtl.css +2 -3
- package/build-style/read-more/style.css +2 -3
- package/build-style/social-link/editor-rtl.css +2 -2
- package/build-style/social-link/editor.css +2 -2
- package/build-style/social-links/editor-rtl.css +2 -2
- package/build-style/social-links/editor.css +2 -2
- package/build-style/social-links/style-rtl.css +2 -2
- package/build-style/social-links/style.css +2 -2
- package/build-style/style-rtl.css +59 -53
- package/build-style/style.css +59 -53
- package/build-style/tag-cloud/editor-rtl.css +0 -5
- package/build-style/tag-cloud/editor.css +0 -5
- package/build-style/text-columns/style-rtl.css +3 -3
- package/build-style/text-columns/style.css +3 -3
- package/package.json +36 -35
- package/src/archives/edit.js +94 -36
- package/src/audio/test/__snapshots__/edit.native.js.snap +1 -1
- package/src/block/index.php +20 -0
- package/src/button/block.json +17 -2
- package/src/button/deprecated.js +189 -0
- package/src/button/edit.js +61 -32
- package/src/button/save.js +6 -1
- package/src/column/edit.js +34 -13
- package/src/columns/edit.js +71 -40
- package/src/comments/index.js +1 -0
- package/src/cover/edit/index.js +12 -5
- package/src/cover/edit.native.js +5 -2
- package/src/cover/test/edit.js +5 -7
- package/src/details/edit.js +40 -11
- package/src/editor.scss +0 -1
- package/src/file/test/__snapshots__/edit.native.js.snap +1 -1
- package/src/form/block.json +1 -2
- package/src/form/index.php +1 -20
- package/src/form/view.js +18 -5
- package/src/image/image.js +1 -1
- package/src/image/index.php +1 -1
- package/src/image/transforms.js +1 -0
- package/src/image/view.js +1 -3
- package/src/index.js +2 -0
- package/src/latest-posts/block.json +12 -0
- package/src/latest-posts/style.scss +2 -1
- package/src/loginout/edit.js +56 -20
- package/src/media-text/edit.js +57 -28
- package/src/more/edit.js +39 -12
- package/src/navigation/edit/navigation-menu-selector.js +9 -2
- package/src/navigation/index.php +2 -2
- package/src/navigation-link/edit.js +101 -67
- package/src/navigation-link/index.php +16 -1
- package/src/navigation-link/link-ui.js +1 -1
- package/src/navigation-submenu/edit.js +113 -63
- package/src/page-list/edit.js +52 -31
- package/src/paragraph/edit.js +29 -5
- package/src/post-author/block.json +4 -2
- package/src/post-author/edit.js +17 -3
- package/src/post-author/index.php +4 -0
- package/src/post-author-name/block.json +4 -2
- package/src/post-author-name/edit.js +17 -4
- package/src/post-author-name/index.php +4 -0
- package/src/post-comments-form/block.json +6 -1
- package/src/post-comments-link/block.json +8 -1
- package/src/post-comments-link/style.scss +4 -0
- package/src/post-content/index.php +23 -0
- package/src/post-date/block.json +2 -1
- package/src/post-date/edit.js +79 -25
- package/src/post-excerpt/edit.js +59 -22
- package/src/post-featured-image/block.json +6 -3
- package/src/post-featured-image/dimension-controls.js +18 -21
- package/src/post-featured-image/edit.js +67 -10
- package/src/post-navigation-link/block.json +0 -6
- package/src/post-navigation-link/index.js +11 -0
- package/src/post-navigation-link/variations.js +2 -2
- package/src/post-template/block.json +12 -2
- package/src/post-template/style.scss +2 -0
- package/src/post-title/block.json +6 -3
- package/src/query-no-results/block.json +1 -11
- package/src/query-no-results/index.js +11 -0
- package/src/query-pagination/edit.js +57 -15
- package/src/query-pagination/query-pagination-label-control.js +1 -3
- package/src/query-pagination-numbers/edit.js +41 -19
- package/src/query-pagination-previous/index.php +21 -14
- package/src/query-total/block.json +52 -0
- package/src/query-total/edit.js +81 -0
- package/src/query-total/icons.js +43 -0
- package/src/query-total/index.js +18 -0
- package/src/query-total/index.php +88 -0
- package/src/query-total/init.js +6 -0
- package/src/query-total/style.scss +4 -0
- package/src/read-more/index.js +6 -0
- package/src/site-logo/block.json +4 -2
- package/src/site-title/block.json +4 -2
- package/src/site-title/edit.js +52 -15
- package/src/social-link/edit.js +21 -6
- package/src/social-links/edit.js +52 -15
- package/src/spacer/controls.js +42 -15
- package/src/style.scss +2 -0
- package/src/table/block.json +4 -1
- package/src/table/edit.js +58 -20
- package/src/table-of-contents/block.json +0 -52
- package/src/table-of-contents/edit.js +1 -1
- package/src/table-of-contents/index.js +53 -0
- package/src/tag-cloud/edit.js +60 -8
- package/src/tag-cloud/editor.scss +0 -8
- package/src/video/edit-common-settings.js +97 -39
- package/src/video/edit.js +29 -75
- package/src/video/poster-image.js +86 -0
- package/src/video/tracks-editor.js +1 -1
- package/tsconfig.json +0 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/src/post-template/editor.scss +0 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blocks","require","_data","_blockEditor","createNavigationLinks","pages","linkMap","navigationLinks","forEach","id","title","link","url","type","parent","_linkMap$id$innerBloc","innerBlocks","createBlock","label","rendered","kind","push","parentLinkInnerBlocks","findNavigationLinkById","navigationLink","attributes","length","foundNavigationLink","convertToNavigationLinks","parentPageID","parentPage","transformSubmenus","listOfLinks","block","index","listOfLinksArray","transformedBlock","useConvertToNavigationLinks","clientId","parentClientId","replaceBlock","selectBlock","useDispatch","blockEditorStore"],"sources":["@wordpress/block-library/src/page-list/use-convert-to-navigation-links.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createBlock } from '@wordpress/blocks';\nimport { useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Converts an array of pages into a nested array of navigation link blocks.\n *\n * @param {Array} pages An array of pages.\n *\n * @return {Array} A nested array of navigation link blocks.\n */\nfunction createNavigationLinks( pages = [] ) {\n\tconst linkMap = {};\n\tconst navigationLinks = [];\n\tpages.forEach( ( { id, title, link: url, type, parent } ) => {\n\t\t// See if a placeholder exists. This is created if children appear before parents in list.\n\t\tconst innerBlocks = linkMap[ id ]?.innerBlocks ?? [];\n\t\tlinkMap[ id ] = createBlock(\n\t\t\t'core/navigation-link',\n\t\t\t{\n\t\t\t\tid,\n\t\t\t\tlabel: title.rendered,\n\t\t\t\turl,\n\t\t\t\ttype,\n\t\t\t\tkind: 'post-type',\n\t\t\t},\n\t\t\tinnerBlocks\n\t\t);\n\n\t\tif ( ! parent ) {\n\t\t\tnavigationLinks.push( linkMap[ id ] );\n\t\t} else {\n\t\t\tif ( ! linkMap[ parent ] ) {\n\t\t\t\t// Use a placeholder if the child appears before parent in list.\n\t\t\t\tlinkMap[ parent ] = { innerBlocks: [] };\n\t\t\t}\n\t\t\t// Although these variables are not referenced, they are needed to store the innerBlocks in memory.\n\t\t\tconst parentLinkInnerBlocks = linkMap[ parent ].innerBlocks;\n\t\t\tparentLinkInnerBlocks.push( linkMap[ id ] );\n\t\t}\n\t} );\n\n\treturn navigationLinks;\n}\n\n/**\n * Finds a navigation link block by id, recursively.\n * It might be possible to make this a more generic helper function.\n *\n * @param {Array} navigationLinks An array of navigation link blocks.\n * @param {number} id The id of the navigation link to find.\n *\n * @return {Object|null} The navigation link block with the given id.\n */\nfunction findNavigationLinkById( navigationLinks, id ) {\n\tfor ( const navigationLink of navigationLinks ) {\n\t\t// Is this the link we're looking for?\n\t\tif ( navigationLink.attributes.id === id ) {\n\t\t\treturn navigationLink;\n\t\t}\n\n\t\t// If not does it have innerBlocks?\n\t\tif ( navigationLink.innerBlocks && navigationLink.innerBlocks.length ) {\n\t\t\tconst foundNavigationLink = findNavigationLinkById(\n\t\t\t\tnavigationLink.innerBlocks,\n\t\t\t\tid\n\t\t\t);\n\n\t\t\tif ( foundNavigationLink ) {\n\t\t\t\treturn foundNavigationLink;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn null;\n}\n\nexport function convertToNavigationLinks( pages = [], parentPageID = null ) {\n\tlet navigationLinks = createNavigationLinks( pages );\n\n\t// If a parent page ID is provided, only return the children of that page.\n\tif ( parentPageID ) {\n\t\tconst parentPage = findNavigationLinkById(\n\t\t\tnavigationLinks,\n\t\t\tparentPageID\n\t\t);\n\t\tif ( parentPage && parentPage.innerBlocks ) {\n\t\t\tnavigationLinks = parentPage.innerBlocks;\n\t\t}\n\t}\n\n\t// Transform all links with innerBlocks into Submenus. This can't be done\n\t// sooner because page objects have no information on their children.\n\tconst transformSubmenus = ( listOfLinks ) => {\n\t\tlistOfLinks.forEach( ( block, index, listOfLinksArray ) => {\n\t\t\tconst { attributes, innerBlocks } = block;\n\t\t\tif ( innerBlocks.length !== 0 ) {\n\t\t\t\ttransformSubmenus( innerBlocks );\n\t\t\t\tconst transformedBlock = createBlock(\n\t\t\t\t\t'core/navigation-submenu',\n\t\t\t\t\tattributes,\n\t\t\t\t\tinnerBlocks\n\t\t\t\t);\n\t\t\t\tlistOfLinksArray[ index ] = transformedBlock;\n\t\t\t}\n\t\t} );\n\t};\n\n\ttransformSubmenus( navigationLinks );\n\treturn navigationLinks;\n}\n\nexport function useConvertToNavigationLinks( {\n\tclientId,\n\tpages,\n\tparentClientId,\n\tparentPageID,\n} ) {\n\tconst { replaceBlock, selectBlock } = useDispatch( blockEditorStore );\n\n\treturn () => {\n\t\tconst navigationLinks = convertToNavigationLinks( pages, parentPageID );\n\n\t\t// Replace the Page List block with the Navigation Links.\n\t\treplaceBlock( clientId, navigationLinks );\n\n\t\t// Select the Navigation block to reveal the changes.\n\t\tselectBlock( parentClientId );\n\t};\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_blocks","require","_data","_blockEditor","createNavigationLinks","pages","linkMap","navigationLinks","forEach","id","title","link","url","type","parent","_linkMap$id$innerBloc","innerBlocks","createBlock","label","rendered","kind","push","parentLinkInnerBlocks","findNavigationLinkById","navigationLink","attributes","length","foundNavigationLink","convertToNavigationLinks","parentPageID","parentPage","transformSubmenus","listOfLinks","block","index","listOfLinksArray","transformedBlock","useConvertToNavigationLinks","clientId","parentClientId","replaceBlock","selectBlock","useDispatch","blockEditorStore"],"sources":["@wordpress/block-library/src/page-list/use-convert-to-navigation-links.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createBlock } from '@wordpress/blocks';\nimport { useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Converts an array of pages into a nested array of navigation link blocks.\n *\n * @param {Array} pages An array of pages.\n *\n * @return {Array} A nested array of navigation link blocks.\n */\nfunction createNavigationLinks( pages = [] ) {\n\tconst linkMap = {};\n\tconst navigationLinks = [];\n\tpages.forEach( ( { id, title, link: url, type, parent } ) => {\n\t\t// See if a placeholder exists. This is created if children appear before parents in list.\n\t\tconst innerBlocks = linkMap[ id ]?.innerBlocks ?? [];\n\t\tlinkMap[ id ] = createBlock(\n\t\t\t'core/navigation-link',\n\t\t\t{\n\t\t\t\tid,\n\t\t\t\tlabel: title.rendered,\n\t\t\t\turl,\n\t\t\t\ttype,\n\t\t\t\tkind: 'post-type',\n\t\t\t},\n\t\t\tinnerBlocks\n\t\t);\n\n\t\tif ( ! parent ) {\n\t\t\tnavigationLinks.push( linkMap[ id ] );\n\t\t} else {\n\t\t\tif ( ! linkMap[ parent ] ) {\n\t\t\t\t// Use a placeholder if the child appears before parent in list.\n\t\t\t\tlinkMap[ parent ] = { innerBlocks: [] };\n\t\t\t}\n\t\t\t// Although these variables are not referenced, they are needed to store the innerBlocks in memory.\n\t\t\tconst parentLinkInnerBlocks = linkMap[ parent ].innerBlocks;\n\t\t\tparentLinkInnerBlocks.push( linkMap[ id ] );\n\t\t}\n\t} );\n\n\treturn navigationLinks;\n}\n\n/**\n * Finds a navigation link block by id, recursively.\n * It might be possible to make this a more generic helper function.\n *\n * @param {Array} navigationLinks An array of navigation link blocks.\n * @param {number} id The id of the navigation link to find.\n *\n * @return {Object|null} The navigation link block with the given id.\n */\nfunction findNavigationLinkById( navigationLinks, id ) {\n\tfor ( const navigationLink of navigationLinks ) {\n\t\t// Is this the link we're looking for?\n\t\tif ( navigationLink.attributes.id === id ) {\n\t\t\treturn navigationLink;\n\t\t}\n\n\t\t// If not does it have innerBlocks?\n\t\tif ( navigationLink.innerBlocks && navigationLink.innerBlocks.length ) {\n\t\t\tconst foundNavigationLink = findNavigationLinkById(\n\t\t\t\tnavigationLink.innerBlocks,\n\t\t\t\tid\n\t\t\t);\n\n\t\t\tif ( foundNavigationLink ) {\n\t\t\t\treturn foundNavigationLink;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn null;\n}\n\nexport function convertToNavigationLinks( pages = [], parentPageID = null ) {\n\tlet navigationLinks = createNavigationLinks( pages );\n\n\t// If a parent page ID is provided, only return the children of that page.\n\tif ( parentPageID ) {\n\t\tconst parentPage = findNavigationLinkById(\n\t\t\tnavigationLinks,\n\t\t\tparentPageID\n\t\t);\n\t\tif ( parentPage && parentPage.innerBlocks ) {\n\t\t\tnavigationLinks = parentPage.innerBlocks;\n\t\t}\n\t}\n\n\t// Transform all links with innerBlocks into Submenus. This can't be done\n\t// sooner because page objects have no information on their children.\n\tconst transformSubmenus = ( listOfLinks ) => {\n\t\tlistOfLinks.forEach( ( block, index, listOfLinksArray ) => {\n\t\t\tconst { attributes, innerBlocks } = block;\n\t\t\tif ( innerBlocks.length !== 0 ) {\n\t\t\t\ttransformSubmenus( innerBlocks );\n\t\t\t\tconst transformedBlock = createBlock(\n\t\t\t\t\t'core/navigation-submenu',\n\t\t\t\t\tattributes,\n\t\t\t\t\tinnerBlocks\n\t\t\t\t);\n\t\t\t\tlistOfLinksArray[ index ] = transformedBlock;\n\t\t\t}\n\t\t} );\n\t};\n\n\ttransformSubmenus( navigationLinks );\n\treturn navigationLinks;\n}\n\nexport function useConvertToNavigationLinks( {\n\tclientId,\n\tpages,\n\tparentClientId,\n\tparentPageID,\n} ) {\n\tconst { replaceBlock, selectBlock } = useDispatch( blockEditorStore );\n\n\treturn () => {\n\t\tconst navigationLinks = convertToNavigationLinks( pages, parentPageID );\n\n\t\t// Replace the Page List block with the Navigation Links.\n\t\treplaceBlock( clientId, navigationLinks );\n\n\t\t// Select the Navigation block to reveal the changes.\n\t\tselectBlock( parentClientId );\n\t};\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AALA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASG,qBAAqBA,CAAEC,KAAK,GAAG,EAAE,EAAG;EAC5C,MAAMC,OAAO,GAAG,CAAC,CAAC;EAClB,MAAMC,eAAe,GAAG,EAAE;EAC1BF,KAAK,CAACG,OAAO,CAAE,CAAE;IAAE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AAK,EAAEwB,YAAa,CAAC;;IAEvE;IACAW,YAAY,CAAEF,QAAQ,EAAE/B,eAAgB,CAAC;;IAEzC;IACAkC,WAAW,CAAEF,cAAe,CAAC;EAC9B,CAAC;AACF","ignoreList":[]}
|
package/build/paragraph/edit.js
CHANGED
|
@@ -9,8 +9,11 @@ var _clsx = _interopRequireDefault(require("clsx"));
|
|
|
9
9
|
var _i18n = require("@wordpress/i18n");
|
|
10
10
|
var _components = require("@wordpress/components");
|
|
11
11
|
var _blockEditor = require("@wordpress/block-editor");
|
|
12
|
+
var _data = require("@wordpress/data");
|
|
13
|
+
var _blocks = require("@wordpress/blocks");
|
|
12
14
|
var _icons = require("@wordpress/icons");
|
|
13
15
|
var _useEnter = require("./use-enter");
|
|
16
|
+
var _lockUnlock = require("../lock-unlock");
|
|
14
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
18
|
/**
|
|
16
19
|
* External dependencies
|
|
@@ -43,7 +46,8 @@ function hasDropCapDisabled(align) {
|
|
|
43
46
|
function DropCapControl({
|
|
44
47
|
clientId,
|
|
45
48
|
attributes,
|
|
46
|
-
setAttributes
|
|
49
|
+
setAttributes,
|
|
50
|
+
name
|
|
47
51
|
}) {
|
|
48
52
|
// Please do not add a useSelect call to the paragraph block unconditionally.
|
|
49
53
|
// Every useSelect added to a (frequently used) block will degrade load
|
|
@@ -65,11 +69,13 @@ function DropCapControl({
|
|
|
65
69
|
} else {
|
|
66
70
|
helpText = (0, _i18n.__)('Show a large initial letter.');
|
|
67
71
|
}
|
|
72
|
+
const isDropCapControlEnabledByDefault = (0, _blocks.getBlockSupport)(name, 'typography.defaultControls.dropCap', false);
|
|
68
73
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.InspectorControls, {
|
|
69
74
|
group: "typography",
|
|
70
75
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
|
|
71
76
|
hasValue: () => !!dropCap,
|
|
72
77
|
label: (0, _i18n.__)('Drop cap'),
|
|
78
|
+
isShownByDefault: isDropCapControlEnabledByDefault,
|
|
73
79
|
onDeselect: () => setAttributes({
|
|
74
80
|
dropCap: undefined
|
|
75
81
|
}),
|
|
@@ -97,14 +103,15 @@ function ParagraphBlock({
|
|
|
97
103
|
onRemove,
|
|
98
104
|
setAttributes,
|
|
99
105
|
clientId,
|
|
100
|
-
isSelected: isSingleSelected
|
|
106
|
+
isSelected: isSingleSelected,
|
|
107
|
+
name
|
|
101
108
|
}) {
|
|
109
|
+
const isZoomOut = (0, _data.useSelect)(select => (0, _lockUnlock.unlock)(select(_blockEditor.store)).isZoomOut());
|
|
102
110
|
const {
|
|
103
111
|
align,
|
|
104
112
|
content,
|
|
105
113
|
direction,
|
|
106
|
-
dropCap
|
|
107
|
-
placeholder
|
|
114
|
+
dropCap
|
|
108
115
|
} = attributes;
|
|
109
116
|
const blockProps = (0, _blockEditor.useBlockProps)({
|
|
110
117
|
ref: (0, _useEnter.useOnEnter)({
|
|
@@ -120,6 +127,14 @@ function ParagraphBlock({
|
|
|
120
127
|
}
|
|
121
128
|
});
|
|
122
129
|
const blockEditingMode = (0, _blockEditor.useBlockEditingMode)();
|
|
130
|
+
let {
|
|
131
|
+
placeholder
|
|
132
|
+
} = attributes;
|
|
133
|
+
if (isZoomOut) {
|
|
134
|
+
placeholder = '';
|
|
135
|
+
} else if (!placeholder) {
|
|
136
|
+
placeholder = (0, _i18n.__)('Type / to choose a block');
|
|
137
|
+
}
|
|
123
138
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
124
139
|
children: [blockEditingMode === 'default' && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_blockEditor.BlockControls, {
|
|
125
140
|
group: "block",
|
|
@@ -136,6 +151,7 @@ function ParagraphBlock({
|
|
|
136
151
|
})
|
|
137
152
|
})]
|
|
138
153
|
}), isSingleSelected && /*#__PURE__*/(0, _jsxRuntime.jsx)(DropCapControl, {
|
|
154
|
+
name: name,
|
|
139
155
|
clientId: clientId,
|
|
140
156
|
attributes: attributes,
|
|
141
157
|
setAttributes: setAttributes
|
|
@@ -152,8 +168,8 @@ function ParagraphBlock({
|
|
|
152
168
|
onRemove: onRemove,
|
|
153
169
|
"aria-label": _blockEditor.RichText.isEmpty(content) ? (0, _i18n.__)('Empty block; start writing or type forward slash to choose a block') : (0, _i18n.__)('Block: Paragraph'),
|
|
154
170
|
"data-empty": _blockEditor.RichText.isEmpty(content),
|
|
155
|
-
placeholder: placeholder
|
|
156
|
-
"data-custom-placeholder": placeholder ? true : undefined,
|
|
171
|
+
placeholder: placeholder,
|
|
172
|
+
"data-custom-placeholder": placeholder && !isZoomOut ? true : undefined,
|
|
157
173
|
__unstableEmbedURLOnPaste: true,
|
|
158
174
|
__unstableAllowPrefixTransformations: true
|
|
159
175
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_components","_blockEditor","_icons","_useEnter","_jsxRuntime","ParagraphRTLControl","direction","setDirection","isRTL","jsx","ToolbarButton","icon","formatLtr","title","_x","isActive","onClick","undefined","hasDropCapDisabled","align","DropCapControl","clientId","attributes","setAttributes","isDropCapFeatureEnabled","useSettings","dropCap","helpText","__","InspectorControls","group","children","__experimentalToolsPanelItem","hasValue","label","onDeselect","resetAllFilter","panelId","ToggleControl","__nextHasNoMarginBottom","checked","onChange","help","disabled","ParagraphBlock","mergeBlocks","onReplace","onRemove","isSelected","isSingleSelected","content","placeholder","blockProps","useBlockProps","ref","useOnEnter","className","clsx","style","blockEditingMode","useBlockEditingMode","jsxs","Fragment","BlockControls","AlignmentControl","value","newAlign","newDirection","RichText","identifier","tagName","newContent","onMerge","isEmpty","__unstableEmbedURLOnPaste","__unstableAllowPrefixTransformations","_default","exports","default"],"sources":["@wordpress/block-library/src/paragraph/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, _x, isRTL } from '@wordpress/i18n';\nimport {\n\tToolbarButton,\n\tToggleControl,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tInspectorControls,\n\tRichText,\n\tuseBlockProps,\n\tuseSettings,\n\tuseBlockEditingMode,\n} from '@wordpress/block-editor';\nimport { formatLtr } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { useOnEnter } from './use-enter';\n\nfunction ParagraphRTLControl( { direction, setDirection } ) {\n\treturn (\n\t\tisRTL() && (\n\t\t\t<ToolbarButton\n\t\t\t\ticon={ formatLtr }\n\t\t\t\ttitle={ _x( 'Left to right', 'editor button' ) }\n\t\t\t\tisActive={ direction === 'ltr' }\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tsetDirection( direction === 'ltr' ? undefined : 'ltr' );\n\t\t\t\t} }\n\t\t\t/>\n\t\t)\n\t);\n}\n\nfunction hasDropCapDisabled( align ) {\n\treturn align === ( isRTL() ? 'left' : 'right' ) || align === 'center';\n}\n\nfunction DropCapControl( { clientId, attributes, setAttributes } ) {\n\t// Please do not add a useSelect call to the paragraph block unconditionally.\n\t// Every useSelect added to a (frequently used) block will degrade load\n\t// and type performance. By moving it within InspectorControls, the subscription is\n\t// now only added for the selected block(s).\n\tconst [ isDropCapFeatureEnabled ] = useSettings( 'typography.dropCap' );\n\n\tif ( ! isDropCapFeatureEnabled ) {\n\t\treturn null;\n\t}\n\n\tconst { align, dropCap } = attributes;\n\n\tlet helpText;\n\tif ( hasDropCapDisabled( align ) ) {\n\t\thelpText = __( 'Not available for aligned text.' );\n\t} else if ( dropCap ) {\n\t\thelpText = __( 'Showing large initial letter.' );\n\t} else {\n\t\thelpText = __( 'Show a large initial letter.' );\n\t}\n\n\treturn (\n\t\t<InspectorControls group=\"typography\">\n\t\t\t<ToolsPanelItem\n\t\t\t\thasValue={ () => !! dropCap }\n\t\t\t\tlabel={ __( 'Drop cap' ) }\n\t\t\t\tonDeselect={ () => setAttributes( { dropCap: undefined } ) }\n\t\t\t\tresetAllFilter={ () => ( { dropCap: undefined } ) }\n\t\t\t\tpanelId={ clientId }\n\t\t\t>\n\t\t\t\t<ToggleControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Drop cap' ) }\n\t\t\t\t\tchecked={ !! dropCap }\n\t\t\t\t\tonChange={ () => setAttributes( { dropCap: ! dropCap } ) }\n\t\t\t\t\thelp={ helpText }\n\t\t\t\t\tdisabled={ hasDropCapDisabled( align ) }\n\t\t\t\t/>\n\t\t\t</ToolsPanelItem>\n\t\t</InspectorControls>\n\t);\n}\n\nfunction ParagraphBlock( {\n\tattributes,\n\tmergeBlocks,\n\tonReplace,\n\tonRemove,\n\tsetAttributes,\n\tclientId,\n\tisSelected: isSingleSelected,\n} ) {\n\tconst { align, content, direction, dropCap, placeholder } = attributes;\n\tconst blockProps = useBlockProps( {\n\t\tref: useOnEnter( { clientId, content } ),\n\t\tclassName: clsx( {\n\t\t\t'has-drop-cap': hasDropCapDisabled( align ) ? false : dropCap,\n\t\t\t[ `has-text-align-${ align }` ]: align,\n\t\t} ),\n\t\tstyle: { direction },\n\t} );\n\tconst blockEditingMode = useBlockEditingMode();\n\n\treturn (\n\t\t<>\n\t\t\t{ blockEditingMode === 'default' && (\n\t\t\t\t<BlockControls group=\"block\">\n\t\t\t\t\t<AlignmentControl\n\t\t\t\t\t\tvalue={ align }\n\t\t\t\t\t\tonChange={ ( newAlign ) =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\talign: newAlign,\n\t\t\t\t\t\t\t\tdropCap: hasDropCapDisabled( newAlign )\n\t\t\t\t\t\t\t\t\t? false\n\t\t\t\t\t\t\t\t\t: dropCap,\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<ParagraphRTLControl\n\t\t\t\t\t\tdirection={ direction }\n\t\t\t\t\t\tsetDirection={ ( newDirection ) =>\n\t\t\t\t\t\t\tsetAttributes( { direction: newDirection } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\t\t\t{ isSingleSelected && (\n\t\t\t\t<DropCapControl\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<RichText\n\t\t\t\tidentifier=\"content\"\n\t\t\t\ttagName=\"p\"\n\t\t\t\t{ ...blockProps }\n\t\t\t\tvalue={ content }\n\t\t\t\tonChange={ ( newContent ) =>\n\t\t\t\t\tsetAttributes( { content: newContent } )\n\t\t\t\t}\n\t\t\t\tonMerge={ mergeBlocks }\n\t\t\t\tonReplace={ onReplace }\n\t\t\t\tonRemove={ onRemove }\n\t\t\t\taria-label={\n\t\t\t\t\tRichText.isEmpty( content )\n\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t'Empty block; start writing or type forward slash to choose a block'\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: __( 'Block: Paragraph' )\n\t\t\t\t}\n\t\t\t\tdata-empty={ RichText.isEmpty( content ) }\n\t\t\t\tplaceholder={ placeholder || __( 'Type / to choose a block' ) }\n\t\t\t\tdata-custom-placeholder={ placeholder ? true : undefined }\n\t\t\t\t__unstableEmbedURLOnPaste\n\t\t\t\t__unstableAllowPrefixTransformations\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default ParagraphBlock;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAKA,IAAAG,YAAA,GAAAH,OAAA;AASA,IAAAI,MAAA,GAAAJ,OAAA;AAKA,IAAAK,SAAA,GAAAL,OAAA;AAAyC,IAAAM,WAAA,GAAAN,OAAA;AA5BzC;AACA;AACA;;AAGA;A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,UAAU,IACtBhD,aAAa,CAAE;QAAE2B,OAAO,EAAEqB;MAAW,CAAE,CACvC;MACDC,OAAO,EAAG3B,WAAa;MACvBC,SAAS,EAAGA,SAAW;MACvBC,QAAQ,EAAGA,QAAU;MACrB,cACCqB,qBAAQ,CAACK,OAAO,CAAEvB,OAAQ,CAAC,GACxB,IAAAtB,QAAE,EACF,oEACA,CAAC,GACD,IAAAA,QAAE,EAAE,kBAAmB,CAC1B;MACD,cAAawC,qBAAQ,CAACK,OAAO,CAAEvB,OAAQ,CAAG;MAC1CC,WAAW,EAAGA,WAAW,IAAI,IAAAvB,QAAE,EAAE,0BAA2B,CAAG;MAC/D,2BAA0BuB,WAAW,GAAG,IAAI,GAAGlC,SAAW;MAC1DyD,yBAAyB;MACzBC,oCAAoC;IAAA,CACpC,CAAC;EAAA,CACD,CAAC;AAEL;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEclC,cAAc","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_components","_blockEditor","_data","_blocks","_icons","_useEnter","_lockUnlock","_jsxRuntime","ParagraphRTLControl","direction","setDirection","isRTL","jsx","ToolbarButton","icon","formatLtr","title","_x","isActive","onClick","undefined","hasDropCapDisabled","align","DropCapControl","clientId","attributes","setAttributes","name","isDropCapFeatureEnabled","useSettings","dropCap","helpText","__","isDropCapControlEnabledByDefault","getBlockSupport","InspectorControls","group","children","__experimentalToolsPanelItem","hasValue","label","isShownByDefault","onDeselect","resetAllFilter","panelId","ToggleControl","__nextHasNoMarginBottom","checked","onChange","help","disabled","ParagraphBlock","mergeBlocks","onReplace","onRemove","isSelected","isSingleSelected","isZoomOut","useSelect","select","unlock","blockEditorStore","content","blockProps","useBlockProps","ref","useOnEnter","className","clsx","style","blockEditingMode","useBlockEditingMode","placeholder","jsxs","Fragment","BlockControls","AlignmentControl","value","newAlign","newDirection","RichText","identifier","tagName","newContent","onMerge","isEmpty","__unstableEmbedURLOnPaste","__unstableAllowPrefixTransformations","_default","exports","default"],"sources":["@wordpress/block-library/src/paragraph/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, _x, isRTL } from '@wordpress/i18n';\nimport {\n\tToolbarButton,\n\tToggleControl,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tInspectorControls,\n\tRichText,\n\tuseBlockProps,\n\tuseSettings,\n\tuseBlockEditingMode,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { getBlockSupport } from '@wordpress/blocks';\nimport { formatLtr } from '@wordpress/icons';\n/**\n * Internal dependencies\n */\nimport { useOnEnter } from './use-enter';\nimport { unlock } from '../lock-unlock';\n\nfunction ParagraphRTLControl( { direction, setDirection } ) {\n\treturn (\n\t\tisRTL() && (\n\t\t\t<ToolbarButton\n\t\t\t\ticon={ formatLtr }\n\t\t\t\ttitle={ _x( 'Left to right', 'editor button' ) }\n\t\t\t\tisActive={ direction === 'ltr' }\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tsetDirection( direction === 'ltr' ? undefined : 'ltr' );\n\t\t\t\t} }\n\t\t\t/>\n\t\t)\n\t);\n}\n\nfunction hasDropCapDisabled( align ) {\n\treturn align === ( isRTL() ? 'left' : 'right' ) || align === 'center';\n}\n\nfunction DropCapControl( { clientId, attributes, setAttributes, name } ) {\n\t// Please do not add a useSelect call to the paragraph block unconditionally.\n\t// Every useSelect added to a (frequently used) block will degrade load\n\t// and type performance. By moving it within InspectorControls, the subscription is\n\t// now only added for the selected block(s).\n\tconst [ isDropCapFeatureEnabled ] = useSettings( 'typography.dropCap' );\n\n\tif ( ! isDropCapFeatureEnabled ) {\n\t\treturn null;\n\t}\n\n\tconst { align, dropCap } = attributes;\n\n\tlet helpText;\n\tif ( hasDropCapDisabled( align ) ) {\n\t\thelpText = __( 'Not available for aligned text.' );\n\t} else if ( dropCap ) {\n\t\thelpText = __( 'Showing large initial letter.' );\n\t} else {\n\t\thelpText = __( 'Show a large initial letter.' );\n\t}\n\n\tconst isDropCapControlEnabledByDefault = getBlockSupport(\n\t\tname,\n\t\t'typography.defaultControls.dropCap',\n\t\tfalse\n\t);\n\n\treturn (\n\t\t<InspectorControls group=\"typography\">\n\t\t\t<ToolsPanelItem\n\t\t\t\thasValue={ () => !! dropCap }\n\t\t\t\tlabel={ __( 'Drop cap' ) }\n\t\t\t\tisShownByDefault={ isDropCapControlEnabledByDefault }\n\t\t\t\tonDeselect={ () => setAttributes( { dropCap: undefined } ) }\n\t\t\t\tresetAllFilter={ () => ( { dropCap: undefined } ) }\n\t\t\t\tpanelId={ clientId }\n\t\t\t>\n\t\t\t\t<ToggleControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Drop cap' ) }\n\t\t\t\t\tchecked={ !! dropCap }\n\t\t\t\t\tonChange={ () => setAttributes( { dropCap: ! dropCap } ) }\n\t\t\t\t\thelp={ helpText }\n\t\t\t\t\tdisabled={ hasDropCapDisabled( align ) }\n\t\t\t\t/>\n\t\t\t</ToolsPanelItem>\n\t\t</InspectorControls>\n\t);\n}\n\nfunction ParagraphBlock( {\n\tattributes,\n\tmergeBlocks,\n\tonReplace,\n\tonRemove,\n\tsetAttributes,\n\tclientId,\n\tisSelected: isSingleSelected,\n\tname,\n} ) {\n\tconst isZoomOut = useSelect( ( select ) =>\n\t\tunlock( select( blockEditorStore ) ).isZoomOut()\n\t);\n\n\tconst { align, content, direction, dropCap } = attributes;\n\tconst blockProps = useBlockProps( {\n\t\tref: useOnEnter( { clientId, content } ),\n\t\tclassName: clsx( {\n\t\t\t'has-drop-cap': hasDropCapDisabled( align ) ? false : dropCap,\n\t\t\t[ `has-text-align-${ align }` ]: align,\n\t\t} ),\n\t\tstyle: { direction },\n\t} );\n\tconst blockEditingMode = useBlockEditingMode();\n\tlet { placeholder } = attributes;\n\tif ( isZoomOut ) {\n\t\tplaceholder = '';\n\t} else if ( ! placeholder ) {\n\t\tplaceholder = __( 'Type / to choose a block' );\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ blockEditingMode === 'default' && (\n\t\t\t\t<BlockControls group=\"block\">\n\t\t\t\t\t<AlignmentControl\n\t\t\t\t\t\tvalue={ align }\n\t\t\t\t\t\tonChange={ ( newAlign ) =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\talign: newAlign,\n\t\t\t\t\t\t\t\tdropCap: hasDropCapDisabled( newAlign )\n\t\t\t\t\t\t\t\t\t? false\n\t\t\t\t\t\t\t\t\t: dropCap,\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<ParagraphRTLControl\n\t\t\t\t\t\tdirection={ direction }\n\t\t\t\t\t\tsetDirection={ ( newDirection ) =>\n\t\t\t\t\t\t\tsetAttributes( { direction: newDirection } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\t\t\t{ isSingleSelected && (\n\t\t\t\t<DropCapControl\n\t\t\t\t\tname={ name }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<RichText\n\t\t\t\tidentifier=\"content\"\n\t\t\t\ttagName=\"p\"\n\t\t\t\t{ ...blockProps }\n\t\t\t\tvalue={ content }\n\t\t\t\tonChange={ ( newContent ) =>\n\t\t\t\t\tsetAttributes( { content: newContent } )\n\t\t\t\t}\n\t\t\t\tonMerge={ mergeBlocks }\n\t\t\t\tonReplace={ onReplace }\n\t\t\t\tonRemove={ onRemove }\n\t\t\t\taria-label={\n\t\t\t\t\tRichText.isEmpty( content )\n\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t'Empty block; start writing or type forward slash to choose a block'\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: __( 'Block: Paragraph' )\n\t\t\t\t}\n\t\t\t\tdata-empty={ RichText.isEmpty( content ) }\n\t\t\t\tplaceholder={ placeholder }\n\t\t\t\tdata-custom-placeholder={\n\t\t\t\t\tplaceholder && ! isZoomOut ? true : undefined\n\t\t\t\t}\n\t\t\t\t__unstableEmbedURLOnPaste\n\t\t\t\t__unstableAllowPrefixTransformations\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default ParagraphBlock;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAKA,IAAAG,YAAA,GAAAH,OAAA;AAUA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAIA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AAAwC,IAAAS,WAAA,GAAAT,OAAA;AA/BxC;AACA;AACA;;AAGA;AACA;AACA;;AAoBA;AACA;AACA;;AAIA,SAASU,mBAAmBA,CAAE;EAAEC,SAAS;EAAEC;AAAa,CAAC,EAAG;EAC3D,OACC,IAAAC,WAAK,EAAC,CAAC,iBACN,IAAAJ,WAAA,CAAAK,GAAA,EAACZ,WAAA,CAAAa,aAAa;IACbC,IAAI,EAAGC,gBAAW;IAClBC,KAAK,EAAG,IAAAC,QAAE,EAAE,eAAe,EAAE,eAAgB,CAAG;IAChDC,QAAQ,EAAGT,SAAS,KAAK,KAAO;IAChCU,OAAO,EAAGA,CAAA,KAAM;MACfT,YAAY,CAAED,SAAS,KAAK,KAAK,GAAGW,SAAS,GAAG,KAAM,CAAC;IACxD;EAAG,CACH,CACD;AAEH;AAEA,SAASC,kBAAkBA,CAAEC,KAAK,EAAG;EACpC,OAAOA,KAAK,MAAO,IAAAX,WAAK,E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Aa,CAAE;QAAEoC,OAAO,EAAEqB;MAAW,CAAE,CACvC;MACDC,OAAO,EAAGhC,WAAa;MACvBC,SAAS,EAAGA,SAAW;MACvBC,QAAQ,EAAGA,QAAU;MACrB,cACC0B,qBAAQ,CAACK,OAAO,CAAEvB,OAAQ,CAAC,GACxB,IAAA9B,QAAE,EACF,oEACA,CAAC,GACD,IAAAA,QAAE,EAAE,kBAAmB,CAC1B;MACD,cAAagD,qBAAQ,CAACK,OAAO,CAAEvB,OAAQ,CAAG;MAC1CU,WAAW,EAAGA,WAAa;MAC3B,2BACCA,WAAW,IAAI,CAAEf,SAAS,GAAG,IAAI,GAAGrC,SACpC;MACDkE,yBAAyB;MACzBC,oCAAoC;IAAA,CACpC,CAAC;EAAA,CACD,CAAC;AAEL;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcvC,cAAc","ignoreList":[]}
|
package/build/pattern/edit.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blocks","require","_data","_element","_blockEditor","_coreData","_i18n","_recursionDetector","_jsxRuntime","PatternEdit","attributes","clientId","registry","useRegistry","selectedPattern","useSelect","select","blockEditorStore","__experimentalGetParsedPattern","slug","currentThemeStylesheet","coreStore","getCurrentTheme","stylesheet","replaceBlocks","setBlockEditingMode","__unstableMarkNextChangeAsNotPersistent","useDispatch","getBlockRootClientId","getBlockEditingMode","hasRecursionError","setHasRecursionError","useState","parsePatternDependencies","useParsePatternDependencies","injectThemeAttributeInBlockTemplateContent","block","innerBlocks","find","innerBlock","name","map","theme","undefined","useEffect","blocks","error","window","queueMicrotask","rootClientId","clonedBlocks","cloneBlock","length","categories","metadata","patternName","title","rootEditingMode","batch","props","useBlockProps","jsx","children","Warning","sprintf","__","_default","exports","default"],"sources":["@wordpress/block-library/src/pattern/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { cloneBlock } from '@wordpress/blocks';\nimport { useSelect, useDispatch, useRegistry } from '@wordpress/data';\nimport { useState, useEffect } from '@wordpress/element';\nimport {\n\tWarning,\n\tstore as blockEditorStore,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useParsePatternDependencies } from './recursion-detector';\n\nconst PatternEdit = ( { attributes, clientId } ) => {\n\tconst registry = useRegistry();\n\tconst selectedPattern = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).__experimentalGetParsedPattern(\n\t\t\t\tattributes.slug\n\t\t\t),\n\t\t[ attributes.slug ]\n\t);\n\n\tconst currentThemeStylesheet = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme()?.stylesheet,\n\t\t[]\n\t);\n\n\tconst {\n\t\treplaceBlocks,\n\t\tsetBlockEditingMode,\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t} = useDispatch( blockEditorStore );\n\tconst { getBlockRootClientId, getBlockEditingMode } =\n\t\tuseSelect( blockEditorStore );\n\n\tconst [ hasRecursionError, setHasRecursionError ] = useState( false );\n\tconst parsePatternDependencies = useParsePatternDependencies();\n\n\t// Duplicated in packages/editor/src/components/start-template-options/index.js.\n\tfunction injectThemeAttributeInBlockTemplateContent( block ) {\n\t\tif (\n\t\t\tblock.innerBlocks.find(\n\t\t\t\t( innerBlock ) => innerBlock.name === 'core/template-part'\n\t\t\t)\n\t\t) {\n\t\t\tblock.innerBlocks = block.innerBlocks.map( ( innerBlock ) => {\n\t\t\t\tif (\n\t\t\t\t\tinnerBlock.name === 'core/template-part' &&\n\t\t\t\t\tinnerBlock.attributes.theme === undefined\n\t\t\t\t) {\n\t\t\t\t\tinnerBlock.attributes.theme = currentThemeStylesheet;\n\t\t\t\t}\n\t\t\t\treturn innerBlock;\n\t\t\t} );\n\t\t}\n\n\t\tif (\n\t\t\tblock.name === 'core/template-part' &&\n\t\t\tblock.attributes.theme === undefined\n\t\t) {\n\t\t\tblock.attributes.theme = currentThemeStylesheet;\n\t\t}\n\t\treturn block;\n\t}\n\n\t// Run this effect when the component loads.\n\t// This adds the Pattern's contents to the post.\n\t// This change won't be saved.\n\t// It will continue to pull from the pattern file unless changes are made to its respective template part.\n\tuseEffect( () => {\n\t\tif ( ! hasRecursionError && selectedPattern?.blocks ) {\n\t\t\ttry {\n\t\t\t\tparsePatternDependencies( selectedPattern );\n\t\t\t} catch ( error ) {\n\t\t\t\tsetHasRecursionError( true );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// We batch updates to block list settings to avoid triggering cascading renders\n\t\t\t// for each container block included in a tree and optimize initial render.\n\t\t\t// Since the above uses microtasks, we need to use a microtask here as well,\n\t\t\t// because nested pattern blocks cannot be inserted if the parent block supports\n\t\t\t// inner blocks but doesn't have blockSettings in the state.\n\t\t\twindow.queueMicrotask( () => {\n\t\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\t\t\t\t// Clone blocks from the pattern before insertion to ensure they receive\n\t\t\t\t// distinct client ids. See https://github.com/WordPress/gutenberg/issues/50628.\n\t\t\t\tconst clonedBlocks = selectedPattern.blocks.map( ( block ) =>\n\t\t\t\t\tcloneBlock(\n\t\t\t\t\t\tinjectThemeAttributeInBlockTemplateContent( block )\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t// If the pattern has a single block and categories, we should add the\n\t\t\t\t// categories of the pattern to the block's metadata.\n\t\t\t\tif (\n\t\t\t\t\tclonedBlocks.length === 1 &&\n\t\t\t\t\tselectedPattern.categories?.length > 0\n\t\t\t\t) {\n\t\t\t\t\tclonedBlocks[ 0 ].attributes = {\n\t\t\t\t\t\t...clonedBlocks[ 0 ].attributes,\n\t\t\t\t\t\tmetadata: {\n\t\t\t\t\t\t\t...clonedBlocks[ 0 ].attributes.metadata,\n\t\t\t\t\t\t\tcategories: selectedPattern.categories,\n\t\t\t\t\t\t\tpatternName: selectedPattern.name,\n\t\t\t\t\t\t\tname:\n\t\t\t\t\t\t\t\tclonedBlocks[ 0 ].attributes.metadata.name ||\n\t\t\t\t\t\t\t\tselectedPattern.title,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tconst rootEditingMode = getBlockEditingMode( rootClientId );\n\t\t\t\tregistry.batch( () => {\n\t\t\t\t\t// Temporarily set the root block to default mode to allow replacing the pattern.\n\t\t\t\t\t// This could happen when the page is disabling edits of non-content blocks.\n\t\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\t\tsetBlockEditingMode( rootClientId, 'default' );\n\t\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\t\treplaceBlocks( clientId, clonedBlocks );\n\t\t\t\t\t// Restore the root block's original mode.\n\t\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\t\tsetBlockEditingMode( rootClientId, rootEditingMode );\n\t\t\t\t} );\n\t\t\t} );\n\t\t}\n\t}, [\n\t\tclientId,\n\t\thasRecursionError,\n\t\tselectedPattern,\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\treplaceBlocks,\n\t\tgetBlockEditingMode,\n\t\tsetBlockEditingMode,\n\t\tgetBlockRootClientId,\n\t] );\n\n\tconst props = useBlockProps();\n\n\tif ( hasRecursionError ) {\n\t\treturn (\n\t\t\t<div { ...props }>\n\t\t\t\t<Warning>\n\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t// translators: A warning in which %s is the name of a pattern.\n\t\t\t\t\t\t__( 'Pattern \"%s\" cannot be rendered inside itself.' ),\n\t\t\t\t\t\tselectedPattern?.name\n\t\t\t\t\t) }\n\t\t\t\t</Warning>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn <div { ...props } />;\n};\n\nexport default PatternEdit;\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_blocks","require","_data","_element","_blockEditor","_coreData","_i18n","_recursionDetector","_jsxRuntime","PatternEdit","attributes","clientId","registry","useRegistry","selectedPattern","useSelect","select","blockEditorStore","__experimentalGetParsedPattern","slug","currentThemeStylesheet","coreStore","getCurrentTheme","stylesheet","replaceBlocks","setBlockEditingMode","__unstableMarkNextChangeAsNotPersistent","useDispatch","getBlockRootClientId","getBlockEditingMode","hasRecursionError","setHasRecursionError","useState","parsePatternDependencies","useParsePatternDependencies","injectThemeAttributeInBlockTemplateContent","block","innerBlocks","find","innerBlock","name","map","theme","undefined","useEffect","blocks","error","window","queueMicrotask","rootClientId","clonedBlocks","cloneBlock","length","categories","metadata","patternName","title","rootEditingMode","batch","props","useBlockProps","jsx","children","Warning","sprintf","__","_default","exports","default"],"sources":["@wordpress/block-library/src/pattern/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { cloneBlock } from '@wordpress/blocks';\nimport { useSelect, useDispatch, useRegistry } from '@wordpress/data';\nimport { useState, useEffect } from '@wordpress/element';\nimport {\n\tWarning,\n\tstore as blockEditorStore,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useParsePatternDependencies } from './recursion-detector';\n\nconst PatternEdit = ( { attributes, clientId } ) => {\n\tconst registry = useRegistry();\n\tconst selectedPattern = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).__experimentalGetParsedPattern(\n\t\t\t\tattributes.slug\n\t\t\t),\n\t\t[ attributes.slug ]\n\t);\n\n\tconst currentThemeStylesheet = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme()?.stylesheet,\n\t\t[]\n\t);\n\n\tconst {\n\t\treplaceBlocks,\n\t\tsetBlockEditingMode,\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t} = useDispatch( blockEditorStore );\n\tconst { getBlockRootClientId, getBlockEditingMode } =\n\t\tuseSelect( blockEditorStore );\n\n\tconst [ hasRecursionError, setHasRecursionError ] = useState( false );\n\tconst parsePatternDependencies = useParsePatternDependencies();\n\n\t// Duplicated in packages/editor/src/components/start-template-options/index.js.\n\tfunction injectThemeAttributeInBlockTemplateContent( block ) {\n\t\tif (\n\t\t\tblock.innerBlocks.find(\n\t\t\t\t( innerBlock ) => innerBlock.name === 'core/template-part'\n\t\t\t)\n\t\t) {\n\t\t\tblock.innerBlocks = block.innerBlocks.map( ( innerBlock ) => {\n\t\t\t\tif (\n\t\t\t\t\tinnerBlock.name === 'core/template-part' &&\n\t\t\t\t\tinnerBlock.attributes.theme === undefined\n\t\t\t\t) {\n\t\t\t\t\tinnerBlock.attributes.theme = currentThemeStylesheet;\n\t\t\t\t}\n\t\t\t\treturn innerBlock;\n\t\t\t} );\n\t\t}\n\n\t\tif (\n\t\t\tblock.name === 'core/template-part' &&\n\t\t\tblock.attributes.theme === undefined\n\t\t) {\n\t\t\tblock.attributes.theme = currentThemeStylesheet;\n\t\t}\n\t\treturn block;\n\t}\n\n\t// Run this effect when the component loads.\n\t// This adds the Pattern's contents to the post.\n\t// This change won't be saved.\n\t// It will continue to pull from the pattern file unless changes are made to its respective template part.\n\tuseEffect( () => {\n\t\tif ( ! hasRecursionError && selectedPattern?.blocks ) {\n\t\t\ttry {\n\t\t\t\tparsePatternDependencies( selectedPattern );\n\t\t\t} catch ( error ) {\n\t\t\t\tsetHasRecursionError( true );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// We batch updates to block list settings to avoid triggering cascading renders\n\t\t\t// for each container block included in a tree and optimize initial render.\n\t\t\t// Since the above uses microtasks, we need to use a microtask here as well,\n\t\t\t// because nested pattern blocks cannot be inserted if the parent block supports\n\t\t\t// inner blocks but doesn't have blockSettings in the state.\n\t\t\twindow.queueMicrotask( () => {\n\t\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\t\t\t\t// Clone blocks from the pattern before insertion to ensure they receive\n\t\t\t\t// distinct client ids. See https://github.com/WordPress/gutenberg/issues/50628.\n\t\t\t\tconst clonedBlocks = selectedPattern.blocks.map( ( block ) =>\n\t\t\t\t\tcloneBlock(\n\t\t\t\t\t\tinjectThemeAttributeInBlockTemplateContent( block )\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t// If the pattern has a single block and categories, we should add the\n\t\t\t\t// categories of the pattern to the block's metadata.\n\t\t\t\tif (\n\t\t\t\t\tclonedBlocks.length === 1 &&\n\t\t\t\t\tselectedPattern.categories?.length > 0\n\t\t\t\t) {\n\t\t\t\t\tclonedBlocks[ 0 ].attributes = {\n\t\t\t\t\t\t...clonedBlocks[ 0 ].attributes,\n\t\t\t\t\t\tmetadata: {\n\t\t\t\t\t\t\t...clonedBlocks[ 0 ].attributes.metadata,\n\t\t\t\t\t\t\tcategories: selectedPattern.categories,\n\t\t\t\t\t\t\tpatternName: selectedPattern.name,\n\t\t\t\t\t\t\tname:\n\t\t\t\t\t\t\t\tclonedBlocks[ 0 ].attributes.metadata.name ||\n\t\t\t\t\t\t\t\tselectedPattern.title,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tconst rootEditingMode = getBlockEditingMode( rootClientId );\n\t\t\t\tregistry.batch( () => {\n\t\t\t\t\t// Temporarily set the root block to default mode to allow replacing the pattern.\n\t\t\t\t\t// This could happen when the page is disabling edits of non-content blocks.\n\t\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\t\tsetBlockEditingMode( rootClientId, 'default' );\n\t\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\t\treplaceBlocks( clientId, clonedBlocks );\n\t\t\t\t\t// Restore the root block's original mode.\n\t\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\t\tsetBlockEditingMode( rootClientId, rootEditingMode );\n\t\t\t\t} );\n\t\t\t} );\n\t\t}\n\t}, [\n\t\tclientId,\n\t\thasRecursionError,\n\t\tselectedPattern,\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\treplaceBlocks,\n\t\tgetBlockEditingMode,\n\t\tsetBlockEditingMode,\n\t\tgetBlockRootClientId,\n\t] );\n\n\tconst props = useBlockProps();\n\n\tif ( hasRecursionError ) {\n\t\treturn (\n\t\t\t<div { ...props }>\n\t\t\t\t<Warning>\n\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t// translators: A warning in which %s is the name of a pattern.\n\t\t\t\t\t\t__( 'Pattern \"%s\" cannot be rendered inside itself.' ),\n\t\t\t\t\t\tselectedPattern?.name\n\t\t\t\t\t) }\n\t\t\t\t</Warning>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn <div { ...props } />;\n};\n\nexport default PatternEdit;\n"],"mappings":";;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAKA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AAKA,IAAAM,kBAAA,GAAAN,OAAA;AAAmE,IAAAO,WAAA,GAAAP,OAAA;AAjBnE;AACA;AACA;;AAYA;AACA;AACA;;AAGA,MAAMQ,WAAW,GAAGA,CAAE;EAAEC,UAAU;EAAEC;AAAS,CAAC,KAAM;EACnD,MAAMC,QAAQ,GAAG,IAAAC,iBAAW,EAAC,CAAC;EAC9B,MAAMC,eAAe,GAAG,IAAAC,eAAS,EAC9BC,MAAM,IACPA,MAAM,CAAEC,kBAAiB,CAAC,CAACC,8BAA8B,CACxDR,UAAU,CAACS,IACZ,CAAC,EACF,CAAET,UAAU,CAACS,IAAI,CAClB,CAAC;EAED,MAAMC,sBAAsB,GAAG,IAAAL,eAAS,EACrCC,MAAM,IAAMA,MAAM,CAAEK,eAAU,CAAC,CAACC,eAAe,CAAC,CAAC,EAAEC,UAAU,EAC/D,EACD,CAAC;EAED,MAAM;IACLC,aAAa;IACbC,mBAAmB;IACnBC;EACD,CAAC,GAAG,IAAAC,iBAAW,EAAEV,kBAAiB,CAAC;EACnC,MAAM;IAAEW,oBAAoB;IAAEC;EAAoB,CAAC,GAClD,IAAAd,eAAS,EAAE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xB,oBACC,IAAAtB,WAAA,CAAAqD,GAAA;MAAA,GAAUF,KAAK;MAAAG,QAAA,eACd,IAAAtD,WAAA,CAAAqD,GAAA,EAACzD,YAAA,CAAA2D,OAAO;QAAAD,QAAA,EACL,IAAAE,aAAO;QACR;QACA,IAAAC,QAAE,EAAE,gDAAiD,CAAC,EACtDnD,eAAe,EAAE0B,IAClB;MAAC,CACO;IAAC,CACN,CAAC;EAER;EAEA,oBAAO,IAAAhC,WAAA,CAAAqD,GAAA;IAAA,GAAUF;EAAK,CAAI,CAAC;AAC5B,CAAC;AAAC,IAAAO,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEa3D,WAAW","ignoreList":[]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* wp:polyfill */
|
|
1
2
|
"use strict";
|
|
2
3
|
|
|
3
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
@@ -39,18 +40,22 @@ function PostAuthorEdit({
|
|
|
39
40
|
const {
|
|
40
41
|
authorId,
|
|
41
42
|
authorDetails,
|
|
42
|
-
authors
|
|
43
|
+
authors,
|
|
44
|
+
supportsAuthor
|
|
43
45
|
} = (0, _data.useSelect)(select => {
|
|
46
|
+
var _getPostType$supports;
|
|
44
47
|
const {
|
|
45
48
|
getEditedEntityRecord,
|
|
46
49
|
getUser,
|
|
47
|
-
getUsers
|
|
50
|
+
getUsers,
|
|
51
|
+
getPostType
|
|
48
52
|
} = select(_coreData.store);
|
|
49
53
|
const _authorId = getEditedEntityRecord('postType', postType, postId)?.author;
|
|
50
54
|
return {
|
|
51
55
|
authorId: _authorId,
|
|
52
56
|
authorDetails: _authorId ? getUser(_authorId) : null,
|
|
53
|
-
authors: getUsers(AUTHORS_QUERY)
|
|
57
|
+
authors: getUsers(AUTHORS_QUERY),
|
|
58
|
+
supportsAuthor: (_getPostType$supports = getPostType(postType)?.supports?.author) !== null && _getPostType$supports !== void 0 ? _getPostType$supports : false
|
|
54
59
|
};
|
|
55
60
|
}, [postType, postId]);
|
|
56
61
|
const {
|
|
@@ -95,6 +100,14 @@ function PostAuthorEdit({
|
|
|
95
100
|
};
|
|
96
101
|
const showCombobox = authorOptions.length >= minimumUsersForCombobox;
|
|
97
102
|
const showAuthorControl = !!postId && !isDescendentOfQueryLoop && authorOptions.length > 0;
|
|
103
|
+
if (!supportsAuthor) {
|
|
104
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
105
|
+
...blockProps,
|
|
106
|
+
children: (0, _i18n.sprintf)(
|
|
107
|
+
// translators: %s: Name of the post type e.g: "post".
|
|
108
|
+
(0, _i18n.__)('This post type (%s) does not support the author.'), postType)
|
|
109
|
+
});
|
|
110
|
+
}
|
|
98
111
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
99
112
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.InspectorControls, {
|
|
100
113
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.PanelBody, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_blockEditor","_components","_data","_i18n","_coreData","_jsxRuntime","minimumUsersForCombobox","AUTHORS_QUERY","who","per_page","PostAuthorEdit","isSelected","context","postType","postId","queryId","attributes","setAttributes","isDescendentOfQueryLoop","Number","isFinite","authorId","authorDetails","authors","useSelect","select","getEditedEntityRecord","getUser","getUsers","coreStore","_authorId","author","editEntityRecord","useDispatch","textAlign","showAvatar","showBio","byline","isLink","linkTarget","avatarSizes","authorName","name","__","avatar_urls","Object","keys","forEach","size","push","value","label","blockProps","useBlockProps","className","clsx","authorOptions","length","map","id","handleSelect","nextAuthorId","showCombobox","showAuthorControl","jsxs","Fragment","children","jsx","InspectorControls","PanelBody","title","__experimentalVStack","spacing","ComboboxControl","__next40pxDefaultSize","__nextHasNoMarginBottom","options","onChange","allowReset","SelectControl","ToggleControl","checked","avatarSize","BlockControls","group","AlignmentControl","nextAlign","width","src","alt","RichText","isEmpty","identifier","placeholder","href","onClick","event","preventDefault","dangerouslySetInnerHTML","__html","description","_default","exports","default"],"sources":["@wordpress/block-library/src/post-author/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tInspectorControls,\n\tRichText,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport {\n\tComboboxControl,\n\tPanelBody,\n\tSelectControl,\n\tToggleControl,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\n\nconst minimumUsersForCombobox = 25;\n\nconst AUTHORS_QUERY = {\n\twho: 'authors',\n\tper_page: 100,\n};\n\nfunction PostAuthorEdit( {\n\tisSelected,\n\tcontext: { postType, postId, queryId },\n\tattributes,\n\tsetAttributes,\n} ) {\n\tconst isDescendentOfQueryLoop = Number.isFinite( queryId );\n\tconst { authorId, authorDetails, authors } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedEntityRecord, getUser, getUsers } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst _authorId = getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId\n\t\t\t)?.author;\n\n\t\t\treturn {\n\t\t\t\tauthorId: _authorId,\n\t\t\t\tauthorDetails: _authorId ? getUser( _authorId ) : null,\n\t\t\t\tauthors: getUsers( AUTHORS_QUERY ),\n\t\t\t};\n\t\t},\n\t\t[ postType, postId ]\n\t);\n\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\n\tconst { textAlign, showAvatar, showBio, byline, isLink, linkTarget } =\n\t\tattributes;\n\tconst avatarSizes = [];\n\tconst authorName = authorDetails?.name || __( 'Post Author' );\n\tif ( authorDetails?.avatar_urls ) {\n\t\tObject.keys( authorDetails.avatar_urls ).forEach( ( size ) => {\n\t\t\tavatarSizes.push( {\n\t\t\t\tvalue: size,\n\t\t\t\tlabel: `${ size } x ${ size }`,\n\t\t\t} );\n\t\t} );\n\t}\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t} );\n\n\tconst authorOptions = authors?.length\n\t\t? authors.map( ( { id, name } ) => {\n\t\t\t\treturn {\n\t\t\t\t\tvalue: id,\n\t\t\t\t\tlabel: name,\n\t\t\t\t};\n\t\t } )\n\t\t: [];\n\n\tconst handleSelect = ( nextAuthorId ) => {\n\t\teditEntityRecord( 'postType', postType, postId, {\n\t\t\tauthor: nextAuthorId,\n\t\t} );\n\t};\n\n\tconst showCombobox = authorOptions.length >= minimumUsersForCombobox;\n\tconst showAuthorControl =\n\t\t!! postId && ! isDescendentOfQueryLoop && authorOptions.length > 0;\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t<VStack\n\t\t\t\t\t\tspacing={ 4 }\n\t\t\t\t\t\tclassName=\"wp-block-post-author__inspector-settings\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ showAuthorControl &&\n\t\t\t\t\t\t\t( ( showCombobox && (\n\t\t\t\t\t\t\t\t<ComboboxControl\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Author' ) }\n\t\t\t\t\t\t\t\t\toptions={ authorOptions }\n\t\t\t\t\t\t\t\t\tvalue={ authorId }\n\t\t\t\t\t\t\t\t\tonChange={ handleSelect }\n\t\t\t\t\t\t\t\t\tallowReset={ false }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) ) || (\n\t\t\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Author' ) }\n\t\t\t\t\t\t\t\t\tvalue={ authorId }\n\t\t\t\t\t\t\t\t\toptions={ authorOptions }\n\t\t\t\t\t\t\t\t\tonChange={ handleSelect }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Show avatar' ) }\n\t\t\t\t\t\t\tchecked={ showAvatar }\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { showAvatar: ! showAvatar } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ showAvatar && (\n\t\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Avatar size' ) }\n\t\t\t\t\t\t\t\tvalue={ attributes.avatarSize }\n\t\t\t\t\t\t\t\toptions={ avatarSizes }\n\t\t\t\t\t\t\t\tonChange={ ( size ) => {\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tavatarSize: Number( size ),\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\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Show bio' ) }\n\t\t\t\t\t\t\tchecked={ showBio }\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { showBio: ! showBio } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Link author name to author page' ) }\n\t\t\t\t\t\t\tchecked={ isLink }\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { isLink: ! isLink } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ isLink && (\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Open in new tab' ) }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tlinkTarget: value ? '_blank' : '_self',\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\tchecked={ linkTarget === '_blank' }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</VStack>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t<AlignmentControl\n\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\tonChange={ ( nextAlign ) => {\n\t\t\t\t\t\tsetAttributes( { textAlign: nextAlign } );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\n\t\t\t<div { ...blockProps }>\n\t\t\t\t{ showAvatar && authorDetails?.avatar_urls && (\n\t\t\t\t\t<div className=\"wp-block-post-author__avatar\">\n\t\t\t\t\t\t<img\n\t\t\t\t\t\t\twidth={ attributes.avatarSize }\n\t\t\t\t\t\t\tsrc={\n\t\t\t\t\t\t\t\tauthorDetails.avatar_urls[\n\t\t\t\t\t\t\t\t\tattributes.avatarSize\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\talt={ authorDetails.name }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t\t<div className=\"wp-block-post-author__content\">\n\t\t\t\t\t{ ( ! RichText.isEmpty( byline ) || isSelected ) && (\n\t\t\t\t\t\t<RichText\n\t\t\t\t\t\t\tidentifier=\"byline\"\n\t\t\t\t\t\t\tclassName=\"wp-block-post-author__byline\"\n\t\t\t\t\t\t\taria-label={ __( 'Post author byline text' ) }\n\t\t\t\t\t\t\tplaceholder={ __( 'Write byline…' ) }\n\t\t\t\t\t\t\tvalue={ byline }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { byline: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t<p className=\"wp-block-post-author__name\">\n\t\t\t\t\t\t{ isLink ? (\n\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\thref=\"#post-author-pseudo-link\"\n\t\t\t\t\t\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ authorName }\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\tauthorName\n\t\t\t\t\t\t) }\n\t\t\t\t\t</p>\n\t\t\t\t\t{ showBio && (\n\t\t\t\t\t\t<p\n\t\t\t\t\t\t\tclassName=\"wp-block-post-author__bio\"\n\t\t\t\t\t\t\tdangerouslySetInnerHTML={ {\n\t\t\t\t\t\t\t\t__html: authorDetails?.description,\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</div>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default PostAuthorEdit;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,YAAA,GAAAD,OAAA;AAOA,IAAAE,WAAA,GAAAF,OAAA;AAOA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,O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FL,OAAO,iBACR,IAAA/B,WAAA,CAAA8D,GAAA;UACCb,SAAS,EAAC,2BAA2B;UACrC4C,uBAAuB,EAAG;YACzBC,MAAM,EAAE7E,aAAa,EAAE8E;UACxB;QAAG,CACH,CACD;MAAA,CACG,CAAC;IAAA,CACF,CAAC;EAAA,CACL,CAAC;AAEL;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc7F,cAAc","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_blockEditor","_components","_data","_i18n","_coreData","_jsxRuntime","minimumUsersForCombobox","AUTHORS_QUERY","who","per_page","PostAuthorEdit","isSelected","context","postType","postId","queryId","attributes","setAttributes","isDescendentOfQueryLoop","Number","isFinite","authorId","authorDetails","authors","supportsAuthor","useSelect","select","_getPostType$supports","getEditedEntityRecord","getUser","getUsers","getPostType","coreStore","_authorId","author","supports","editEntityRecord","useDispatch","textAlign","showAvatar","showBio","byline","isLink","linkTarget","avatarSizes","authorName","name","__","avatar_urls","Object","keys","forEach","size","push","value","label","blockProps","useBlockProps","className","clsx","authorOptions","length","map","id","handleSelect","nextAuthorId","showCombobox","showAuthorControl","jsx","children","sprintf","jsxs","Fragment","InspectorControls","PanelBody","title","__experimentalVStack","spacing","ComboboxControl","__next40pxDefaultSize","__nextHasNoMarginBottom","options","onChange","allowReset","SelectControl","ToggleControl","checked","avatarSize","BlockControls","group","AlignmentControl","nextAlign","width","src","alt","RichText","isEmpty","identifier","placeholder","href","onClick","event","preventDefault","dangerouslySetInnerHTML","__html","description","_default","exports","default"],"sources":["@wordpress/block-library/src/post-author/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tInspectorControls,\n\tRichText,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport {\n\tComboboxControl,\n\tPanelBody,\n\tSelectControl,\n\tToggleControl,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\n\nconst minimumUsersForCombobox = 25;\n\nconst AUTHORS_QUERY = {\n\twho: 'authors',\n\tper_page: 100,\n};\n\nfunction PostAuthorEdit( {\n\tisSelected,\n\tcontext: { postType, postId, queryId },\n\tattributes,\n\tsetAttributes,\n} ) {\n\tconst isDescendentOfQueryLoop = Number.isFinite( queryId );\n\tconst { authorId, authorDetails, authors, supportsAuthor } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedEntityRecord, getUser, getUsers, getPostType } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst _authorId = getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId\n\t\t\t)?.author;\n\n\t\t\treturn {\n\t\t\t\tauthorId: _authorId,\n\t\t\t\tauthorDetails: _authorId ? getUser( _authorId ) : null,\n\t\t\t\tauthors: getUsers( AUTHORS_QUERY ),\n\t\t\t\tsupportsAuthor:\n\t\t\t\t\tgetPostType( postType )?.supports?.author ?? false,\n\t\t\t};\n\t\t},\n\t\t[ postType, postId ]\n\t);\n\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\n\tconst { textAlign, showAvatar, showBio, byline, isLink, linkTarget } =\n\t\tattributes;\n\tconst avatarSizes = [];\n\tconst authorName = authorDetails?.name || __( 'Post Author' );\n\tif ( authorDetails?.avatar_urls ) {\n\t\tObject.keys( authorDetails.avatar_urls ).forEach( ( size ) => {\n\t\t\tavatarSizes.push( {\n\t\t\t\tvalue: size,\n\t\t\t\tlabel: `${ size } x ${ size }`,\n\t\t\t} );\n\t\t} );\n\t}\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t} );\n\n\tconst authorOptions = authors?.length\n\t\t? authors.map( ( { id, name } ) => {\n\t\t\t\treturn {\n\t\t\t\t\tvalue: id,\n\t\t\t\t\tlabel: name,\n\t\t\t\t};\n\t\t } )\n\t\t: [];\n\n\tconst handleSelect = ( nextAuthorId ) => {\n\t\teditEntityRecord( 'postType', postType, postId, {\n\t\t\tauthor: nextAuthorId,\n\t\t} );\n\t};\n\n\tconst showCombobox = authorOptions.length >= minimumUsersForCombobox;\n\tconst showAuthorControl =\n\t\t!! postId && ! isDescendentOfQueryLoop && authorOptions.length > 0;\n\n\tif ( ! supportsAuthor ) {\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t{ sprintf(\n\t\t\t\t\t// translators: %s: Name of the post type e.g: \"post\".\n\t\t\t\t\t__( 'This post type (%s) does not support the author.' ),\n\t\t\t\t\tpostType\n\t\t\t\t) }\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t<VStack\n\t\t\t\t\t\tspacing={ 4 }\n\t\t\t\t\t\tclassName=\"wp-block-post-author__inspector-settings\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ showAuthorControl &&\n\t\t\t\t\t\t\t( ( showCombobox && (\n\t\t\t\t\t\t\t\t<ComboboxControl\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Author' ) }\n\t\t\t\t\t\t\t\t\toptions={ authorOptions }\n\t\t\t\t\t\t\t\t\tvalue={ authorId }\n\t\t\t\t\t\t\t\t\tonChange={ handleSelect }\n\t\t\t\t\t\t\t\t\tallowReset={ false }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) ) || (\n\t\t\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Author' ) }\n\t\t\t\t\t\t\t\t\tvalue={ authorId }\n\t\t\t\t\t\t\t\t\toptions={ authorOptions }\n\t\t\t\t\t\t\t\t\tonChange={ handleSelect }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Show avatar' ) }\n\t\t\t\t\t\t\tchecked={ showAvatar }\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { showAvatar: ! showAvatar } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ showAvatar && (\n\t\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Avatar size' ) }\n\t\t\t\t\t\t\t\tvalue={ attributes.avatarSize }\n\t\t\t\t\t\t\t\toptions={ avatarSizes }\n\t\t\t\t\t\t\t\tonChange={ ( size ) => {\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tavatarSize: Number( size ),\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\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Show bio' ) }\n\t\t\t\t\t\t\tchecked={ showBio }\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { showBio: ! showBio } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Link author name to author page' ) }\n\t\t\t\t\t\t\tchecked={ isLink }\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { isLink: ! isLink } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ isLink && (\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Open in new tab' ) }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tlinkTarget: value ? '_blank' : '_self',\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\tchecked={ linkTarget === '_blank' }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</VStack>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t<AlignmentControl\n\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\tonChange={ ( nextAlign ) => {\n\t\t\t\t\t\tsetAttributes( { textAlign: nextAlign } );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\n\t\t\t<div { ...blockProps }>\n\t\t\t\t{ showAvatar && authorDetails?.avatar_urls && (\n\t\t\t\t\t<div className=\"wp-block-post-author__avatar\">\n\t\t\t\t\t\t<img\n\t\t\t\t\t\t\twidth={ attributes.avatarSize }\n\t\t\t\t\t\t\tsrc={\n\t\t\t\t\t\t\t\tauthorDetails.avatar_urls[\n\t\t\t\t\t\t\t\t\tattributes.avatarSize\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\talt={ authorDetails.name }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t\t<div className=\"wp-block-post-author__content\">\n\t\t\t\t\t{ ( ! RichText.isEmpty( byline ) || isSelected ) && (\n\t\t\t\t\t\t<RichText\n\t\t\t\t\t\t\tidentifier=\"byline\"\n\t\t\t\t\t\t\tclassName=\"wp-block-post-author__byline\"\n\t\t\t\t\t\t\taria-label={ __( 'Post author byline text' ) }\n\t\t\t\t\t\t\tplaceholder={ __( 'Write byline…' ) }\n\t\t\t\t\t\t\tvalue={ byline }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { byline: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t<p className=\"wp-block-post-author__name\">\n\t\t\t\t\t\t{ isLink ? (\n\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\thref=\"#post-author-pseudo-link\"\n\t\t\t\t\t\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ authorName }\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\tauthorName\n\t\t\t\t\t\t) }\n\t\t\t\t\t</p>\n\t\t\t\t\t{ showBio && (\n\t\t\t\t\t\t<p\n\t\t\t\t\t\t\tclassName=\"wp-block-post-author__bio\"\n\t\t\t\t\t\t\tdangerouslySetInnerHTML={ {\n\t\t\t\t\t\t\t\t__html: authorDetails?.description,\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</div>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default PostAuthorEdit;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,YAAA,GAAAD,OAAA;AAOA,IAAAE,WAAA,GAAAF,OAAA;AAOA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AAA0D,IAAAM,WAAA,GAAAN,OAAA;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BrC,aAAa,CAAE;YAAEwB,MAAM,EAAEa;UAAM,CAAE;QACjC,CACD,CACD,eACD,IAAAjD,WAAA,CAAA+D,GAAA;UAAGV,SAAS,EAAC,4BAA4B;UAAAW,QAAA,EACtC3B,MAAM,gBACP,IAAArC,WAAA,CAAA+D,GAAA;YACC+B,IAAI,EAAC,0BAA0B;YAC/BC,OAAO,EAAKC,KAAK,IAAMA,KAAK,CAACC,cAAc,CAAC,CAAG;YAAAjC,QAAA,EAE7CxB;UAAU,CACV,CAAC,GAEJA;QACA,CACC,CAAC,EACFL,OAAO,iBACR,IAAAnC,WAAA,CAAA+D,GAAA;UACCV,SAAS,EAAC,2BAA2B;UACrC6C,uBAAuB,EAAG;YACzBC,MAAM,EAAElF,aAAa,EAAEmF;UACxB;QAAG,CACH,CACD;MAAA,CACG,CAAC;IAAA,CACF,CAAC;EAAA,CACL,CAAC;AAEL;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEclG,cAAc","ignoreList":[]}
|
|
@@ -43,11 +43,13 @@ const metadata = exports.metadata = {
|
|
|
43
43
|
},
|
|
44
44
|
isLink: {
|
|
45
45
|
type: "boolean",
|
|
46
|
-
"default": false
|
|
46
|
+
"default": false,
|
|
47
|
+
role: "content"
|
|
47
48
|
},
|
|
48
49
|
linkTarget: {
|
|
49
50
|
type: "string",
|
|
50
|
-
"default": "_self"
|
|
51
|
+
"default": "_self",
|
|
52
|
+
role: "content"
|
|
51
53
|
}
|
|
52
54
|
},
|
|
53
55
|
usesContext: ["postType", "postId", "queryId"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_icons","_initBlock","_interopRequireDefault","_edit","metadata","exports","$schema","apiVersion","name","title","category","description","textdomain","attributes","textAlign","type","avatarSize","showAvatar","showBio","byline","isLink","linkTarget","usesContext","supports","html","spacing","margin","padding","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","__experimentalDefaultControls","color","gradients","link","__experimentalDuotone","background","text","interactivity","clientNavigation","__experimentalBorder","radius","width","style","editorStyle","settings","icon","example","viewportWidth","__","edit","init","initBlock"],"sources":["@wordpress/block-library/src/post-author/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { postAuthor 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';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tviewportWidth: 350,\n\t\tattributes: {\n\t\t\tshowBio: true,\n\t\t\tbyline: __( 'Posted by' ),\n\t\t},\n\t},\n\tedit,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAKA,IAAAE,UAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,IAAAI,KAAA,GAAAD,sBAAA,CAAAH,OAAA;AAXA;AACA;AACA;AAIA;AACA;AACA;AAFA,MAAAK,QAAA,GAAAC,OAAA,CAAAD,QAAA;EAAAE,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,WAAA;EAAAC,UAAA;EAAAC,UAAA;IAAAC,SAAA;MAAAC,IAAA;IAAA;IAAAC,UAAA;MAAAD,IAAA;MAAA;IAAA;IAAAE,UAAA;MAAAF,IAAA;MAAA;IAAA;IAAAG,OAAA;MAAAH,IAAA;IAAA;IAAAI,MAAA;MAAAJ,IAAA;IAAA;IAAAK,MAAA;MAAAL,IAAA;MAAA;IAAA;
|
|
1
|
+
{"version":3,"names":["_i18n","require","_icons","_initBlock","_interopRequireDefault","_edit","metadata","exports","$schema","apiVersion","name","title","category","description","textdomain","attributes","textAlign","type","avatarSize","showAvatar","showBio","byline","isLink","role","linkTarget","usesContext","supports","html","spacing","margin","padding","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","__experimentalDefaultControls","color","gradients","link","__experimentalDuotone","background","text","interactivity","clientNavigation","__experimentalBorder","radius","width","style","editorStyle","settings","icon","example","viewportWidth","__","edit","init","initBlock"],"sources":["@wordpress/block-library/src/post-author/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { postAuthor 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';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tviewportWidth: 350,\n\t\tattributes: {\n\t\t\tshowBio: true,\n\t\t\tbyline: __( 'Posted by' ),\n\t\t},\n\t},\n\tedit,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAKA,IAAAE,UAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,IAAAI,KAAA,GAAAD,sBAAA,CAAAH,OAAA;AAXA;AACA;AACA;AAIA;AACA;AACA;AAFA,MAAAK,QAAA,GAAAC,OAAA,CAAAD,QAAA;EAAAE,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,WAAA;EAAAC,UAAA;EAAAC,UAAA;IAAAC,SAAA;MAAAC,IAAA;IAAA;IAAAC,UAAA;MAAAD,IAAA;MAAA;IAAA;IAAAE,UAAA;MAAAF,IAAA;MAAA;IAAA;IAAAG,OAAA;MAAAH,IAAA;IAAA;IAAAI,MAAA;MAAAJ,IAAA;IAAA;IAAAK,MAAA;MAAAL,IAAA;MAAA;MAAAM,IAAA;IAAA;IA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{
|
|
35
35
|
const {
|
|
36
|
-
authorName
|
|
36
|
+
authorName,
|
|
37
|
+
supportsAuthor
|
|
37
38
|
} = (0, _data.useSelect)(select => {
|
|
39
|
+
var _getPostType$supports;
|
|
38
40
|
const {
|
|
39
41
|
getEditedEntityRecord,
|
|
40
|
-
getUser
|
|
42
|
+
getUser,
|
|
43
|
+
getPostType
|
|
41
44
|
} = select(_coreData.store);
|
|
42
45
|
const _authorId = getEditedEntityRecord('postType', postType, postId)?.author;
|
|
43
46
|
return {
|
|
44
|
-
authorName: _authorId ? getUser(_authorId) : null
|
|
47
|
+
authorName: _authorId ? getUser(_authorId) : null,
|
|
48
|
+
supportsAuthor: (_getPostType$supports = getPostType(postType)?.supports?.author) !== null && _getPostType$supports !== void 0 ? _getPostType$supports : false
|
|
45
49
|
};
|
|
46
50
|
}, [postType, postId]);
|
|
47
51
|
const blockProps = (0, _blockEditor.useBlockProps)({
|
|
@@ -86,9 +90,11 @@ function PostAuthorNameEdit({
|
|
|
86
90
|
checked: linkTarget === '_blank'
|
|
87
91
|
})]
|
|
88
92
|
})
|
|
89
|
-
}), /*#__PURE__*/(0, _jsxRuntime.
|
|
93
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
90
94
|
...blockProps,
|
|
91
|
-
children:
|
|
95
|
+
children: supportsAuthor ? displayAuthor : (0, _i18n.sprintf)(
|
|
96
|
+
// translators: %s: Name of the post type e.g: "post".
|
|
97
|
+
(0, _i18n.__)('This post type (%s) does not support the author.'), postType)
|
|
92
98
|
})]
|
|
93
99
|
});
|
|
94
100
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_blockEditor","_data","_i18n","_coreData","_components","_jsxRuntime","PostAuthorNameEdit","context","postType","postId","attributes","textAlign","isLink","linkTarget","setAttributes","authorName","useSelect","select","getEditedEntityRecord","getUser","coreStore","_authorId","author","blockProps","useBlockProps","className","clsx","displayName","name","__","displayAuthor","jsx","href","onClick","event","preventDefault","children","jsxs","Fragment","BlockControls","group","AlignmentControl","value","onChange","nextAlign","InspectorControls","PanelBody","title","ToggleControl","__nextHasNoMarginBottom","label","checked","_default","exports","default"],"sources":["@wordpress/block-library/src/post-author-name/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tInspectorControls,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { PanelBody, ToggleControl } from '@wordpress/components';\n\nfunction PostAuthorNameEdit( {\n\tcontext: { postType, postId },\n\tattributes: { textAlign, isLink, linkTarget },\n\tsetAttributes,\n} ) {\n\tconst { authorName } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedEntityRecord, getUser }
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_blockEditor","_data","_i18n","_coreData","_components","_jsxRuntime","PostAuthorNameEdit","context","postType","postId","attributes","textAlign","isLink","linkTarget","setAttributes","authorName","supportsAuthor","useSelect","select","_getPostType$supports","getEditedEntityRecord","getUser","getPostType","coreStore","_authorId","author","supports","blockProps","useBlockProps","className","clsx","displayName","name","__","displayAuthor","jsx","href","onClick","event","preventDefault","children","jsxs","Fragment","BlockControls","group","AlignmentControl","value","onChange","nextAlign","InspectorControls","PanelBody","title","ToggleControl","__nextHasNoMarginBottom","label","checked","sprintf","_default","exports","default"],"sources":["@wordpress/block-library/src/post-author-name/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tInspectorControls,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { PanelBody, ToggleControl } from '@wordpress/components';\n\nfunction PostAuthorNameEdit( {\n\tcontext: { postType, postId },\n\tattributes: { textAlign, isLink, linkTarget },\n\tsetAttributes,\n} ) {\n\tconst { authorName, supportsAuthor } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedEntityRecord, getUser, getPostType } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst _authorId = getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId\n\t\t\t)?.author;\n\n\t\t\treturn {\n\t\t\t\tauthorName: _authorId ? getUser( _authorId ) : null,\n\t\t\t\tsupportsAuthor:\n\t\t\t\t\tgetPostType( postType )?.supports?.author ?? false,\n\t\t\t};\n\t\t},\n\t\t[ postType, postId ]\n\t);\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t} );\n\n\tconst displayName = authorName?.name || __( 'Author Name' );\n\n\tconst displayAuthor = isLink ? (\n\t\t<a\n\t\t\thref=\"#author-pseudo-link\"\n\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\tclassName=\"wp-block-post-author-name__link\"\n\t\t>\n\t\t\t{ displayName }\n\t\t</a>\n\t) : (\n\t\tdisplayName\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={ textAlign }\n\t\t\t\t\tonChange={ ( nextAlign ) => {\n\t\t\t\t\t\tsetAttributes( { textAlign: nextAlign } );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Link to author archive' ) }\n\t\t\t\t\t\tonChange={ () => setAttributes( { isLink: ! isLink } ) }\n\t\t\t\t\t\tchecked={ isLink }\n\t\t\t\t\t/>\n\t\t\t\t\t{ isLink && (\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Open in new tab' ) }\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\tlinkTarget: value ? '_blank' : '_self',\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tchecked={ linkTarget === '_blank' }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t<div { ...blockProps }>\n\t\t\t\t{ supportsAuthor\n\t\t\t\t\t? displayAuthor\n\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t// translators: %s: Name of the post type e.g: \"post\".\n\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t'This post type (%s) does not support the author.'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tpostType\n\t\t\t\t\t ) }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default PostAuthorNameEdit;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,YAAA,GAAAD,OAAA;AAMA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AAAiE,IAAAM,WAAA,GAAAN,OAAA;AAjBjE;AACA;AACA;;AAGA;AACA;AACA;;AAYA,SAASO,kBAAkBA,CAAE;EAC5BC,OAAO,EAAE;IAAEC,QAAQ;IAAEC;EAAO,CAAC;EAC7BC,UAAU,EAAE;IAAEC,SAAS;IAAEC,MAAM;IAAEC;EAAW,CAAC;EAC7CC;AACD,CAAC,EAAG;EAC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AiD,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcrD,kBAAkB","ignoreList":[]}
|
|
@@ -29,11 +29,13 @@ const metadata = exports.metadata = {
|
|
|
29
29
|
},
|
|
30
30
|
isLink: {
|
|
31
31
|
type: "boolean",
|
|
32
|
-
"default": false
|
|
32
|
+
"default": false,
|
|
33
|
+
role: "content"
|
|
33
34
|
},
|
|
34
35
|
linkTarget: {
|
|
35
36
|
type: "string",
|
|
36
|
-
"default": "_self"
|
|
37
|
+
"default": "_self",
|
|
38
|
+
role: "content"
|
|
37
39
|
}
|
|
38
40
|
},
|
|
39
41
|
usesContext: ["postType", "postId"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_icons","require","_initBlock","_interopRequireDefault","_edit","_transforms","metadata","exports","$schema","apiVersion","name","title","category","description","textdomain","attributes","textAlign","type","isLink","linkTarget","usesContext","example","viewportWidth","supports","html","spacing","margin","padding","color","gradients","link","__experimentalDefaultControls","background","text","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","interactivity","clientNavigation","__experimentalBorder","radius","width","style","settings","icon","transforms","edit","init","initBlock"],"sources":["@wordpress/block-library/src/post-author-name/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { postAuthor 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 transforms from './transforms';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\ttransforms,\n\tedit,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,KAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,WAAA,GAAAF,sBAAA,CAAAF,OAAA;AAXA;AACA;AACA;AAGA;AACA;AACA;AAFA,MAAAK,QAAA,GAAAC,OAAA,CAAAD,QAAA;EAAAE,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,WAAA;EAAAC,UAAA;EAAAC,UAAA;IAAAC,SAAA;MAAAC,IAAA;IAAA;IAAAC,MAAA;MAAAD,IAAA;MAAA;IAAA;
|
|
1
|
+
{"version":3,"names":["_icons","require","_initBlock","_interopRequireDefault","_edit","_transforms","metadata","exports","$schema","apiVersion","name","title","category","description","textdomain","attributes","textAlign","type","isLink","role","linkTarget","usesContext","example","viewportWidth","supports","html","spacing","margin","padding","color","gradients","link","__experimentalDefaultControls","background","text","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","interactivity","clientNavigation","__experimentalBorder","radius","width","style","settings","icon","transforms","edit","init","initBlock"],"sources":["@wordpress/block-library/src/post-author-name/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { postAuthor 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 transforms from './transforms';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\ttransforms,\n\tedit,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,KAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,WAAA,GAAAF,sBAAA,CAAAF,OAAA;AAXA;AACA;AACA;AAGA;AACA;AACA;AAFA,MAAAK,QAAA,GAAAC,OAAA,CAAAD,QAAA;EAAAE,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EA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{
|
|
|
68
68
|
}
|
|
69
69
|
},
|
|
70
70
|
editorStyle: "wp-block-post-comments-form-editor",
|
|
71
|
-
style: ["wp-block-post-comments-form", "wp-block-buttons", "wp-block-button"]
|
|
71
|
+
style: ["wp-block-post-comments-form", "wp-block-buttons", "wp-block-button"],
|
|
72
|
+
example: {
|
|
73
|
+
attributes: {
|
|
74
|
+
textAlign: "center"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
72
77
|
};
|
|
73
78
|
const {
|
|
74
79
|
name
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_icons","require","_initBlock","_interopRequireDefault","_edit","metadata","exports","$schema","apiVersion","name","title","category","description","textdomain","attributes","textAlign","type","usesContext","supports","html","color","gradients","heading","link","__experimentalDefaultControls","background","text","spacing","margin","padding","typography","fontSize","lineHeight","__experimentalFontStyle","__experimentalFontWeight","__experimentalLetterSpacing","__experimentalTextTransform","__experimentalBorder","radius","width","style","editorStyle","settings","icon","edit","init","initBlock"],"sources":["@wordpress/block-library/src/post-comments-form/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { postCommentsForm 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';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,KAAA,GAAAD,sBAAA,CAAAF,OAAA;AAVA;AACA;AACA;AAGA;AACA;AACA;AAFA,MAAAI,QAAA,GAAAC,OAAA,CAAAD,QAAA;EAAAE,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,WAAA;EAAAC,UAAA;EAAAC,UAAA;IAAAC,SAAA;MAAAC,IAAA;IAAA;EAAA;EAAAC,WAAA;EAAAC,QAAA;IAAAC,IAAA;IAAAC,KAAA;MAAAC,SAAA;MAAAC,OAAA;MAAAC,IAAA;MAAAC,6BAAA;QAAAC,UAAA;QAAAC,IAAA;MAAA;IAAA;IAAAC,OAAA;MAAAC,MAAA;MAAAC,OAAA;IAAA;IAAAC,UAAA;MAAAC,QAAA;MAAAC,UAAA;MAAAC,uBAAA;MAAAC,wBAAA;MAAAC,2BAAA;MAAAC,2BAAA;MAAAZ,6BAAA;QAAAO,QAAA;MAAA;IAAA;IAAAM,oBAAA;MAAAC,MAAA;MAAAlB,KAAA;MAAAmB,KAAA;MAAAC,KAAA;MAAAhB,6BAAA;QAAAc,MAAA;QAAAlB,KAAA;QAAAmB,KAAA;QAAAC,KAAA;MAAA;IAAA;EAAA;EAAAC,WAAA;EAAAD,KAAA;AAAA;AAOA,MAAM;
|
|
1
|
+
{"version":3,"names":["_icons","require","_initBlock","_interopRequireDefault","_edit","metadata","exports","$schema","apiVersion","name","title","category","description","textdomain","attributes","textAlign","type","usesContext","supports","html","color","gradients","heading","link","__experimentalDefaultControls","background","text","spacing","margin","padding","typography","fontSize","lineHeight","__experimentalFontStyle","__experimentalFontWeight","__experimentalLetterSpacing","__experimentalTextTransform","__experimentalBorder","radius","width","style","editorStyle","example","settings","icon","edit","init","initBlock"],"sources":["@wordpress/block-library/src/post-comments-form/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { postCommentsForm 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';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,KAAA,GAAAD,sB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58
|
},
|
|
59
59
|
interactivity: {
|
|
60
60
|
clientNavigation: true
|
|
61
|
+
},
|
|
62
|
+
__experimentalBorder: {
|
|
63
|
+
radius: true,
|
|
64
|
+
color: true,
|
|
65
|
+
width: true,
|
|
66
|
+
style: true
|
|
61
67
|
}
|
|
62
|
-
}
|
|
68
|
+
},
|
|
69
|
+
style: "wp-block-post-comments-link"
|
|
63
70
|
};
|
|
64
71
|
const {
|
|
65
72
|
name
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_icons","require","_initBlock","_interopRequireDefault","_edit","metadata","exports","$schema","apiVersion","__experimental","name","title","category","description","textdomain","usesContext","attributes","textAlign","type","supports","html","color","link","text","__experimentalDefaultControls","background","spacing","margin","padding","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","interactivity","clientNavigation","settings","edit","icon","init","initBlock"],"sources":["@wordpress/block-library/src/post-comments-link/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { postCommentsCount 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';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\tedit,\n\ticon,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,KAAA,GAAAD,sBAAA,CAAAF,OAAA;AAVA;AACA;AACA;AAGA;AACA;AACA;AAFA,MAAAI,QAAA,GAAAC,OAAA,CAAAD,QAAA;EAAAE,OAAA;EAAAC,UAAA;EAAAC,cAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,WAAA;EAAAC,UAAA;EAAAC,WAAA;EAAAC,UAAA;IAAAC,SAAA;MAAAC,IAAA;IAAA;EAAA;EAAAC,QAAA;IAAAC,IAAA;IAAAC,KAAA;MAAAC,IAAA;MAAAC,IAAA;MAAAC,6BAAA;QAAAC,UAAA;QAAAH,IAAA;MAAA;IAAA;IAAAI,OAAA;MAAAC,MAAA;MAAAC,OAAA;IAAA;IAAAC,UAAA;MAAAC,QAAA;MAAAC,UAAA;MAAAC,wBAAA;MAAAC,wBAAA;MAAAC,uBAAA;MAAAC,2BAAA;MAAAC,4BAAA;MAAAC,2BAAA;MAAAb,6BAAA;QAAAM,QAAA;MAAA;IAAA;IAAAQ,aAAA;MAAAC,gBAAA;IAAA;EAAA;AAAA;AAOA,MAAM;
|
|
1
|
+
{"version":3,"names":["_icons","require","_initBlock","_interopRequireDefault","_edit","metadata","exports","$schema","apiVersion","__experimental","name","title","category","description","textdomain","usesContext","attributes","textAlign","type","supports","html","color","link","text","__experimentalDefaultControls","background","spacing","margin","padding","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","interactivity","clientNavigation","__experimentalBorder","radius","width","style","settings","edit","icon","init","initBlock"],"sources":["@wordpress/block-library/src/post-comments-link/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { postCommentsCount 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';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\tedit,\n\ticon,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,KAAA,GAAAD,sBAAA,CAAAF,OAAA;AAVA;AACA;AACA;AAGA;AACA;AACA;AAFA,MAAAI,QAAA,GAAAC,OAAA,CAAAD,QAAA;EAAAE,OAAA;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