@wordpress/block-library 7.8.0 → 7.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/build/audio/edit.js +1 -0
- package/build/audio/edit.js.map +1 -1
- package/build/audio/save.js +2 -1
- package/build/audio/save.js.map +1 -1
- package/build/avatar/hooks.js +2 -2
- package/build/avatar/hooks.js.map +1 -1
- package/build/button/edit.js +3 -2
- package/build/button/edit.js.map +1 -1
- package/build/button/index.js +1 -24
- package/build/button/index.js.map +1 -1
- package/build/button/save.js +1 -1
- package/build/button/save.js.map +1 -1
- package/build/buttons/edit.js +1 -1
- package/build/buttons/edit.js.map +1 -1
- package/build/columns/edit.native.js +1 -1
- package/build/columns/edit.native.js.map +1 -1
- package/build/columns/variations.js +2 -2
- package/build/columns/variations.js.map +1 -1
- package/build/comment-author-name/edit.js +3 -5
- package/build/comment-author-name/edit.js.map +1 -1
- package/build/comment-author-name/index.js +0 -4
- package/build/comment-author-name/index.js.map +1 -1
- package/build/comment-date/edit.js +4 -4
- package/build/comment-date/edit.js.map +1 -1
- package/build/comment-date/index.js +0 -4
- package/build/comment-date/index.js.map +1 -1
- package/build/comment-edit-link/index.js +0 -4
- package/build/comment-edit-link/index.js.map +1 -1
- package/build/comment-reply-link/index.js +0 -4
- package/build/comment-reply-link/index.js.map +1 -1
- package/build/comment-template/index.js +1 -1
- package/build/comments/deprecated.js +65 -0
- package/build/comments/deprecated.js.map +1 -0
- package/build/comments/edit/comments-legacy.js +73 -0
- package/build/comments/edit/comments-legacy.js.map +1 -0
- package/build/comments/{edit.js → edit/index.js} +17 -30
- package/build/comments/edit/index.js.map +1 -0
- package/build/comments/edit/placeholder.js +117 -0
- package/build/comments/edit/placeholder.js.map +1 -0
- package/build/comments/edit/template.js +39 -0
- package/build/comments/edit/template.js.map +1 -0
- package/build/comments/index.js +11 -3
- package/build/comments/index.js.map +1 -1
- package/build/comments/save.js +12 -4
- package/build/comments/save.js.map +1 -1
- package/build/comments-pagination/index.js +1 -1
- package/build/comments-title/deprecated.js +1 -4
- package/build/comments-title/deprecated.js.map +1 -1
- package/build/comments-title/index.js +1 -1
- package/build/cover/edit/block-controls.js +2 -12
- package/build/cover/edit/block-controls.js.map +1 -1
- package/build/cover/edit/cover-placeholder.js +3 -1
- package/build/cover/edit/cover-placeholder.js.map +1 -1
- package/build/cover/edit/index.js +19 -4
- package/build/cover/edit/index.js.map +1 -1
- package/build/cover/index.js +1 -0
- package/build/cover/index.js.map +1 -1
- package/build/cover/transforms.js +3 -2
- package/build/cover/transforms.js.map +1 -1
- package/build/embed/embed-placeholder.native.js +1 -3
- package/build/embed/embed-placeholder.native.js.map +1 -1
- package/build/embed/embed-preview.js +1 -0
- package/build/embed/embed-preview.js.map +1 -1
- package/build/embed/icons.js +21 -1
- package/build/embed/icons.js.map +1 -1
- package/build/embed/save.js +1 -0
- package/build/embed/save.js.map +1 -1
- package/build/embed/variations.js +11 -0
- package/build/embed/variations.js.map +1 -1
- package/build/file/edit.js +1 -1
- package/build/file/edit.js.map +1 -1
- package/build/file/save.js +1 -1
- package/build/file/save.js.map +1 -1
- package/build/gallery/edit.js +11 -19
- package/build/gallery/edit.js.map +1 -1
- package/build/gallery/gallery.js +1 -1
- package/build/gallery/gallery.js.map +1 -1
- package/build/gallery/save.js +1 -1
- package/build/gallery/save.js.map +1 -1
- package/build/gallery/transforms.js +32 -22
- package/build/gallery/transforms.js.map +1 -1
- package/build/gallery/use-get-media.js +7 -18
- package/build/gallery/use-get-media.js.map +1 -1
- package/build/gallery/use-get-media.native.js +59 -0
- package/build/gallery/use-get-media.native.js.map +1 -0
- package/build/gallery/v1/edit.js +3 -3
- package/build/gallery/v1/edit.js.map +1 -1
- package/build/gallery/v1/gallery-image.js +1 -0
- package/build/gallery/v1/gallery-image.js.map +1 -1
- package/build/gallery/v1/gallery.js +1 -1
- package/build/gallery/v1/gallery.js.map +1 -1
- package/build/gallery/v1/save.js +10 -2
- package/build/gallery/v1/save.js.map +1 -1
- package/build/group/edit.js +1 -3
- package/build/group/edit.js.map +1 -1
- package/build/group/index.js +2 -0
- package/build/group/index.js.map +1 -1
- package/build/group/variations.js +1 -1
- package/build/group/variations.js.map +1 -1
- package/build/heading/heading-level-dropdown.js +2 -1
- package/build/heading/heading-level-dropdown.js.map +1 -1
- package/build/heading/index.js +9 -4
- package/build/heading/index.js.map +1 -1
- package/build/html/edit.js +11 -20
- package/build/html/edit.js.map +1 -1
- package/build/html/preview.js +48 -0
- package/build/html/preview.js.map +1 -0
- package/build/image/deprecated.js +77 -9
- package/build/image/deprecated.js.map +1 -1
- package/build/image/edit.js +3 -1
- package/build/image/edit.js.map +1 -1
- package/build/image/edit.native.js +20 -9
- package/build/image/edit.native.js.map +1 -1
- package/build/image/image.js +28 -20
- package/build/image/image.js.map +1 -1
- package/build/image/index.js +7 -1
- package/build/image/index.js.map +1 -1
- package/build/image/save.js +9 -2
- package/build/image/save.js.map +1 -1
- package/build/index.js +1 -3
- package/build/index.js.map +1 -1
- package/build/index.native.js +3 -13
- package/build/index.native.js.map +1 -1
- package/build/latest-posts/edit.js +1 -1
- package/build/latest-posts/edit.js.map +1 -1
- package/build/list/transforms.js +4 -63
- package/build/list/transforms.js.map +1 -1
- package/build/list/v2/transforms.js +31 -42
- package/build/list/v2/transforms.js.map +1 -1
- package/build/list-item/edit.js +14 -9
- package/build/list-item/edit.js.map +1 -1
- package/build/list-item/hooks/index.js +8 -8
- package/build/list-item/hooks/index.js.map +1 -1
- package/build/list-item/hooks/use-enter.js +7 -4
- package/build/list-item/hooks/use-enter.js.map +1 -1
- package/build/list-item/hooks/use-merge.js +174 -0
- package/build/list-item/hooks/use-merge.js.map +1 -0
- package/build/list-item/hooks/use-outdent-list-item.js +93 -36
- package/build/list-item/hooks/use-outdent-list-item.js.map +1 -1
- package/build/list-item/utils.js +125 -1
- package/build/list-item/utils.js.map +1 -1
- package/build/media-text/deprecated.js +134 -7
- package/build/media-text/deprecated.js.map +1 -1
- package/build/media-text/edit.js +2 -2
- package/build/media-text/edit.js.map +1 -1
- package/build/media-text/save.js +13 -0
- package/build/media-text/save.js.map +1 -1
- package/build/more/edit.js +2 -4
- package/build/more/edit.js.map +1 -1
- package/build/more/save.js +1 -7
- package/build/more/save.js.map +1 -1
- package/build/navigation/edit/index.js +1 -1
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/index.js +9 -0
- package/build/navigation/index.js.map +1 -1
- package/build/navigation/use-navigation-menu.js +16 -74
- package/build/navigation/use-navigation-menu.js.map +1 -1
- package/build/navigation/view.js +6 -1
- package/build/navigation/view.js.map +1 -1
- package/build/navigation-link/edit.js +5 -4
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-link/hooks.js +0 -16
- package/build/navigation-link/hooks.js.map +1 -1
- package/build/navigation-link/index.js +1 -1
- package/build/navigation-link/index.js.map +1 -1
- package/build/navigation-submenu/edit.js +2 -1
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/navigation-submenu/view.js +6 -1
- package/build/navigation-submenu/view.js.map +1 -1
- package/build/nextpage/edit.js +1 -3
- package/build/nextpage/edit.js.map +1 -1
- package/build/page-list/edit.js +10 -3
- package/build/page-list/edit.js.map +1 -1
- package/build/paragraph/edit.js +7 -11
- package/build/paragraph/edit.js.map +1 -1
- package/build/post-comments-form/edit.js +4 -37
- package/build/post-comments-form/edit.js.map +1 -1
- package/build/post-comments-form/form.js +47 -3
- package/build/post-comments-form/form.js.map +1 -1
- package/build/post-terms/edit.js +3 -2
- package/build/post-terms/edit.js.map +1 -1
- package/build/post-terms/index.js +1 -1
- package/build/post-terms/index.js.map +1 -1
- package/build/post-title/index.js +1 -0
- package/build/post-title/index.js.map +1 -1
- package/build/query/edit/inspector-controls/index.js +1 -1
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/index.js +1 -1
- package/build/query/index.js.map +1 -1
- package/build/query-no-results/edit.js +1 -1
- package/build/query-no-results/edit.js.map +1 -1
- package/build/query-pagination-next/edit.js +2 -1
- package/build/query-pagination-next/edit.js.map +1 -1
- package/build/query-pagination-previous/edit.js +2 -1
- package/build/query-pagination-previous/edit.js.map +1 -1
- package/build/quote/deprecated.js +168 -36
- package/build/quote/deprecated.js.map +1 -1
- package/build/quote/edit.js +76 -39
- package/build/quote/edit.js.map +1 -1
- package/build/quote/index.js +9 -45
- package/build/quote/index.js.map +1 -1
- package/build/quote/save.js +1 -5
- package/build/quote/save.js.map +1 -1
- package/build/quote/transforms.js +110 -158
- package/build/quote/transforms.js.map +1 -1
- package/build/search/edit.js +1 -1
- package/build/search/edit.js.map +1 -1
- package/build/site-logo/edit.js +5 -13
- package/build/site-logo/edit.js.map +1 -1
- package/build/site-title/edit/level-toolbar.js +2 -1
- package/build/site-title/edit/level-toolbar.js.map +1 -1
- package/build/social-link/icons/index.js +13 -0
- package/build/social-link/icons/index.js.map +1 -1
- package/build/social-link/icons/whatsapp.js +25 -0
- package/build/social-link/icons/whatsapp.js.map +1 -0
- package/build/social-link/variations.js +7 -0
- package/build/social-link/variations.js.map +1 -1
- package/build/table/edit.js +1 -0
- package/build/table/edit.js.map +1 -1
- package/build/table/save.js +2 -1
- package/build/table/save.js.map +1 -1
- package/build/template-part/edit/index.js +17 -8
- package/build/template-part/edit/index.js.map +1 -1
- package/build/template-part/edit/selection-modal.js +33 -13
- package/build/template-part/edit/selection-modal.js.map +1 -1
- package/build/template-part/edit/utils/search.js +94 -0
- package/build/template-part/edit/utils/search.js.map +1 -0
- package/build/template-part/index.js +1 -1
- package/build/template-part/index.js.map +1 -1
- package/build/template-part/variations.js +0 -16
- package/build/template-part/variations.js.map +1 -1
- package/build/utils/clean-empty-object.js +5 -3
- package/build/utils/clean-empty-object.js.map +1 -1
- package/build/video/edit.js +1 -0
- package/build/video/edit.js.map +1 -1
- package/build/video/save.js +1 -0
- package/build/video/save.js.map +1 -1
- package/build/video/tracks-editor.js +9 -11
- package/build/video/tracks-editor.js.map +1 -1
- package/build-module/audio/edit.js +2 -1
- package/build-module/audio/edit.js.map +1 -1
- package/build-module/audio/save.js +3 -2
- package/build-module/audio/save.js.map +1 -1
- package/build-module/avatar/hooks.js +2 -2
- package/build-module/avatar/hooks.js.map +1 -1
- package/build-module/button/edit.js +4 -3
- package/build-module/button/edit.js.map +1 -1
- package/build-module/button/index.js +1 -24
- package/build-module/button/index.js.map +1 -1
- package/build-module/button/save.js +2 -2
- package/build-module/button/save.js.map +1 -1
- package/build-module/buttons/edit.js +2 -2
- package/build-module/buttons/edit.js.map +1 -1
- package/build-module/columns/edit.native.js +2 -2
- package/build-module/columns/edit.native.js.map +1 -1
- package/build-module/columns/variations.js +2 -2
- package/build-module/columns/variations.js.map +1 -1
- package/build-module/comment-author-name/edit.js +3 -5
- package/build-module/comment-author-name/edit.js.map +1 -1
- package/build-module/comment-author-name/index.js +0 -4
- package/build-module/comment-author-name/index.js.map +1 -1
- package/build-module/comment-date/edit.js +4 -4
- package/build-module/comment-date/edit.js.map +1 -1
- package/build-module/comment-date/index.js +0 -4
- package/build-module/comment-date/index.js.map +1 -1
- package/build-module/comment-edit-link/index.js +0 -4
- package/build-module/comment-edit-link/index.js.map +1 -1
- package/build-module/comment-reply-link/index.js +0 -4
- package/build-module/comment-reply-link/index.js.map +1 -1
- package/build-module/comment-template/index.js +1 -1
- package/build-module/comments/deprecated.js +54 -0
- package/build-module/comments/deprecated.js.map +1 -0
- package/build-module/comments/edit/comments-legacy.js +59 -0
- package/build-module/comments/edit/comments-legacy.js.map +1 -0
- package/build-module/comments/edit/index.js +37 -0
- package/build-module/comments/edit/index.js.map +1 -0
- package/build-module/comments/edit/placeholder.js +102 -0
- package/build-module/comments/edit/placeholder.js.map +1 -0
- package/build-module/comments/edit/template.js +32 -0
- package/build-module/comments/edit/template.js.map +1 -0
- package/build-module/comments/index.js +10 -3
- package/build-module/comments/index.js.map +1 -1
- package/build-module/comments/save.js +9 -4
- package/build-module/comments/save.js.map +1 -1
- package/build-module/comments-pagination/index.js +1 -1
- package/build-module/comments-title/deprecated.js +1 -4
- package/build-module/comments-title/deprecated.js.map +1 -1
- package/build-module/comments-title/index.js +1 -1
- package/build-module/cover/edit/block-controls.js +3 -13
- package/build-module/cover/edit/block-controls.js.map +1 -1
- package/build-module/cover/edit/cover-placeholder.js +3 -1
- package/build-module/cover/edit/cover-placeholder.js.map +1 -1
- package/build-module/cover/edit/index.js +19 -4
- package/build-module/cover/edit/index.js.map +1 -1
- package/build-module/cover/index.js +1 -0
- package/build-module/cover/index.js.map +1 -1
- package/build-module/cover/transforms.js +3 -2
- package/build-module/cover/transforms.js.map +1 -1
- package/build-module/embed/embed-placeholder.native.js +1 -2
- package/build-module/embed/embed-placeholder.native.js.map +1 -1
- package/build-module/embed/embed-preview.js +2 -1
- package/build-module/embed/embed-preview.js.map +1 -1
- package/build-module/embed/icons.js +19 -0
- package/build-module/embed/icons.js.map +1 -1
- package/build-module/embed/save.js +2 -1
- package/build-module/embed/save.js.map +1 -1
- package/build-module/embed/variations.js +12 -1
- package/build-module/embed/variations.js.map +1 -1
- package/build-module/file/edit.js +2 -2
- package/build-module/file/edit.js.map +1 -1
- package/build-module/file/save.js +2 -2
- package/build-module/file/save.js.map +1 -1
- package/build-module/gallery/edit.js +11 -18
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/gallery/gallery.js +2 -2
- package/build-module/gallery/gallery.js.map +1 -1
- package/build-module/gallery/save.js +2 -2
- package/build-module/gallery/save.js.map +1 -1
- package/build-module/gallery/transforms.js +33 -23
- package/build-module/gallery/transforms.js.map +1 -1
- package/build-module/gallery/use-get-media.js +6 -16
- package/build-module/gallery/use-get-media.js.map +1 -1
- package/build-module/gallery/use-get-media.native.js +50 -0
- package/build-module/gallery/use-get-media.native.js.map +1 -0
- package/build-module/gallery/v1/edit.js +4 -4
- package/build-module/gallery/v1/edit.js.map +1 -1
- package/build-module/gallery/v1/gallery-image.js +2 -1
- package/build-module/gallery/v1/gallery-image.js.map +1 -1
- package/build-module/gallery/v1/gallery.js +2 -2
- package/build-module/gallery/v1/gallery.js.map +1 -1
- package/build-module/gallery/v1/save.js +8 -3
- package/build-module/gallery/v1/save.js.map +1 -1
- package/build-module/group/edit.js +1 -3
- package/build-module/group/edit.js.map +1 -1
- package/build-module/group/index.js +2 -0
- package/build-module/group/index.js.map +1 -1
- package/build-module/group/variations.js +2 -2
- package/build-module/group/variations.js.map +1 -1
- package/build-module/heading/heading-level-dropdown.js +2 -1
- package/build-module/heading/heading-level-dropdown.js.map +1 -1
- package/build-module/heading/index.js +9 -4
- package/build-module/heading/index.js.map +1 -1
- package/build-module/html/edit.js +12 -23
- package/build-module/html/edit.js.map +1 -1
- package/build-module/html/preview.js +38 -0
- package/build-module/html/preview.js.map +1 -0
- package/build-module/image/deprecated.js +77 -9
- package/build-module/image/deprecated.js.map +1 -1
- package/build-module/image/edit.js +5 -3
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/edit.native.js +20 -9
- package/build-module/image/edit.native.js.map +1 -1
- package/build-module/image/image.js +30 -22
- package/build-module/image/image.js.map +1 -1
- package/build-module/image/index.js +7 -1
- package/build-module/image/index.js.map +1 -1
- package/build-module/image/save.js +10 -3
- package/build-module/image/save.js.map +1 -1
- package/build-module/index.js +1 -2
- package/build-module/index.js.map +1 -1
- package/build-module/index.native.js +3 -13
- package/build-module/index.native.js.map +1 -1
- package/build-module/latest-posts/edit.js +2 -2
- package/build-module/latest-posts/edit.js.map +1 -1
- package/build-module/list/transforms.js +4 -63
- package/build-module/list/transforms.js.map +1 -1
- package/build-module/list/v2/transforms.js +32 -44
- package/build-module/list/v2/transforms.js.map +1 -1
- package/build-module/list-item/edit.js +14 -10
- package/build-module/list-item/edit.js.map +1 -1
- package/build-module/list-item/hooks/index.js +1 -1
- package/build-module/list-item/hooks/index.js.map +1 -1
- package/build-module/list-item/hooks/use-enter.js +7 -4
- package/build-module/list-item/hooks/use-enter.js.map +1 -1
- package/build-module/list-item/hooks/use-merge.js +160 -0
- package/build-module/list-item/hooks/use-merge.js.map +1 -0
- package/build-module/list-item/hooks/use-outdent-list-item.js +88 -33
- package/build-module/list-item/hooks/use-outdent-list-item.js.map +1 -1
- package/build-module/list-item/utils.js +123 -2
- package/build-module/list-item/utils.js.map +1 -1
- package/build-module/media-text/deprecated.js +134 -8
- package/build-module/media-text/deprecated.js.map +1 -1
- package/build-module/media-text/edit.js +2 -2
- package/build-module/media-text/edit.js.map +1 -1
- package/build-module/media-text/save.js +13 -0
- package/build-module/media-text/save.js.map +1 -1
- package/build-module/more/edit.js +2 -4
- package/build-module/more/edit.js.map +1 -1
- package/build-module/more/save.js +1 -6
- package/build-module/more/save.js.map +1 -1
- package/build-module/navigation/edit/index.js +1 -1
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/index.js +9 -0
- package/build-module/navigation/index.js.map +1 -1
- package/build-module/navigation/use-navigation-menu.js +17 -75
- package/build-module/navigation/use-navigation-menu.js.map +1 -1
- package/build-module/navigation/view.js +6 -1
- package/build-module/navigation/view.js.map +1 -1
- package/build-module/navigation-link/edit.js +5 -4
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-link/hooks.js +0 -13
- package/build-module/navigation-link/hooks.js.map +1 -1
- package/build-module/navigation-link/index.js +1 -1
- package/build-module/navigation-link/index.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +2 -1
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/navigation-submenu/view.js +6 -1
- package/build-module/navigation-submenu/view.js.map +1 -1
- package/build-module/nextpage/edit.js +1 -3
- package/build-module/nextpage/edit.js.map +1 -1
- package/build-module/page-list/edit.js +10 -3
- package/build-module/page-list/edit.js.map +1 -1
- package/build-module/paragraph/edit.js +8 -12
- package/build-module/paragraph/edit.js.map +1 -1
- package/build-module/post-comments-form/edit.js +5 -35
- package/build-module/post-comments-form/edit.js.map +1 -1
- package/build-module/post-comments-form/form.js +46 -5
- package/build-module/post-comments-form/form.js.map +1 -1
- package/build-module/post-terms/edit.js +3 -2
- package/build-module/post-terms/edit.js.map +1 -1
- package/build-module/post-terms/index.js +1 -1
- package/build-module/post-terms/index.js.map +1 -1
- package/build-module/post-title/index.js +1 -0
- package/build-module/post-title/index.js.map +1 -1
- package/build-module/query/edit/inspector-controls/index.js +1 -1
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/query/index.js +1 -1
- package/build-module/query/index.js.map +1 -1
- package/build-module/query-no-results/edit.js +2 -2
- package/build-module/query-no-results/edit.js.map +1 -1
- package/build-module/query-pagination-next/edit.js +2 -1
- package/build-module/query-pagination-next/edit.js.map +1 -1
- package/build-module/query-pagination-previous/edit.js +2 -1
- package/build-module/query-pagination-previous/edit.js.map +1 -1
- package/build-module/quote/deprecated.js +162 -36
- package/build-module/quote/deprecated.js.map +1 -1
- package/build-module/quote/edit.js +77 -43
- package/build-module/quote/edit.js.map +1 -1
- package/build-module/quote/index.js +9 -39
- package/build-module/quote/index.js.map +1 -1
- package/build-module/quote/save.js +4 -8
- package/build-module/quote/save.js.map +1 -1
- package/build-module/quote/transforms.js +111 -158
- package/build-module/quote/transforms.js.map +1 -1
- package/build-module/search/edit.js +2 -2
- package/build-module/search/edit.js.map +1 -1
- package/build-module/site-logo/edit.js +5 -13
- package/build-module/site-logo/edit.js.map +1 -1
- package/build-module/site-title/edit/level-toolbar.js +2 -1
- package/build-module/site-title/edit/level-toolbar.js.map +1 -1
- package/build-module/social-link/icons/index.js +1 -0
- package/build-module/social-link/icons/index.js.map +1 -1
- package/build-module/social-link/icons/whatsapp.js +15 -0
- package/build-module/social-link/icons/whatsapp.js.map +1 -0
- package/build-module/social-link/variations.js +8 -1
- package/build-module/social-link/variations.js.map +1 -1
- package/build-module/table/edit.js +2 -1
- package/build-module/table/edit.js.map +1 -1
- package/build-module/table/save.js +3 -2
- package/build-module/table/save.js.map +1 -1
- package/build-module/template-part/edit/index.js +20 -11
- package/build-module/template-part/edit/index.js.map +1 -1
- package/build-module/template-part/edit/selection-modal.js +33 -15
- package/build-module/template-part/edit/selection-modal.js.map +1 -1
- package/build-module/template-part/edit/utils/search.js +84 -0
- package/build-module/template-part/edit/utils/search.js.map +1 -0
- package/build-module/template-part/index.js +1 -1
- package/build-module/template-part/index.js.map +1 -1
- package/build-module/template-part/variations.js +0 -13
- package/build-module/template-part/variations.js.map +1 -1
- package/build-module/utils/clean-empty-object.js +5 -2
- package/build-module/utils/clean-empty-object.js.map +1 -1
- package/build-module/video/edit.js +2 -1
- package/build-module/video/edit.js.map +1 -1
- package/build-module/video/save.js +2 -1
- package/build-module/video/save.js.map +1 -1
- package/build-module/video/tracks-editor.js +9 -11
- package/build-module/video/tracks-editor.js.map +1 -1
- package/build-style/button/style-rtl.css +6 -1
- package/build-style/button/style.css +6 -1
- package/build-style/comment-template/style-rtl.css +12 -0
- package/build-style/comment-template/style.css +12 -0
- package/build-style/comments/editor-rtl.css +122 -0
- package/build-style/comments/editor.css +122 -0
- package/build-style/{post-comments → comments}/style-rtl.css +3 -1
- package/build-style/{post-comments → comments}/style.css +3 -1
- package/build-style/common-rtl.css +7 -0
- package/build-style/common.css +7 -0
- package/build-style/cover/style-rtl.css +2 -2
- package/build-style/cover/style.css +2 -2
- package/build-style/editor-elements-rtl.css +85 -0
- package/build-style/editor-elements.css +85 -0
- package/build-style/editor-rtl.css +154 -10
- package/build-style/editor.css +154 -10
- package/build-style/{post-comments/editor-rtl.css → elements-rtl.css} +5 -2
- package/build-style/{post-comments/editor.css → elements.css} +5 -2
- package/build-style/file/style-rtl.css +5 -8
- package/build-style/file/style.css +5 -8
- package/build-style/gallery/style-rtl.css +7 -2
- package/build-style/gallery/style.css +7 -2
- package/build-style/image/editor-rtl.css +4 -3
- package/build-style/image/editor.css +4 -3
- package/build-style/image/style-rtl.css +33 -3
- package/build-style/image/style.css +33 -3
- package/build-style/navigation/style-rtl.css +9 -1
- package/build-style/navigation/style.css +9 -1
- package/build-style/post-comments-form/editor-rtl.css +3 -0
- package/build-style/post-comments-form/editor.css +3 -0
- package/build-style/post-comments-form/style-rtl.css +0 -1
- package/build-style/post-comments-form/style.css +0 -1
- package/build-style/post-template/style-rtl.css +9 -18
- package/build-style/post-template/style.css +9 -18
- package/build-style/query/editor-rtl.css +1 -1
- package/build-style/query/editor.css +1 -1
- package/build-style/search/style-rtl.css +6 -8
- package/build-style/search/style.css +6 -8
- package/build-style/search/theme-rtl.css +5 -0
- package/build-style/search/theme.css +5 -0
- package/build-style/social-link/editor-rtl.css +1 -0
- package/build-style/social-link/editor.css +1 -0
- package/build-style/social-links/style-rtl.css +8 -0
- package/build-style/social-links/style.css +8 -0
- package/build-style/style-rtl.css +216 -154
- package/build-style/style.css +216 -154
- package/build-style/template-part/editor-rtl.css +14 -3
- package/build-style/template-part/editor.css +14 -3
- package/build-style/theme-rtl.css +5 -0
- package/build-style/theme.css +5 -0
- package/package.json +28 -28
- package/src/audio/edit.js +4 -0
- package/src/audio/save.js +12 -2
- package/src/avatar/hooks.js +6 -9
- package/src/button/block.json +1 -24
- package/src/button/edit.js +3 -2
- package/src/button/save.js +2 -2
- package/src/button/style.scss +13 -1
- package/src/buttons/edit.js +1 -5
- package/src/columns/edit.native.js +2 -2
- package/src/columns/variations.js +2 -2
- package/src/comment-author-name/block.json +0 -4
- package/src/comment-author-name/edit.js +3 -12
- package/src/comment-date/block.json +0 -4
- package/src/comment-date/edit.js +10 -14
- package/src/comment-date/index.php +0 -3
- package/src/comment-edit-link/block.json +0 -4
- package/src/comment-reply-link/block.json +0 -4
- package/src/comment-template/block.json +1 -1
- package/src/comment-template/style.scss +14 -0
- package/src/comments/block.json +7 -2
- package/src/comments/deprecated.js +53 -0
- package/src/comments/edit/comments-legacy.js +71 -0
- package/src/comments/edit/index.js +35 -0
- package/src/comments/edit/placeholder.js +124 -0
- package/src/comments/{edit.js → edit/template.js} +25 -32
- package/src/comments/editor.scss +9 -0
- package/src/comments/index.js +2 -0
- package/src/comments/index.php +219 -0
- package/src/comments/save.js +8 -7
- package/src/{post-comments → comments}/style.scss +14 -3
- package/src/comments-pagination/block.json +1 -1
- package/src/comments-title/block.json +1 -1
- package/src/comments-title/deprecated.js +0 -2
- package/src/common.scss +2 -0
- package/src/cover/block.json +1 -0
- package/src/cover/edit/block-controls.js +4 -20
- package/src/cover/edit/cover-placeholder.js +2 -0
- package/src/cover/edit/index.js +16 -0
- package/src/cover/index.php +21 -8
- package/src/cover/style.scss +2 -2
- package/src/cover/transforms.js +2 -2
- package/src/editor-elements.scss +10 -0
- package/src/editor.scss +2 -1
- package/src/elements.scss +6 -0
- package/src/embed/embed-placeholder.native.js +2 -3
- package/src/embed/embed-preview.js +8 -1
- package/src/embed/icons.js +25 -0
- package/src/embed/save.js +10 -2
- package/src/embed/test/__snapshots__/index.native.js.snap +1 -1
- package/src/embed/variations.js +10 -0
- package/src/file/edit.js +4 -2
- package/src/file/save.js +2 -2
- package/src/file/style.scss +5 -5
- package/src/freeform/editor.scss +0 -2
- package/src/gallery/edit.js +12 -23
- package/src/gallery/gallery.js +9 -2
- package/src/gallery/index.php +5 -1
- package/src/gallery/save.js +5 -1
- package/src/gallery/style.scss +10 -1
- package/src/gallery/test/__snapshots__/index.native.js.snap +2 -2
- package/src/gallery/test/helpers.native.js +11 -198
- package/src/gallery/test/index.native.js +19 -29
- package/src/gallery/transforms.js +28 -13
- package/src/gallery/use-get-media.js +11 -28
- package/src/gallery/use-get-media.native.js +44 -0
- package/src/gallery/v1/edit.js +3 -4
- package/src/gallery/v1/gallery-image.js +4 -0
- package/src/gallery/v1/gallery.js +8 -2
- package/src/gallery/v1/save.js +20 -3
- package/src/group/block.json +2 -0
- package/src/group/edit.js +1 -3
- package/src/group/variations.js +2 -2
- package/src/heading/heading-level-dropdown.js +1 -0
- package/src/heading/index.js +8 -2
- package/src/html/edit.js +10 -40
- package/src/html/preview.js +46 -0
- package/src/image/block.json +7 -1
- package/src/image/deprecated.js +86 -0
- package/src/image/edit.js +6 -1
- package/src/image/edit.native.js +19 -7
- package/src/image/editor.scss +9 -4
- package/src/image/image.js +28 -16
- package/src/image/save.js +20 -3
- package/src/image/style.scss +39 -3
- package/src/image/test/edit.native.js +51 -19
- package/src/index.js +0 -2
- package/src/index.native.js +2 -11
- package/src/latest-posts/edit.js +2 -6
- package/src/list/transforms.js +0 -47
- package/src/list/v2/transforms.js +23 -46
- package/src/list-item/edit.js +10 -12
- package/src/list-item/hooks/index.js +1 -1
- package/src/list-item/hooks/use-enter.js +9 -6
- package/src/list-item/hooks/use-merge.js +141 -0
- package/src/list-item/hooks/use-outdent-list-item.js +79 -54
- package/src/list-item/utils.js +27 -3
- package/src/media-text/deprecated.js +148 -1
- package/src/media-text/edit.js +2 -1
- package/src/media-text/save.js +18 -0
- package/src/more/edit.js +9 -11
- package/src/more/save.js +3 -6
- package/src/navigation/block.json +9 -0
- package/src/navigation/edit/index.js +1 -0
- package/src/navigation/style.scss +11 -2
- package/src/navigation/test/use-navigation-menu.js +16 -11
- package/src/navigation/use-navigation-menu.js +26 -83
- package/src/navigation/view.js +6 -1
- package/src/navigation-link/edit.js +4 -3
- package/src/navigation-link/hooks.js +0 -14
- package/src/navigation-link/index.js +1 -1
- package/src/navigation-link/test/__snapshots__/hooks.js.snap +0 -93
- package/src/navigation-link/test/hooks.js +0 -12
- package/src/navigation-submenu/edit.js +1 -0
- package/src/navigation-submenu/view.js +6 -1
- package/src/nextpage/edit.js +1 -3
- package/src/page-list/edit.js +12 -5
- package/src/paragraph/edit.js +8 -14
- package/src/post-comments-form/edit.js +3 -58
- package/src/post-comments-form/editor.scss +4 -0
- package/src/post-comments-form/form.js +81 -6
- package/src/post-comments-form/index.php +1 -1
- package/src/post-comments-form/style.scss +0 -1
- package/src/post-featured-image/index.php +4 -2
- package/src/post-template/index.php +23 -17
- package/src/post-template/style.scss +1 -7
- package/src/post-terms/edit.js +3 -2
- package/src/post-terms/index.js +1 -1
- package/src/post-title/block.json +1 -0
- package/src/query/edit/inspector-controls/index.js +1 -1
- package/src/query/editor.scss +1 -1
- package/src/query/index.js +1 -1
- package/src/query-no-results/edit.js +2 -5
- package/src/query-no-results/index.php +10 -8
- package/src/query-pagination-next/edit.js +1 -0
- package/src/query-pagination-previous/edit.js +1 -0
- package/src/quote/deprecated.js +213 -99
- package/src/quote/edit.js +77 -52
- package/src/quote/index.js +10 -33
- package/src/quote/save.js +5 -5
- package/src/quote/{v2/test → test}/migrate.js +2 -7
- package/src/quote/transforms.js +117 -147
- package/src/search/edit.js +2 -2
- package/src/search/index.php +12 -10
- package/src/search/style.scss +9 -8
- package/src/search/theme.scss +5 -0
- package/src/site-logo/edit.js +2 -11
- package/src/site-title/edit/level-toolbar.js +1 -0
- package/src/social-link/editor.scss +3 -0
- package/src/social-link/icons/index.js +1 -0
- package/src/social-link/icons/whatsapp.js +10 -0
- package/src/social-link/index.php +20 -0
- package/src/social-link/socials-with-bg.scss +5 -0
- package/src/social-link/socials-without-bg.scss +5 -0
- package/src/social-link/variations.js +7 -0
- package/src/style.scss +1 -1
- package/src/table/edit.js +2 -0
- package/src/table/save.js +6 -1
- package/src/template-part/edit/index.js +37 -24
- package/src/template-part/edit/selection-modal.js +68 -40
- package/src/template-part/edit/utils/search.js +76 -0
- package/src/template-part/editor.scss +21 -9
- package/src/template-part/index.js +1 -1
- package/src/template-part/index.php +56 -2
- package/src/template-part/variations.js +0 -11
- package/src/utils/clean-empty-object.js +8 -2
- package/src/video/edit.js +4 -0
- package/src/video/save.js +10 -2
- package/src/video/tracks-editor.js +1 -1
- package/build/comments/edit.js.map +0 -1
- package/build/gallery/use-short-code-transform.js +0 -64
- package/build/gallery/use-short-code-transform.js.map +0 -1
- package/build/list-item/hooks/use-backspace.js +0 -59
- package/build/list-item/hooks/use-backspace.js.map +0 -1
- package/build/navigation-link/fallback-variations.js +0 -75
- package/build/navigation-link/fallback-variations.js.map +0 -1
- package/build/post-comments/edit.js +0 -184
- package/build/post-comments/edit.js.map +0 -1
- package/build/post-comments/index.js +0 -72
- package/build/post-comments/index.js.map +0 -1
- package/build/quote/v2/deprecated.js +0 -133
- package/build/quote/v2/deprecated.js.map +0 -1
- package/build/quote/v2/edit.js +0 -139
- package/build/quote/v2/edit.js.map +0 -1
- package/build/quote/v2/index.js +0 -49
- package/build/quote/v2/index.js.map +0 -1
- package/build/quote/v2/save.js +0 -43
- package/build/quote/v2/save.js.map +0 -1
- package/build/quote/v2/transforms.js +0 -156
- package/build/quote/v2/transforms.js.map +0 -1
- package/build/template-part/fallback-variations.js +0 -59
- package/build/template-part/fallback-variations.js.map +0 -1
- package/build-module/comments/edit.js +0 -51
- package/build-module/comments/edit.js.map +0 -1
- package/build-module/gallery/use-short-code-transform.js +0 -54
- package/build-module/gallery/use-short-code-transform.js.map +0 -1
- package/build-module/list-item/hooks/use-backspace.js +0 -44
- package/build-module/list-item/hooks/use-backspace.js.map +0 -1
- package/build-module/navigation-link/fallback-variations.js +0 -65
- package/build-module/navigation-link/fallback-variations.js.map +0 -1
- package/build-module/post-comments/edit.js +0 -171
- package/build-module/post-comments/edit.js.map +0 -1
- package/build-module/post-comments/index.js +0 -59
- package/build-module/post-comments/index.js.map +0 -1
- package/build-module/quote/v2/deprecated.js +0 -116
- package/build-module/quote/v2/deprecated.js.map +0 -1
- package/build-module/quote/v2/edit.js +0 -122
- package/build-module/quote/v2/edit.js.map +0 -1
- package/build-module/quote/v2/index.js +0 -33
- package/build-module/quote/v2/index.js.map +0 -1
- package/build-module/quote/v2/save.js +0 -30
- package/build-module/quote/v2/save.js.map +0 -1
- package/build-module/quote/v2/transforms.js +0 -147
- package/build-module/quote/v2/transforms.js.map +0 -1
- package/build-module/template-part/fallback-variations.js +0 -47
- package/build-module/template-part/fallback-variations.js.map +0 -1
- package/src/gallery/use-short-code-transform.js +0 -55
- package/src/list-item/hooks/use-backspace.js +0 -51
- package/src/navigation-link/fallback-variations.js +0 -65
- package/src/post-comments/block.json +0 -45
- package/src/post-comments/edit.js +0 -247
- package/src/post-comments/editor.scss +0 -3
- package/src/post-comments/index.js +0 -18
- package/src/post-comments/index.php +0 -87
- package/src/quote/v2/deprecated.js +0 -107
- package/src/quote/v2/edit.js +0 -139
- package/src/quote/v2/index.js +0 -36
- package/src/quote/v2/save.js +0 -26
- package/src/quote/v2/transforms.js +0 -155
- package/src/template-part/fallback-variations.js +0 -51
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _i18n = require("@wordpress/i18n");
|
|
9
|
-
|
|
10
|
-
var _icons = require("@wordpress/icons");
|
|
11
|
-
|
|
12
|
-
var _coreData = require("@wordpress/core-data");
|
|
13
|
-
|
|
14
|
-
var _data = require("@wordpress/data");
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* WordPress dependencies
|
|
18
|
-
*/
|
|
19
|
-
const fallbackVariations = [{
|
|
20
|
-
name: 'header',
|
|
21
|
-
icon: _icons.header,
|
|
22
|
-
title: (0, _i18n.__)('Header'),
|
|
23
|
-
description: (0, _i18n.__)('The Header template defines a page area that typically contains a title, logo, and main navigation.'),
|
|
24
|
-
attributes: {
|
|
25
|
-
area: 'header'
|
|
26
|
-
},
|
|
27
|
-
scope: ['inserter']
|
|
28
|
-
}, {
|
|
29
|
-
name: 'footer',
|
|
30
|
-
icon: _icons.footer,
|
|
31
|
-
title: (0, _i18n.__)('Footer'),
|
|
32
|
-
description: (0, _i18n.__)('The Footer template defines a page area that typically contains site credits, social links, or any other combination of blocks.'),
|
|
33
|
-
attributes: {
|
|
34
|
-
area: 'footer'
|
|
35
|
-
},
|
|
36
|
-
scope: ['inserter']
|
|
37
|
-
}];
|
|
38
|
-
fallbackVariations.forEach(variation => {
|
|
39
|
-
if (variation.isActive) return;
|
|
40
|
-
|
|
41
|
-
variation.isActive = (blockAttributes, variationAttributes) => {
|
|
42
|
-
const {
|
|
43
|
-
area,
|
|
44
|
-
theme,
|
|
45
|
-
slug
|
|
46
|
-
} = blockAttributes; // We first check the `area` block attribute which is set during insertion.
|
|
47
|
-
// This property is removed on the creation of a template part.
|
|
48
|
-
|
|
49
|
-
if (area) return area === variationAttributes.area; // Find a matching variation from the created template part
|
|
50
|
-
// by checking the entity's `area` property.
|
|
51
|
-
|
|
52
|
-
if (!slug) return false;
|
|
53
|
-
const entity = (0, _data.select)(_coreData.store).getEntityRecord('postType', 'wp_template_part', `${theme}//${slug}`);
|
|
54
|
-
return (entity === null || entity === void 0 ? void 0 : entity.area) === variationAttributes.area;
|
|
55
|
-
};
|
|
56
|
-
});
|
|
57
|
-
var _default = fallbackVariations;
|
|
58
|
-
exports.default = _default;
|
|
59
|
-
//# sourceMappingURL=fallback-variations.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/template-part/fallback-variations.js"],"names":["fallbackVariations","name","icon","headerIcon","title","description","attributes","area","scope","footerIcon","forEach","variation","isActive","blockAttributes","variationAttributes","theme","slug","entity","coreDataStore","getEntityRecord"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AACA;;AANA;AACA;AACA;AAMA,MAAMA,kBAAkB,GAAG,CAC1B;AACCC,EAAAA,IAAI,EAAE,QADP;AAECC,EAAAA,IAAI,EAAEC,aAFP;AAGCC,EAAAA,KAAK,EAAE,cAAI,QAAJ,CAHR;AAICC,EAAAA,WAAW,EAAE,cACZ,qGADY,CAJd;AAOCC,EAAAA,UAAU,EAAE;AAAEC,IAAAA,IAAI,EAAE;AAAR,GAPb;AAQCC,EAAAA,KAAK,EAAE,CAAE,UAAF;AARR,CAD0B,EAW1B;AACCP,EAAAA,IAAI,EAAE,QADP;AAECC,EAAAA,IAAI,EAAEO,aAFP;AAGCL,EAAAA,KAAK,EAAE,cAAI,QAAJ,CAHR;AAICC,EAAAA,WAAW,EAAE,cACZ,iIADY,CAJd;AAOCC,EAAAA,UAAU,EAAE;AAAEC,IAAAA,IAAI,EAAE;AAAR,GAPb;AAQCC,EAAAA,KAAK,EAAE,CAAE,UAAF;AARR,CAX0B,CAA3B;AAuBAR,kBAAkB,CAACU,OAAnB,CAA8BC,SAAF,IAAiB;AAC5C,MAAKA,SAAS,CAACC,QAAf,EAA0B;;AAC1BD,EAAAA,SAAS,CAACC,QAAV,GAAqB,CAAEC,eAAF,EAAmBC,mBAAnB,KAA4C;AAChE,UAAM;AAAEP,MAAAA,IAAF;AAAQQ,MAAAA,KAAR;AAAeC,MAAAA;AAAf,QAAwBH,eAA9B,CADgE,CAEhE;AACA;;AACA,QAAKN,IAAL,EAAY,OAAOA,IAAI,KAAKO,mBAAmB,CAACP,IAApC,CAJoD,CAKhE;AACA;;AACA,QAAK,CAAES,IAAP,EAAc,OAAO,KAAP;AACd,UAAMC,MAAM,GAAG,kBAAQC,eAAR,EAAwBC,eAAxB,CACd,UADc,EAEd,kBAFc,EAGb,GAAGJ,KAAO,KAAKC,IAAM,EAHR,CAAf;AAKA,WAAO,CAAAC,MAAM,SAAN,IAAAA,MAAM,WAAN,YAAAA,MAAM,CAAEV,IAAR,MAAiBO,mBAAmB,CAACP,IAA5C;AACA,GAdD;AAeA,CAjBD;eAmBeP,kB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { header as headerIcon, footer as footerIcon } from '@wordpress/icons';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { select } from '@wordpress/data';\n\nconst fallbackVariations = [\n\t{\n\t\tname: 'header',\n\t\ticon: headerIcon,\n\t\ttitle: __( 'Header' ),\n\t\tdescription: __(\n\t\t\t'The Header template defines a page area that typically contains a title, logo, and main navigation.'\n\t\t),\n\t\tattributes: { area: 'header' },\n\t\tscope: [ 'inserter' ],\n\t},\n\t{\n\t\tname: 'footer',\n\t\ticon: footerIcon,\n\t\ttitle: __( 'Footer' ),\n\t\tdescription: __(\n\t\t\t'The Footer template defines a page area that typically contains site credits, social links, or any other combination of blocks.'\n\t\t),\n\t\tattributes: { area: 'footer' },\n\t\tscope: [ 'inserter' ],\n\t},\n];\n\nfallbackVariations.forEach( ( variation ) => {\n\tif ( variation.isActive ) return;\n\tvariation.isActive = ( blockAttributes, variationAttributes ) => {\n\t\tconst { area, theme, slug } = blockAttributes;\n\t\t// We first check the `area` block attribute which is set during insertion.\n\t\t// This property is removed on the creation of a template part.\n\t\tif ( area ) return area === variationAttributes.area;\n\t\t// Find a matching variation from the created template part\n\t\t// by checking the entity's `area` property.\n\t\tif ( ! slug ) return false;\n\t\tconst entity = select( coreDataStore ).getEntityRecord(\n\t\t\t'postType',\n\t\t\t'wp_template_part',\n\t\t\t`${ theme }//${ slug }`\n\t\t);\n\t\treturn entity?.area === variationAttributes.area;\n\t};\n} );\n\nexport default fallbackVariations;\n"]}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { createElement, Fragment } from "@wordpress/element";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* WordPress dependencies
|
|
5
|
-
*/
|
|
6
|
-
import { useBlockProps, useInnerBlocksProps } from '@wordpress/block-editor';
|
|
7
|
-
/**
|
|
8
|
-
* Internal dependencies
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import CommentsInspectorControls from './edit/comments-inspector-controls';
|
|
12
|
-
const TEMPLATE = [['core/comments-title'], ['core/comment-template', {}, [['core/columns', {}, [['core/column', {
|
|
13
|
-
width: '40px'
|
|
14
|
-
}, [['core/avatar', {
|
|
15
|
-
size: 40,
|
|
16
|
-
style: {
|
|
17
|
-
border: {
|
|
18
|
-
radius: '20px'
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}]]], ['core/column', {}, [['core/comment-author-name'], ['core/group', {
|
|
22
|
-
layout: {
|
|
23
|
-
type: 'flex'
|
|
24
|
-
},
|
|
25
|
-
style: {
|
|
26
|
-
spacing: {
|
|
27
|
-
margin: {
|
|
28
|
-
top: '0px',
|
|
29
|
-
bottom: '0px'
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}, [['core/comment-date'], ['core/comment-edit-link']]], ['core/comment-content'], ['core/comment-reply-link']]]]]]], ['core/comments-pagination'], ['core/post-comments-form']];
|
|
34
|
-
export default function CommentsEdit(_ref) {
|
|
35
|
-
let {
|
|
36
|
-
attributes,
|
|
37
|
-
setAttributes
|
|
38
|
-
} = _ref;
|
|
39
|
-
const {
|
|
40
|
-
tagName: TagName
|
|
41
|
-
} = attributes;
|
|
42
|
-
const blockProps = useBlockProps();
|
|
43
|
-
const innerBlocksProps = useInnerBlocksProps(blockProps, {
|
|
44
|
-
template: TEMPLATE
|
|
45
|
-
});
|
|
46
|
-
return createElement(Fragment, null, createElement(CommentsInspectorControls, {
|
|
47
|
-
attributes: attributes,
|
|
48
|
-
setAttributes: setAttributes
|
|
49
|
-
}), createElement(TagName, innerBlocksProps));
|
|
50
|
-
}
|
|
51
|
-
//# sourceMappingURL=edit.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/comments/edit.js"],"names":["useBlockProps","useInnerBlocksProps","CommentsInspectorControls","TEMPLATE","width","size","style","border","radius","layout","type","spacing","margin","top","bottom","CommentsEdit","attributes","setAttributes","tagName","TagName","blockProps","innerBlocksProps","template"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,aAAT,EAAwBC,mBAAxB,QAAmD,yBAAnD;AAEA;AACA;AACA;;AACA,OAAOC,yBAAP,MAAsC,oCAAtC;AAEA,MAAMC,QAAQ,GAAG,CAChB,CAAE,qBAAF,CADgB,EAEhB,CACC,uBADD,EAEC,EAFD,EAGC,CACC,CACC,cADD,EAEC,EAFD,EAGC,CACC,CACC,aADD,EAEC;AAAEC,EAAAA,KAAK,EAAE;AAAT,CAFD,EAGC,CACC,CACC,aADD,EAEC;AACCC,EAAAA,IAAI,EAAE,EADP;AAECC,EAAAA,KAAK,EAAE;AACNC,IAAAA,MAAM,EAAE;AAAEC,MAAAA,MAAM,EAAE;AAAV;AADF;AAFR,CAFD,CADD,CAHD,CADD,EAgBC,CACC,aADD,EAEC,EAFD,EAGC,CACC,CAAE,0BAAF,CADD,EAEC,CACC,YADD,EAEC;AACCC,EAAAA,MAAM,EAAE;AAAEC,IAAAA,IAAI,EAAE;AAAR,GADT;AAECJ,EAAAA,KAAK,EAAE;AACNK,IAAAA,OAAO,EAAE;AACRC,MAAAA,MAAM,EAAE;AACPC,QAAAA,GAAG,EAAE,KADE;AAEPC,QAAAA,MAAM,EAAE;AAFD;AADA;AADH;AAFR,CAFD,EAaC,CACC,CAAE,mBAAF,CADD,EAEC,CAAE,wBAAF,CAFD,CAbD,CAFD,EAoBC,CAAE,sBAAF,CApBD,EAqBC,CAAE,yBAAF,CArBD,CAHD,CAhBD,CAHD,CADD,CAHD,CAFgB,EAwDhB,CAAE,0BAAF,CAxDgB,EAyDhB,CAAE,yBAAF,CAzDgB,CAAjB;AA4DA,eAAe,SAASC,YAAT,OAAuD;AAAA,MAAhC;AAAEC,IAAAA,UAAF;AAAcC,IAAAA;AAAd,GAAgC;AACrE,QAAM;AAAEC,IAAAA,OAAO,EAAEC;AAAX,MAAuBH,UAA7B;AAEA,QAAMI,UAAU,GAAGpB,aAAa,EAAhC;AACA,QAAMqB,gBAAgB,GAAGpB,mBAAmB,CAAEmB,UAAF,EAAc;AACzDE,IAAAA,QAAQ,EAAEnB;AAD+C,GAAd,CAA5C;AAIA,SACC,8BACC,cAAC,yBAAD;AACC,IAAA,UAAU,EAAGa,UADd;AAEC,IAAA,aAAa,EAAGC;AAFjB,IADD,EAKC,cAAC,OAAD,EAAcI,gBAAd,CALD,CADD;AASA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useBlockProps, useInnerBlocksProps } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport CommentsInspectorControls from './edit/comments-inspector-controls';\n\nconst TEMPLATE = [\n\t[ 'core/comments-title' ],\n\t[\n\t\t'core/comment-template',\n\t\t{},\n\t\t[\n\t\t\t[\n\t\t\t\t'core/columns',\n\t\t\t\t{},\n\t\t\t\t[\n\t\t\t\t\t[\n\t\t\t\t\t\t'core/column',\n\t\t\t\t\t\t{ width: '40px' },\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t'core/avatar',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tsize: 40,\n\t\t\t\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t\t\t\tborder: { radius: '20px' },\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'core/column',\n\t\t\t\t\t\t{},\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t[ 'core/comment-author-name' ],\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t'core/group',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlayout: { type: 'flex' },\n\t\t\t\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t\t\t\tspacing: {\n\t\t\t\t\t\t\t\t\t\t\tmargin: {\n\t\t\t\t\t\t\t\t\t\t\t\ttop: '0px',\n\t\t\t\t\t\t\t\t\t\t\t\tbottom: '0px',\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\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\t\t[ 'core/comment-date' ],\n\t\t\t\t\t\t\t\t\t[ 'core/comment-edit-link' ],\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[ 'core/comment-content' ],\n\t\t\t\t\t\t\t[ 'core/comment-reply-link' ],\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t],\n\t\t],\n\t],\n\t[ 'core/comments-pagination' ],\n\t[ 'core/post-comments-form' ],\n];\n\nexport default function CommentsEdit( { attributes, setAttributes } ) {\n\tconst { tagName: TagName } = attributes;\n\n\tconst blockProps = useBlockProps();\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\ttemplate: TEMPLATE,\n\t} );\n\n\treturn (\n\t\t<>\n\t\t\t<CommentsInspectorControls\n\t\t\t\tattributes={ attributes }\n\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t/>\n\t\t\t<TagName { ...innerBlocksProps } />\n\t\t</>\n\t);\n}\n"]}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { every } from 'lodash';
|
|
5
|
-
/**
|
|
6
|
-
* WordPress dependencies
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import { useSelect } from '@wordpress/data';
|
|
10
|
-
import { store as coreStore } from '@wordpress/core-data';
|
|
11
|
-
/**
|
|
12
|
-
* Shortcode transforms don't currently have a tranform method and so can't use a selector to
|
|
13
|
-
* retrieve the data for each image being transformer, so this selector handle this post transformation.
|
|
14
|
-
*
|
|
15
|
-
* @param {Array} shortCodeTransforms An array of image data passed from the shortcode transform.
|
|
16
|
-
*
|
|
17
|
-
* @return {Array} An array of extended image data objects for each of the shortcode transform images.
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
export default function useShortCodeTransform(shortCodeTransforms) {
|
|
21
|
-
const newImageData = useSelect(select => {
|
|
22
|
-
if (!shortCodeTransforms || shortCodeTransforms.length === 0) {
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const imageIds = shortCodeTransforms.map(image => image.id);
|
|
27
|
-
return select(coreStore).getMediaItems({
|
|
28
|
-
include: imageIds.join(','),
|
|
29
|
-
per_page: imageIds.length,
|
|
30
|
-
orderby: 'include'
|
|
31
|
-
});
|
|
32
|
-
}, [shortCodeTransforms]);
|
|
33
|
-
|
|
34
|
-
if (!newImageData) {
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
if (every(newImageData, img => img && img.source_url)) {
|
|
39
|
-
return newImageData.map(imageData => {
|
|
40
|
-
var _imageData$caption;
|
|
41
|
-
|
|
42
|
-
return {
|
|
43
|
-
id: imageData.id,
|
|
44
|
-
type: 'image',
|
|
45
|
-
url: imageData.source_url,
|
|
46
|
-
mime: imageData.mime_type,
|
|
47
|
-
alt: imageData.alt_text,
|
|
48
|
-
link: imageData.link,
|
|
49
|
-
caption: imageData === null || imageData === void 0 ? void 0 : (_imageData$caption = imageData.caption) === null || _imageData$caption === void 0 ? void 0 : _imageData$caption.raw
|
|
50
|
-
};
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
//# sourceMappingURL=use-short-code-transform.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/gallery/use-short-code-transform.js"],"names":["every","useSelect","store","coreStore","useShortCodeTransform","shortCodeTransforms","newImageData","select","length","imageIds","map","image","id","getMediaItems","include","join","per_page","orderby","img","source_url","imageData","type","url","mime","mime_type","alt","alt_text","link","caption","raw"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAT,QAAsB,QAAtB;AAEA;AACA;AACA;;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,eAAe,SAASC,qBAAT,CAAgCC,mBAAhC,EAAsD;AACpE,QAAMC,YAAY,GAAGL,SAAS,CAC3BM,MAAF,IAAc;AACb,QAAK,CAAEF,mBAAF,IAAyBA,mBAAmB,CAACG,MAApB,KAA+B,CAA7D,EAAiE;AAChE;AACA;;AAED,UAAMC,QAAQ,GAAGJ,mBAAmB,CAACK,GAApB,CAA2BC,KAAF,IAAaA,KAAK,CAACC,EAA5C,CAAjB;AAEA,WAAOL,MAAM,CAAEJ,SAAF,CAAN,CAAoBU,aAApB,CAAmC;AACzCC,MAAAA,OAAO,EAAEL,QAAQ,CAACM,IAAT,CAAe,GAAf,CADgC;AAEzCC,MAAAA,QAAQ,EAAEP,QAAQ,CAACD,MAFsB;AAGzCS,MAAAA,OAAO,EAAE;AAHgC,KAAnC,CAAP;AAKA,GAb4B,EAc7B,CAAEZ,mBAAF,CAd6B,CAA9B;;AAiBA,MAAK,CAAEC,YAAP,EAAsB;AACrB;AACA;;AAED,MAAKN,KAAK,CAAEM,YAAF,EAAkBY,GAAF,IAAWA,GAAG,IAAIA,GAAG,CAACC,UAAtC,CAAV,EAA+D;AAC9D,WAAOb,YAAY,CAACI,GAAb,CAAoBU,SAAF,IAAiB;AAAA;;AACzC,aAAO;AACNR,QAAAA,EAAE,EAAEQ,SAAS,CAACR,EADR;AAENS,QAAAA,IAAI,EAAE,OAFA;AAGNC,QAAAA,GAAG,EAAEF,SAAS,CAACD,UAHT;AAINI,QAAAA,IAAI,EAAEH,SAAS,CAACI,SAJV;AAKNC,QAAAA,GAAG,EAAEL,SAAS,CAACM,QALT;AAMNC,QAAAA,IAAI,EAAEP,SAAS,CAACO,IANV;AAONC,QAAAA,OAAO,EAAER,SAAF,aAAEA,SAAF,6CAAEA,SAAS,CAAEQ,OAAb,uDAAE,mBAAoBC;AAPvB,OAAP;AASA,KAVM,CAAP;AAWA;AACD","sourcesContent":["/**\n * External dependencies\n */\nimport { every } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Shortcode transforms don't currently have a tranform method and so can't use a selector to\n * retrieve the data for each image being transformer, so this selector handle this post transformation.\n *\n * @param {Array} shortCodeTransforms An array of image data passed from the shortcode transform.\n *\n * @return {Array} An array of extended image data objects for each of the shortcode transform images.\n */\nexport default function useShortCodeTransform( shortCodeTransforms ) {\n\tconst newImageData = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! shortCodeTransforms || shortCodeTransforms.length === 0 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst imageIds = shortCodeTransforms.map( ( image ) => image.id );\n\n\t\t\treturn select( coreStore ).getMediaItems( {\n\t\t\t\tinclude: imageIds.join( ',' ),\n\t\t\t\tper_page: imageIds.length,\n\t\t\t\torderby: 'include',\n\t\t\t} );\n\t\t},\n\t\t[ shortCodeTransforms ]\n\t);\n\n\tif ( ! newImageData ) {\n\t\treturn;\n\t}\n\n\tif ( every( newImageData, ( img ) => img && img.source_url ) ) {\n\t\treturn newImageData.map( ( imageData ) => {\n\t\t\treturn {\n\t\t\t\tid: imageData.id,\n\t\t\t\ttype: 'image',\n\t\t\t\turl: imageData.source_url,\n\t\t\t\tmime: imageData.mime_type,\n\t\t\t\talt: imageData.alt_text,\n\t\t\t\tlink: imageData.link,\n\t\t\t\tcaption: imageData?.caption?.raw,\n\t\t\t};\n\t\t} );\n\t}\n}\n"]}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { useRef } from '@wordpress/element';
|
|
5
|
-
import { useRefEffect } from '@wordpress/compose';
|
|
6
|
-
import { BACKSPACE } from '@wordpress/keycodes';
|
|
7
|
-
import { useSelect } from '@wordpress/data';
|
|
8
|
-
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
9
|
-
/**
|
|
10
|
-
* Internal dependencies
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
import useOutdentListItem from './use-outdent-list-item';
|
|
14
|
-
export default function useBackspace(props) {
|
|
15
|
-
const {
|
|
16
|
-
getSelectionStart,
|
|
17
|
-
getSelectionEnd
|
|
18
|
-
} = useSelect(blockEditorStore);
|
|
19
|
-
const propsRef = useRef(props);
|
|
20
|
-
propsRef.current = props;
|
|
21
|
-
const [canOutdent, outdentListItem] = useOutdentListItem(propsRef.current.clientId);
|
|
22
|
-
return useRefEffect(element => {
|
|
23
|
-
function onKeyDown(event) {
|
|
24
|
-
if (event.defaultPrevented || event.keyCode !== BACKSPACE) {
|
|
25
|
-
return;
|
|
26
|
-
} // Handle only if we have a collapsed selection at the
|
|
27
|
-
// start of a list item and we can outdent.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
if (!canOutdent || [getSelectionStart().offset, getSelectionEnd().offset].some(offset => offset !== 0)) {
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
event.preventDefault();
|
|
35
|
-
outdentListItem();
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
element.addEventListener('keydown', onKeyDown);
|
|
39
|
-
return () => {
|
|
40
|
-
element.removeEventListener('keydown', onKeyDown);
|
|
41
|
-
};
|
|
42
|
-
}, [canOutdent]);
|
|
43
|
-
}
|
|
44
|
-
//# sourceMappingURL=use-backspace.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/list-item/hooks/use-backspace.js"],"names":["useRef","useRefEffect","BACKSPACE","useSelect","store","blockEditorStore","useOutdentListItem","useBackspace","props","getSelectionStart","getSelectionEnd","propsRef","current","canOutdent","outdentListItem","clientId","element","onKeyDown","event","defaultPrevented","keyCode","offset","some","preventDefault","addEventListener","removeEventListener"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,MAAT,QAAuB,oBAAvB;AACA,SAASC,YAAT,QAA6B,oBAA7B;AACA,SAASC,SAAT,QAA0B,qBAA1B;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,yBAA1C;AAEA;AACA;AACA;;AACA,OAAOC,kBAAP,MAA+B,yBAA/B;AAEA,eAAe,SAASC,YAAT,CAAuBC,KAAvB,EAA+B;AAC7C,QAAM;AAAEC,IAAAA,iBAAF;AAAqBC,IAAAA;AAArB,MACLP,SAAS,CAAEE,gBAAF,CADV;AAEA,QAAMM,QAAQ,GAAGX,MAAM,CAAEQ,KAAF,CAAvB;AACAG,EAAAA,QAAQ,CAACC,OAAT,GAAmBJ,KAAnB;AACA,QAAM,CAAEK,UAAF,EAAcC,eAAd,IAAkCR,kBAAkB,CACzDK,QAAQ,CAACC,OAAT,CAAiBG,QADwC,CAA1D;AAGA,SAAOd,YAAY,CAChBe,OAAF,IAAe;AACd,aAASC,SAAT,CAAoBC,KAApB,EAA4B;AAC3B,UAAKA,KAAK,CAACC,gBAAN,IAA0BD,KAAK,CAACE,OAAN,KAAkBlB,SAAjD,EAA6D;AAC5D;AACA,OAH0B,CAI3B;AACA;;;AACA,UACC,CAAEW,UAAF,IACA,CACCJ,iBAAiB,GAAGY,MADrB,EAECX,eAAe,GAAGW,MAFnB,EAGEC,IAHF,CAGUD,MAAF,IAAcA,MAAM,KAAK,CAHjC,CAFD,EAME;AACD;AACA;;AACDH,MAAAA,KAAK,CAACK,cAAN;AACAT,MAAAA,eAAe;AACf;;AAEDE,IAAAA,OAAO,CAACQ,gBAAR,CAA0B,SAA1B,EAAqCP,SAArC;AACA,WAAO,MAAM;AACZD,MAAAA,OAAO,CAACS,mBAAR,CAA6B,SAA7B,EAAwCR,SAAxC;AACA,KAFD;AAGA,GAzBiB,EA0BlB,CAAEJ,UAAF,CA1BkB,CAAnB;AA4BA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRef } from '@wordpress/element';\nimport { useRefEffect } from '@wordpress/compose';\nimport { BACKSPACE } from '@wordpress/keycodes';\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport useOutdentListItem from './use-outdent-list-item';\n\nexport default function useBackspace( props ) {\n\tconst { getSelectionStart, getSelectionEnd } =\n\t\tuseSelect( blockEditorStore );\n\tconst propsRef = useRef( props );\n\tpropsRef.current = props;\n\tconst [ canOutdent, outdentListItem ] = useOutdentListItem(\n\t\tpropsRef.current.clientId\n\t);\n\treturn useRefEffect(\n\t\t( element ) => {\n\t\t\tfunction onKeyDown( event ) {\n\t\t\t\tif ( event.defaultPrevented || event.keyCode !== BACKSPACE ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t// Handle only if we have a collapsed selection at the\n\t\t\t\t// start of a list item and we can outdent.\n\t\t\t\tif (\n\t\t\t\t\t! canOutdent ||\n\t\t\t\t\t[\n\t\t\t\t\t\tgetSelectionStart().offset,\n\t\t\t\t\t\tgetSelectionEnd().offset,\n\t\t\t\t\t].some( ( offset ) => offset !== 0 )\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tevent.preventDefault();\n\t\t\t\toutdentListItem();\n\t\t\t}\n\n\t\t\telement.addEventListener( 'keydown', onKeyDown );\n\t\t\treturn () => {\n\t\t\t\telement.removeEventListener( 'keydown', onKeyDown );\n\t\t\t};\n\t\t},\n\t\t[ canOutdent ]\n\t);\n}\n"]}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { __ } from '@wordpress/i18n';
|
|
5
|
-
import { category as categoryIcon, page as pageIcon, postContent as postIcon, tag as tagIcon } from '@wordpress/icons'; // FALLBACK: this is only used when the server does not understand the variations property in the
|
|
6
|
-
// register_block_type call. see navigation-link/index.php.
|
|
7
|
-
// Delete this file when supported WP ranges understand the `variations` property when passed to
|
|
8
|
-
// register_block_type in index.php.
|
|
9
|
-
|
|
10
|
-
const fallbackVariations = [{
|
|
11
|
-
name: 'link',
|
|
12
|
-
isDefault: true,
|
|
13
|
-
title: __('Custom Link'),
|
|
14
|
-
description: __('A link to a custom URL.'),
|
|
15
|
-
attributes: {}
|
|
16
|
-
}, {
|
|
17
|
-
name: 'post',
|
|
18
|
-
icon: postIcon,
|
|
19
|
-
title: __('Post Link'),
|
|
20
|
-
description: __('A link to a post.'),
|
|
21
|
-
attributes: {
|
|
22
|
-
type: 'post',
|
|
23
|
-
kind: 'post-type'
|
|
24
|
-
}
|
|
25
|
-
}, {
|
|
26
|
-
name: 'page',
|
|
27
|
-
icon: pageIcon,
|
|
28
|
-
title: __('Page Link'),
|
|
29
|
-
description: __('A link to a page.'),
|
|
30
|
-
attributes: {
|
|
31
|
-
type: 'page',
|
|
32
|
-
kind: 'post-type'
|
|
33
|
-
}
|
|
34
|
-
}, {
|
|
35
|
-
name: 'category',
|
|
36
|
-
icon: categoryIcon,
|
|
37
|
-
title: __('Category Link'),
|
|
38
|
-
description: __('A link to a category.'),
|
|
39
|
-
attributes: {
|
|
40
|
-
type: 'category',
|
|
41
|
-
kind: 'taxonomy'
|
|
42
|
-
}
|
|
43
|
-
}, {
|
|
44
|
-
name: 'tag',
|
|
45
|
-
icon: tagIcon,
|
|
46
|
-
title: __('Tag Link'),
|
|
47
|
-
description: __('A link to a tag.'),
|
|
48
|
-
attributes: {
|
|
49
|
-
type: 'tag',
|
|
50
|
-
kind: 'taxonomy'
|
|
51
|
-
}
|
|
52
|
-
}];
|
|
53
|
-
/**
|
|
54
|
-
* Add `isActive` function to all `navigation link` variations, if not defined.
|
|
55
|
-
* `isActive` function is used to find a variation match from a created
|
|
56
|
-
* Block by providing its attributes.
|
|
57
|
-
*/
|
|
58
|
-
|
|
59
|
-
fallbackVariations.forEach(variation => {
|
|
60
|
-
if (variation.isActive) return;
|
|
61
|
-
|
|
62
|
-
variation.isActive = (blockAttributes, variationAttributes) => blockAttributes.type === variationAttributes.type;
|
|
63
|
-
});
|
|
64
|
-
export default fallbackVariations;
|
|
65
|
-
//# sourceMappingURL=fallback-variations.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/navigation-link/fallback-variations.js"],"names":["__","category","categoryIcon","page","pageIcon","postContent","postIcon","tag","tagIcon","fallbackVariations","name","isDefault","title","description","attributes","icon","type","kind","forEach","variation","isActive","blockAttributes","variationAttributes"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SACCC,QAAQ,IAAIC,YADb,EAECC,IAAI,IAAIC,QAFT,EAGCC,WAAW,IAAIC,QAHhB,EAICC,GAAG,IAAIC,OAJR,QAKO,kBALP,C,CAOA;AACA;AACA;AACA;;AACA,MAAMC,kBAAkB,GAAG,CAC1B;AACCC,EAAAA,IAAI,EAAE,MADP;AAECC,EAAAA,SAAS,EAAE,IAFZ;AAGCC,EAAAA,KAAK,EAAEZ,EAAE,CAAE,aAAF,CAHV;AAICa,EAAAA,WAAW,EAAEb,EAAE,CAAE,yBAAF,CAJhB;AAKCc,EAAAA,UAAU,EAAE;AALb,CAD0B,EAQ1B;AACCJ,EAAAA,IAAI,EAAE,MADP;AAECK,EAAAA,IAAI,EAAET,QAFP;AAGCM,EAAAA,KAAK,EAAEZ,EAAE,CAAE,WAAF,CAHV;AAICa,EAAAA,WAAW,EAAEb,EAAE,CAAE,mBAAF,CAJhB;AAKCc,EAAAA,UAAU,EAAE;AAAEE,IAAAA,IAAI,EAAE,MAAR;AAAgBC,IAAAA,IAAI,EAAE;AAAtB;AALb,CAR0B,EAe1B;AACCP,EAAAA,IAAI,EAAE,MADP;AAECK,EAAAA,IAAI,EAAEX,QAFP;AAGCQ,EAAAA,KAAK,EAAEZ,EAAE,CAAE,WAAF,CAHV;AAICa,EAAAA,WAAW,EAAEb,EAAE,CAAE,mBAAF,CAJhB;AAKCc,EAAAA,UAAU,EAAE;AAAEE,IAAAA,IAAI,EAAE,MAAR;AAAgBC,IAAAA,IAAI,EAAE;AAAtB;AALb,CAf0B,EAsB1B;AACCP,EAAAA,IAAI,EAAE,UADP;AAECK,EAAAA,IAAI,EAAEb,YAFP;AAGCU,EAAAA,KAAK,EAAEZ,EAAE,CAAE,eAAF,CAHV;AAICa,EAAAA,WAAW,EAAEb,EAAE,CAAE,uBAAF,CAJhB;AAKCc,EAAAA,UAAU,EAAE;AAAEE,IAAAA,IAAI,EAAE,UAAR;AAAoBC,IAAAA,IAAI,EAAE;AAA1B;AALb,CAtB0B,EA6B1B;AACCP,EAAAA,IAAI,EAAE,KADP;AAECK,EAAAA,IAAI,EAAEP,OAFP;AAGCI,EAAAA,KAAK,EAAEZ,EAAE,CAAE,UAAF,CAHV;AAICa,EAAAA,WAAW,EAAEb,EAAE,CAAE,kBAAF,CAJhB;AAKCc,EAAAA,UAAU,EAAE;AAAEE,IAAAA,IAAI,EAAE,KAAR;AAAeC,IAAAA,IAAI,EAAE;AAArB;AALb,CA7B0B,CAA3B;AAsCA;AACA;AACA;AACA;AACA;;AACAR,kBAAkB,CAACS,OAAnB,CAA8BC,SAAF,IAAiB;AAC5C,MAAKA,SAAS,CAACC,QAAf,EAA0B;;AAC1BD,EAAAA,SAAS,CAACC,QAAV,GAAqB,CAAEC,eAAF,EAAmBC,mBAAnB,KACpBD,eAAe,CAACL,IAAhB,KAAyBM,mBAAmB,CAACN,IAD9C;AAEA,CAJD;AAMA,eAAeP,kBAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tcategory as categoryIcon,\n\tpage as pageIcon,\n\tpostContent as postIcon,\n\ttag as tagIcon,\n} from '@wordpress/icons';\n\n// FALLBACK: this is only used when the server does not understand the variations property in the\n// register_block_type call. see navigation-link/index.php.\n// Delete this file when supported WP ranges understand the `variations` property when passed to\n// register_block_type in index.php.\nconst fallbackVariations = [\n\t{\n\t\tname: 'link',\n\t\tisDefault: true,\n\t\ttitle: __( 'Custom Link' ),\n\t\tdescription: __( 'A link to a custom URL.' ),\n\t\tattributes: {},\n\t},\n\t{\n\t\tname: 'post',\n\t\ticon: postIcon,\n\t\ttitle: __( 'Post Link' ),\n\t\tdescription: __( 'A link to a post.' ),\n\t\tattributes: { type: 'post', kind: 'post-type' },\n\t},\n\t{\n\t\tname: 'page',\n\t\ticon: pageIcon,\n\t\ttitle: __( 'Page Link' ),\n\t\tdescription: __( 'A link to a page.' ),\n\t\tattributes: { type: 'page', kind: 'post-type' },\n\t},\n\t{\n\t\tname: 'category',\n\t\ticon: categoryIcon,\n\t\ttitle: __( 'Category Link' ),\n\t\tdescription: __( 'A link to a category.' ),\n\t\tattributes: { type: 'category', kind: 'taxonomy' },\n\t},\n\t{\n\t\tname: 'tag',\n\t\ticon: tagIcon,\n\t\ttitle: __( 'Tag Link' ),\n\t\tdescription: __( 'A link to a tag.' ),\n\t\tattributes: { type: 'tag', kind: 'taxonomy' },\n\t},\n];\n\n/**\n * Add `isActive` function to all `navigation link` variations, if not defined.\n * `isActive` function is used to find a variation match from a created\n * Block by providing its attributes.\n */\nfallbackVariations.forEach( ( variation ) => {\n\tif ( variation.isActive ) return;\n\tvariation.isActive = ( blockAttributes, variationAttributes ) =>\n\t\tblockAttributes.type === variationAttributes.type;\n} );\n\nexport default fallbackVariations;\n"]}
|
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
import { createElement, Fragment } from "@wordpress/element";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* External dependencies
|
|
5
|
-
*/
|
|
6
|
-
import classnames from 'classnames';
|
|
7
|
-
/**
|
|
8
|
-
* WordPress dependencies
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import { AlignmentControl, BlockControls, Warning, useBlockProps, store as blockEditorStore } from '@wordpress/block-editor';
|
|
12
|
-
import { __, sprintf } from '@wordpress/i18n';
|
|
13
|
-
import { useSelect } from '@wordpress/data';
|
|
14
|
-
import { useEntityProp, store as coreStore } from '@wordpress/core-data';
|
|
15
|
-
import { useDisabled } from '@wordpress/compose';
|
|
16
|
-
import { createInterpolateElement } from '@wordpress/element';
|
|
17
|
-
/**
|
|
18
|
-
* Internal dependencies
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
import CommentsForm from '../post-comments-form/form';
|
|
22
|
-
export default function PostCommentsEdit(_ref) {
|
|
23
|
-
let {
|
|
24
|
-
attributes: {
|
|
25
|
-
textAlign
|
|
26
|
-
},
|
|
27
|
-
setAttributes,
|
|
28
|
-
context: {
|
|
29
|
-
postType,
|
|
30
|
-
postId
|
|
31
|
-
}
|
|
32
|
-
} = _ref;
|
|
33
|
-
let [postTitle] = useEntityProp('postType', postType, 'title', postId);
|
|
34
|
-
postTitle = postTitle || __('Post Title');
|
|
35
|
-
const [commentStatus] = useEntityProp('postType', postType, 'comment_status', postId);
|
|
36
|
-
const {
|
|
37
|
-
avatarURL,
|
|
38
|
-
defaultCommentStatus
|
|
39
|
-
} = useSelect(select => select(blockEditorStore).getSettings().__experimentalDiscussionSettings);
|
|
40
|
-
const isSiteEditor = postType === undefined || postId === undefined;
|
|
41
|
-
const postTypeSupportsComments = useSelect(select => {
|
|
42
|
-
var _select$getPostType;
|
|
43
|
-
|
|
44
|
-
return postType ? !!((_select$getPostType = select(coreStore).getPostType(postType)) !== null && _select$getPostType !== void 0 && _select$getPostType.supports.comments) : false;
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
let warning = __('Post Comments block: This is just a placeholder, not a real comment. The final styling may differ because it also depends on the current theme. For better compatibility with the Block Editor, please consider replacing this block with the "Comments" block.');
|
|
48
|
-
|
|
49
|
-
let showPlaceholder = true;
|
|
50
|
-
|
|
51
|
-
if (!isSiteEditor && 'open' !== commentStatus) {
|
|
52
|
-
if ('closed' === commentStatus) {
|
|
53
|
-
warning = sprintf(
|
|
54
|
-
/* translators: 1: Post type (i.e. "post", "page") */
|
|
55
|
-
__('Post Comments block: Comments to this %s are not allowed.'), postType);
|
|
56
|
-
showPlaceholder = false;
|
|
57
|
-
} else if (!postTypeSupportsComments) {
|
|
58
|
-
warning = sprintf(
|
|
59
|
-
/* translators: 1: Post type (i.e. "post", "page") */
|
|
60
|
-
__('Post Comments block: Comments for this post type (%s) are not enabled.'), postType);
|
|
61
|
-
showPlaceholder = false;
|
|
62
|
-
} else if ('open' !== defaultCommentStatus) {
|
|
63
|
-
warning = __('Post Comments block: Comments are not enabled.');
|
|
64
|
-
showPlaceholder = false;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
const blockProps = useBlockProps({
|
|
69
|
-
className: classnames({
|
|
70
|
-
[`has-text-align-${textAlign}`]: textAlign
|
|
71
|
-
})
|
|
72
|
-
});
|
|
73
|
-
const disabledRef = useDisabled();
|
|
74
|
-
return createElement(Fragment, null, createElement(BlockControls, {
|
|
75
|
-
group: "block"
|
|
76
|
-
}, createElement(AlignmentControl, {
|
|
77
|
-
value: textAlign,
|
|
78
|
-
onChange: nextAlign => {
|
|
79
|
-
setAttributes({
|
|
80
|
-
textAlign: nextAlign
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
})), createElement("div", blockProps, createElement(Warning, null, warning), showPlaceholder && createElement("div", {
|
|
84
|
-
className: "wp-block-post-comments__placeholder",
|
|
85
|
-
ref: disabledRef
|
|
86
|
-
}, createElement("h3", null,
|
|
87
|
-
/* translators: %s: Post title. */
|
|
88
|
-
sprintf(__('One response to %s'), postTitle)), createElement("div", {
|
|
89
|
-
className: "navigation"
|
|
90
|
-
}, createElement("div", {
|
|
91
|
-
className: "alignleft"
|
|
92
|
-
}, createElement("a", {
|
|
93
|
-
href: "#top"
|
|
94
|
-
}, "\xAB ", __('Older Comments'))), createElement("div", {
|
|
95
|
-
className: "alignright"
|
|
96
|
-
}, createElement("a", {
|
|
97
|
-
href: "#top"
|
|
98
|
-
}, __('Newer Comments'), " \xBB"))), createElement("ol", {
|
|
99
|
-
className: "commentlist"
|
|
100
|
-
}, createElement("li", {
|
|
101
|
-
className: "comment even thread-even depth-1"
|
|
102
|
-
}, createElement("article", {
|
|
103
|
-
className: "comment-body"
|
|
104
|
-
}, createElement("footer", {
|
|
105
|
-
className: "comment-meta"
|
|
106
|
-
}, createElement("div", {
|
|
107
|
-
className: "comment-author vcard"
|
|
108
|
-
}, createElement("img", {
|
|
109
|
-
alt: "Commenter Avatar",
|
|
110
|
-
src: avatarURL,
|
|
111
|
-
className: "avatar avatar-32 photo",
|
|
112
|
-
height: "32",
|
|
113
|
-
width: "32",
|
|
114
|
-
loading: "lazy"
|
|
115
|
-
}), createInterpolateElement(sprintf(
|
|
116
|
-
/* translators: %s: Comment author link. */
|
|
117
|
-
__('%s <span>says:</span>'), sprintf('<cite><a>%s</a></cite>', __('A WordPress Commenter'))), {
|
|
118
|
-
span: createElement("span", {
|
|
119
|
-
className: "says"
|
|
120
|
-
}),
|
|
121
|
-
a:
|
|
122
|
-
/* eslint-disable jsx-a11y/anchor-has-content */
|
|
123
|
-
createElement("a", {
|
|
124
|
-
href: "#top",
|
|
125
|
-
className: "url"
|
|
126
|
-
})
|
|
127
|
-
/* eslint-enable jsx-a11y/anchor-has-content */
|
|
128
|
-
,
|
|
129
|
-
cite: createElement("cite", {
|
|
130
|
-
className: "fn"
|
|
131
|
-
})
|
|
132
|
-
})), createElement("div", {
|
|
133
|
-
className: "comment-metadata"
|
|
134
|
-
}, createElement("a", {
|
|
135
|
-
href: "#top"
|
|
136
|
-
}, createElement("time", {
|
|
137
|
-
dateTime: "2000-01-01T12:00:00+00:00"
|
|
138
|
-
}, __('January 1, 2000 at 12:00 am'))), ' ', createElement("span", {
|
|
139
|
-
className: "edit-link"
|
|
140
|
-
}, createElement("a", {
|
|
141
|
-
className: "comment-edit-link",
|
|
142
|
-
href: "#top"
|
|
143
|
-
}, __('Edit'))))), createElement("div", {
|
|
144
|
-
className: "comment-content"
|
|
145
|
-
}, createElement("p", null, __('Hi, this is a comment.'), createElement("br", null), __('To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard.'), createElement("br", null), createInterpolateElement(__('Commenter avatars come from <a>Gravatar</a>'), {
|
|
146
|
-
a:
|
|
147
|
-
/* eslint-disable-next-line jsx-a11y/anchor-has-content */
|
|
148
|
-
createElement("a", {
|
|
149
|
-
href: "https://gravatar.com/"
|
|
150
|
-
})
|
|
151
|
-
}))), createElement("div", {
|
|
152
|
-
className: "reply"
|
|
153
|
-
}, createElement("a", {
|
|
154
|
-
className: "comment-reply-link",
|
|
155
|
-
href: "#top",
|
|
156
|
-
"aria-label": sprintf(
|
|
157
|
-
/* translators: Comment reply button text. %s: Comment author name. */
|
|
158
|
-
__('Reply to %s'), __('A WordPress Commenter'))
|
|
159
|
-
}, __('Reply')))))), createElement("div", {
|
|
160
|
-
className: "navigation"
|
|
161
|
-
}, createElement("div", {
|
|
162
|
-
className: "alignleft"
|
|
163
|
-
}, createElement("a", {
|
|
164
|
-
href: "#top"
|
|
165
|
-
}, "\xAB ", __('Older Comments'))), createElement("div", {
|
|
166
|
-
className: "alignright"
|
|
167
|
-
}, createElement("a", {
|
|
168
|
-
href: "#top"
|
|
169
|
-
}, __('Newer Comments'), " \xBB"))), createElement(CommentsForm, null))));
|
|
170
|
-
}
|
|
171
|
-
//# sourceMappingURL=edit.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/post-comments/edit.js"],"names":["classnames","AlignmentControl","BlockControls","Warning","useBlockProps","store","blockEditorStore","__","sprintf","useSelect","useEntityProp","coreStore","useDisabled","createInterpolateElement","CommentsForm","PostCommentsEdit","attributes","textAlign","setAttributes","context","postType","postId","postTitle","commentStatus","avatarURL","defaultCommentStatus","select","getSettings","__experimentalDiscussionSettings","isSiteEditor","undefined","postTypeSupportsComments","getPostType","supports","comments","warning","showPlaceholder","blockProps","className","disabledRef","nextAlign","span","a","cite"],"mappings":"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","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tWarning,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { useEntityProp, store as coreStore } from '@wordpress/core-data';\nimport { useDisabled } from '@wordpress/compose';\nimport { createInterpolateElement } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport CommentsForm from '../post-comments-form/form';\n\nexport default function PostCommentsEdit( {\n\tattributes: { textAlign },\n\tsetAttributes,\n\tcontext: { postType, postId },\n} ) {\n\tlet [ postTitle ] = useEntityProp( 'postType', postType, 'title', postId );\n\tpostTitle = postTitle || __( 'Post Title' );\n\n\tconst [ commentStatus ] = useEntityProp(\n\t\t'postType',\n\t\tpostType,\n\t\t'comment_status',\n\t\tpostId\n\t);\n\n\tconst { avatarURL, defaultCommentStatus } = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getSettings()\n\t\t\t\t.__experimentalDiscussionSettings\n\t);\n\n\tconst isSiteEditor = postType === undefined || postId === undefined;\n\n\tconst postTypeSupportsComments = useSelect( ( select ) =>\n\t\tpostType\n\t\t\t? !! select( coreStore ).getPostType( postType )?.supports.comments\n\t\t\t: false\n\t);\n\n\tlet warning = __(\n\t\t'Post Comments block: This is just a placeholder, not a real comment. The final styling may differ because it also depends on the current theme. For better compatibility with the Block Editor, please consider replacing this block with the \"Comments\" block.'\n\t);\n\tlet showPlaceholder = true;\n\n\tif ( ! isSiteEditor && 'open' !== commentStatus ) {\n\t\tif ( 'closed' === commentStatus ) {\n\t\t\twarning = sprintf(\n\t\t\t\t/* translators: 1: Post type (i.e. \"post\", \"page\") */\n\t\t\t\t__(\n\t\t\t\t\t'Post Comments block: Comments to this %s are not allowed.'\n\t\t\t\t),\n\t\t\t\tpostType\n\t\t\t);\n\t\t\tshowPlaceholder = false;\n\t\t} else if ( ! postTypeSupportsComments ) {\n\t\t\twarning = sprintf(\n\t\t\t\t/* translators: 1: Post type (i.e. \"post\", \"page\") */\n\t\t\t\t__(\n\t\t\t\t\t'Post Comments block: Comments for this post type (%s) are not enabled.'\n\t\t\t\t),\n\t\t\t\tpostType\n\t\t\t);\n\t\t\tshowPlaceholder = false;\n\t\t} else if ( 'open' !== defaultCommentStatus ) {\n\t\t\twarning = __( 'Post Comments block: Comments are not enabled.' );\n\t\t\tshowPlaceholder = false;\n\t\t}\n\t}\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classnames( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t} );\n\n\tconst disabledRef = useDisabled();\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\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<Warning>{ warning }</Warning>\n\n\t\t\t\t{ showPlaceholder && (\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName=\"wp-block-post-comments__placeholder\"\n\t\t\t\t\t\tref={ disabledRef }\n\t\t\t\t\t>\n\t\t\t\t\t\t<h3>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t/* translators: %s: Post title. */\n\t\t\t\t\t\t\t\tsprintf( __( 'One response to %s' ), postTitle )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</h3>\n\n\t\t\t\t\t\t<div className=\"navigation\">\n\t\t\t\t\t\t\t<div className=\"alignleft\">\n\t\t\t\t\t\t\t\t<a href=\"#top\">« { __( 'Older Comments' ) }</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div className=\"alignright\">\n\t\t\t\t\t\t\t\t<a href=\"#top\">{ __( 'Newer Comments' ) } »</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t<ol className=\"commentlist\">\n\t\t\t\t\t\t\t<li className=\"comment even thread-even depth-1\">\n\t\t\t\t\t\t\t\t<article className=\"comment-body\">\n\t\t\t\t\t\t\t\t\t<footer className=\"comment-meta\">\n\t\t\t\t\t\t\t\t\t\t<div className=\"comment-author vcard\">\n\t\t\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\t\t\talt=\"Commenter Avatar\"\n\t\t\t\t\t\t\t\t\t\t\t\tsrc={ avatarURL }\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"avatar avatar-32 photo\"\n\t\t\t\t\t\t\t\t\t\t\t\theight=\"32\"\n\t\t\t\t\t\t\t\t\t\t\t\twidth=\"32\"\n\t\t\t\t\t\t\t\t\t\t\t\tloading=\"lazy\"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: Comment author link. */\n\t\t\t\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'%s <span>says:</span>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'<cite><a>%s</a></cite>',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'A WordPress Commenter'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\tspan: (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span className=\"says\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\ta: (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/* eslint-disable jsx-a11y/anchor-has-content */\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thref=\"#top\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"url\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/* eslint-enable jsx-a11y/anchor-has-content */\n\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\tcite: (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<cite className=\"fn\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t\t<div className=\"comment-metadata\">\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"#top\">\n\t\t\t\t\t\t\t\t\t\t\t\t<time dateTime=\"2000-01-01T12:00:00+00:00\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'January 1, 2000 at 12:00 am'\n\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t</time>\n\t\t\t\t\t\t\t\t\t\t\t</a>{ ' ' }\n\t\t\t\t\t\t\t\t\t\t\t<span className=\"edit-link\">\n\t\t\t\t\t\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"comment-edit-link\"\n\t\t\t\t\t\t\t\t\t\t\t\t\thref=\"#top\"\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'Edit' ) }\n\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</footer>\n\n\t\t\t\t\t\t\t\t\t<div className=\"comment-content\">\n\t\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Hi, this is a comment.' ) }\n\t\t\t\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard.'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'Commenter avatars come from <a>Gravatar</a>'\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\ta: (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/* eslint-disable-next-line jsx-a11y/anchor-has-content */\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"https://gravatar.com/\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t<div className=\"reply\">\n\t\t\t\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"comment-reply-link\"\n\t\t\t\t\t\t\t\t\t\t\thref=\"#top\"\n\t\t\t\t\t\t\t\t\t\t\taria-label={ sprintf(\n\t\t\t\t\t\t\t\t\t\t\t\t/* translators: Comment reply button text. %s: Comment author name. */\n\t\t\t\t\t\t\t\t\t\t\t\t__( 'Reply to %s' ),\n\t\t\t\t\t\t\t\t\t\t\t\t__( 'A WordPress Commenter' )\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Reply' ) }\n\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</article>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t</ol>\n\n\t\t\t\t\t\t<div className=\"navigation\">\n\t\t\t\t\t\t\t<div className=\"alignleft\">\n\t\t\t\t\t\t\t\t<a href=\"#top\">« { __( 'Older Comments' ) }</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div className=\"alignright\">\n\t\t\t\t\t\t\t\t<a href=\"#top\">{ __( 'Newer Comments' ) } »</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t<CommentsForm />\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"]}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { postComments as icon } from '@wordpress/icons';
|
|
5
|
-
/**
|
|
6
|
-
* Internal dependencies
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
const metadata = {
|
|
10
|
-
$schema: "https://schemas.wp.org/trunk/block.json",
|
|
11
|
-
apiVersion: 2,
|
|
12
|
-
name: "core/post-comments",
|
|
13
|
-
title: "Post Comments (deprecated)",
|
|
14
|
-
category: "theme",
|
|
15
|
-
description: "This block is deprecated. Please use the Comments block instead.",
|
|
16
|
-
textdomain: "default",
|
|
17
|
-
attributes: {
|
|
18
|
-
textAlign: {
|
|
19
|
-
type: "string"
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
usesContext: ["postId", "postType"],
|
|
23
|
-
supports: {
|
|
24
|
-
html: false,
|
|
25
|
-
align: ["wide", "full"],
|
|
26
|
-
typography: {
|
|
27
|
-
fontSize: true,
|
|
28
|
-
lineHeight: true,
|
|
29
|
-
__experimentalFontStyle: true,
|
|
30
|
-
__experimentalFontWeight: true,
|
|
31
|
-
__experimentalLetterSpacing: true,
|
|
32
|
-
__experimentalTextTransform: true,
|
|
33
|
-
__experimentalDefaultControls: {
|
|
34
|
-
fontSize: true
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
color: {
|
|
38
|
-
gradients: true,
|
|
39
|
-
link: true,
|
|
40
|
-
__experimentalDefaultControls: {
|
|
41
|
-
background: true,
|
|
42
|
-
text: true
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
inserter: false
|
|
46
|
-
},
|
|
47
|
-
style: ["wp-block-post-comments", "wp-block-buttons", "wp-block-button"],
|
|
48
|
-
editorStyle: "wp-block-post-comments-editor"
|
|
49
|
-
};
|
|
50
|
-
import edit from './edit';
|
|
51
|
-
const {
|
|
52
|
-
name
|
|
53
|
-
} = metadata;
|
|
54
|
-
export { metadata, name };
|
|
55
|
-
export const settings = {
|
|
56
|
-
icon,
|
|
57
|
-
edit
|
|
58
|
-
};
|
|
59
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/post-comments/index.js"],"names":["postComments","icon","edit","name","metadata","settings"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,YAAY,IAAIC,IAAzB,QAAqC,kBAArC;AAEA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAOC,IAAP,MAAiB,QAAjB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAWC,QAAjB;AACA,SAASA,QAAT,EAAmBD,IAAnB;AAEA,OAAO,MAAME,QAAQ,GAAG;AACvBJ,EAAAA,IADuB;AAEvBC,EAAAA;AAFuB,CAAjB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { postComments as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\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"]}
|