@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
package/build/quote/edit.js
CHANGED
|
@@ -9,6 +9,8 @@ exports.default = QuoteEdit;
|
|
|
9
9
|
|
|
10
10
|
var _element = require("@wordpress/element");
|
|
11
11
|
|
|
12
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
+
|
|
12
14
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
15
|
|
|
14
16
|
var _i18n = require("@wordpress/i18n");
|
|
@@ -17,8 +19,14 @@ var _blockEditor = require("@wordpress/block-editor");
|
|
|
17
19
|
|
|
18
20
|
var _components = require("@wordpress/components");
|
|
19
21
|
|
|
22
|
+
var _data = require("@wordpress/data");
|
|
23
|
+
|
|
20
24
|
var _blocks = require("@wordpress/blocks");
|
|
21
25
|
|
|
26
|
+
var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
|
|
27
|
+
|
|
28
|
+
var _deprecated2 = require("./deprecated");
|
|
29
|
+
|
|
22
30
|
/**
|
|
23
31
|
* External dependencies
|
|
24
32
|
*/
|
|
@@ -26,29 +34,79 @@ var _blocks = require("@wordpress/blocks");
|
|
|
26
34
|
/**
|
|
27
35
|
* WordPress dependencies
|
|
28
36
|
*/
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Internal dependencies
|
|
40
|
+
*/
|
|
29
41
|
const isWebPlatform = _element.Platform.OS === 'web';
|
|
42
|
+
const TEMPLATE = [['core/paragraph', {}]];
|
|
43
|
+
/**
|
|
44
|
+
* At the moment, deprecations don't handle create blocks from attributes
|
|
45
|
+
* (like when using CPT templates). For this reason, this hook is necessary
|
|
46
|
+
* to avoid breaking templates using the old quote block format.
|
|
47
|
+
*
|
|
48
|
+
* @param {Object} attributes Block attributes.
|
|
49
|
+
* @param {string} clientId Block client ID.
|
|
50
|
+
*/
|
|
51
|
+
|
|
52
|
+
const useMigrateOnLoad = (attributes, clientId) => {
|
|
53
|
+
const registry = (0, _data.useRegistry)();
|
|
54
|
+
const {
|
|
55
|
+
updateBlockAttributes,
|
|
56
|
+
replaceInnerBlocks
|
|
57
|
+
} = (0, _data.useDispatch)(_blockEditor.store);
|
|
58
|
+
(0, _element.useEffect)(() => {
|
|
59
|
+
// As soon as the block is loaded, migrate it to the new version.
|
|
60
|
+
if (!attributes.value) {
|
|
61
|
+
// No need to migrate if it doesn't have the value attribute.
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const [newAttributes, newInnerBlocks] = (0, _deprecated2.migrateToQuoteV2)(attributes);
|
|
66
|
+
(0, _deprecated.default)('Value attribute on the quote block', {
|
|
67
|
+
since: '6.0',
|
|
68
|
+
version: '6.5',
|
|
69
|
+
alternative: 'inner blocks'
|
|
70
|
+
});
|
|
71
|
+
registry.batch(() => {
|
|
72
|
+
updateBlockAttributes(clientId, newAttributes);
|
|
73
|
+
replaceInnerBlocks(clientId, newInnerBlocks);
|
|
74
|
+
});
|
|
75
|
+
}, [attributes.value]);
|
|
76
|
+
};
|
|
30
77
|
|
|
31
78
|
function QuoteEdit(_ref) {
|
|
32
79
|
let {
|
|
33
80
|
attributes,
|
|
34
81
|
setAttributes,
|
|
35
|
-
isSelected,
|
|
36
|
-
mergeBlocks,
|
|
37
|
-
onReplace,
|
|
38
|
-
className,
|
|
39
82
|
insertBlocksAfter,
|
|
83
|
+
clientId,
|
|
84
|
+
className,
|
|
40
85
|
style
|
|
41
86
|
} = _ref;
|
|
42
87
|
const {
|
|
43
88
|
align,
|
|
44
|
-
value,
|
|
45
89
|
citation
|
|
46
90
|
} = attributes;
|
|
91
|
+
useMigrateOnLoad(attributes, clientId);
|
|
92
|
+
const hasSelection = (0, _data.useSelect)(select => {
|
|
93
|
+
const {
|
|
94
|
+
isBlockSelected,
|
|
95
|
+
hasSelectedInnerBlock
|
|
96
|
+
} = select(_blockEditor.store);
|
|
97
|
+
return hasSelectedInnerBlock(clientId) || isBlockSelected(clientId);
|
|
98
|
+
}, []);
|
|
47
99
|
const blockProps = (0, _blockEditor.useBlockProps)({
|
|
48
100
|
className: (0, _classnames.default)(className, {
|
|
49
101
|
[`has-text-align-${align}`]: align
|
|
50
102
|
}),
|
|
51
|
-
|
|
103
|
+
...(!isWebPlatform && {
|
|
104
|
+
style
|
|
105
|
+
})
|
|
106
|
+
});
|
|
107
|
+
const innerBlocksProps = (0, _blockEditor.useInnerBlocksProps)(blockProps, {
|
|
108
|
+
template: TEMPLATE,
|
|
109
|
+
templateInsertUpdatesSelection: true
|
|
52
110
|
});
|
|
53
111
|
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_blockEditor.BlockControls, {
|
|
54
112
|
group: "block"
|
|
@@ -59,48 +117,27 @@ function QuoteEdit(_ref) {
|
|
|
59
117
|
align: nextAlign
|
|
60
118
|
});
|
|
61
119
|
}
|
|
62
|
-
})), (0, _element.createElement)(_components.BlockQuotation,
|
|
63
|
-
identifier: "value",
|
|
64
|
-
multiline: true,
|
|
65
|
-
value: value,
|
|
66
|
-
onChange: nextValue => setAttributes({
|
|
67
|
-
value: nextValue
|
|
68
|
-
}),
|
|
69
|
-
onMerge: mergeBlocks,
|
|
70
|
-
onRemove: forward => {
|
|
71
|
-
const hasEmptyCitation = !citation || citation.length === 0;
|
|
72
|
-
|
|
73
|
-
if (!forward && hasEmptyCitation) {
|
|
74
|
-
onReplace([]);
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
"aria-label": (0, _i18n.__)('Quote text'),
|
|
78
|
-
placeholder: // translators: placeholder text used for the quote
|
|
79
|
-
(0, _i18n.__)('Add quote'),
|
|
80
|
-
onReplace: onReplace,
|
|
81
|
-
onSplit: piece => (0, _blocks.createBlock)('core/quote', { ...attributes,
|
|
82
|
-
value: piece
|
|
83
|
-
}),
|
|
84
|
-
__unstableOnSplitMiddle: () => (0, _blocks.createBlock)('core/paragraph'),
|
|
85
|
-
textAlign: align,
|
|
86
|
-
__unstableEmbedURLOnPaste: true
|
|
87
|
-
}), (!_blockEditor.RichText.isEmpty(citation) || isSelected) && (0, _element.createElement)(_blockEditor.RichText, {
|
|
120
|
+
})), (0, _element.createElement)(_components.BlockQuotation, innerBlocksProps, innerBlocksProps.children, (!_blockEditor.RichText.isEmpty(citation) || hasSelection) && (0, _element.createElement)(_blockEditor.RichText, (0, _extends2.default)({
|
|
88
121
|
identifier: "citation",
|
|
89
122
|
tagName: isWebPlatform ? 'cite' : undefined,
|
|
90
123
|
style: {
|
|
91
124
|
display: 'block'
|
|
92
125
|
},
|
|
93
126
|
value: citation,
|
|
94
|
-
onChange: nextCitation =>
|
|
95
|
-
|
|
96
|
-
|
|
127
|
+
onChange: nextCitation => {
|
|
128
|
+
setAttributes({
|
|
129
|
+
citation: nextCitation
|
|
130
|
+
});
|
|
131
|
+
},
|
|
97
132
|
__unstableMobileNoFocusOnMount: true,
|
|
98
|
-
"aria-label": (0, _i18n.__)('Quote citation
|
|
99
|
-
placeholder: // translators: placeholder text used for the
|
|
133
|
+
"aria-label": (0, _i18n.__)('Quote citation'),
|
|
134
|
+
placeholder: // translators: placeholder text used for the
|
|
135
|
+
// citation
|
|
100
136
|
(0, _i18n.__)('Add citation'),
|
|
101
137
|
className: "wp-block-quote__citation",
|
|
102
|
-
textAlign: align,
|
|
103
138
|
__unstableOnSplitAtEnd: () => insertBlocksAfter((0, _blocks.createBlock)((0, _blocks.getDefaultBlockName)()))
|
|
104
|
-
}
|
|
139
|
+
}, !isWebPlatform ? {
|
|
140
|
+
textAlign: align
|
|
141
|
+
} : {}))));
|
|
105
142
|
}
|
|
106
143
|
//# sourceMappingURL=edit.js.map
|
package/build/quote/edit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/quote/edit.js"],"names":["isWebPlatform","Platform","OS","
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/quote/edit.js"],"names":["isWebPlatform","Platform","OS","TEMPLATE","useMigrateOnLoad","attributes","clientId","registry","updateBlockAttributes","replaceInnerBlocks","blockEditorStore","value","newAttributes","newInnerBlocks","since","version","alternative","batch","QuoteEdit","setAttributes","insertBlocksAfter","className","style","align","citation","hasSelection","select","isBlockSelected","hasSelectedInnerBlock","blockProps","innerBlocksProps","template","templateInsertUpdatesSelection","nextAlign","children","RichText","isEmpty","undefined","display","nextCitation","textAlign"],"mappings":";;;;;;;;;AAoBA;;;;AAjBA;;AAKA;;AACA;;AAQA;;AACA;;AACA;;AAEA;;AAKA;;AA1BA;AACA;AACA;;AAGA;AACA;AACA;;AAgBA;AACA;AACA;AAGA,MAAMA,aAAa,GAAGC,kBAASC,EAAT,KAAgB,KAAtC;AAEA,MAAMC,QAAQ,GAAG,CAAE,CAAE,gBAAF,EAAoB,EAApB,CAAF,CAAjB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMC,gBAAgB,GAAG,CAAEC,UAAF,EAAcC,QAAd,KAA4B;AACpD,QAAMC,QAAQ,GAAG,wBAAjB;AACA,QAAM;AAAEC,IAAAA,qBAAF;AAAyBC,IAAAA;AAAzB,MACL,uBAAaC,kBAAb,CADD;AAEA,0BAAW,MAAM;AAChB;AAEA,QAAK,CAAEL,UAAU,CAACM,KAAlB,EAA0B;AACzB;AACA;AACA;;AAED,UAAM,CAAEC,aAAF,EAAiBC,cAAjB,IACL,mCAAkBR,UAAlB,CADD;AAGA,6BAAY,oCAAZ,EAAkD;AACjDS,MAAAA,KAAK,EAAE,KAD0C;AAEjDC,MAAAA,OAAO,EAAE,KAFwC;AAGjDC,MAAAA,WAAW,EAAE;AAHoC,KAAlD;AAMAT,IAAAA,QAAQ,CAACU,KAAT,CAAgB,MAAM;AACrBT,MAAAA,qBAAqB,CAAEF,QAAF,EAAYM,aAAZ,CAArB;AACAH,MAAAA,kBAAkB,CAAEH,QAAF,EAAYO,cAAZ,CAAlB;AACA,KAHD;AAIA,GArBD,EAqBG,CAAER,UAAU,CAACM,KAAb,CArBH;AAsBA,CA1BD;;AA4Be,SAASO,SAAT,OAOX;AAAA,MAP+B;AAClCb,IAAAA,UADkC;AAElCc,IAAAA,aAFkC;AAGlCC,IAAAA,iBAHkC;AAIlCd,IAAAA,QAJkC;AAKlCe,IAAAA,SALkC;AAMlCC,IAAAA;AANkC,GAO/B;AACH,QAAM;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,MAAsBnB,UAA5B;AAEAD,EAAAA,gBAAgB,CAAEC,UAAF,EAAcC,QAAd,CAAhB;AAEA,QAAMmB,YAAY,GAAG,qBAAaC,MAAF,IAAc;AAC7C,UAAM;AAAEC,MAAAA,eAAF;AAAmBC,MAAAA;AAAnB,QACLF,MAAM,CAAEhB,kBAAF,CADP;AAEA,WAAOkB,qBAAqB,CAAEtB,QAAF,CAArB,IAAqCqB,eAAe,CAAErB,QAAF,CAA3D;AACA,GAJoB,EAIlB,EAJkB,CAArB;AAMA,QAAMuB,UAAU,GAAG,gCAAe;AACjCR,IAAAA,SAAS,EAAE,yBAAYA,SAAZ,EAAuB;AACjC,OAAG,kBAAkBE,KAAO,EAA5B,GAAiCA;AADA,KAAvB,CADsB;AAIjC,QAAK,CAAEvB,aAAF,IAAmB;AAAEsB,MAAAA;AAAF,KAAxB;AAJiC,GAAf,CAAnB;AAMA,QAAMQ,gBAAgB,GAAG,sCAAqBD,UAArB,EAAiC;AACzDE,IAAAA,QAAQ,EAAE5B,QAD+C;AAEzD6B,IAAAA,8BAA8B,EAAE;AAFyB,GAAjC,CAAzB;AAKA,SACC,qDACC,4BAAC,0BAAD;AAAe,IAAA,KAAK,EAAC;AAArB,KACC,4BAAC,6BAAD;AACC,IAAA,KAAK,EAAGT,KADT;AAEC,IAAA,QAAQ,EAAKU,SAAF,IAAiB;AAC3Bd,MAAAA,aAAa,CAAE;AAAEI,QAAAA,KAAK,EAAEU;AAAT,OAAF,CAAb;AACA;AAJF,IADD,CADD,EASC,4BAAC,0BAAD,EAAqBH,gBAArB,EACGA,gBAAgB,CAACI,QADpB,EAEG,CAAE,CAAEC,sBAASC,OAAT,CAAkBZ,QAAlB,CAAF,IAAkCC,YAApC,KACD,4BAAC,qBAAD;AACC,IAAA,UAAU,EAAC,UADZ;AAEC,IAAA,OAAO,EAAGzB,aAAa,GAAG,MAAH,GAAYqC,SAFpC;AAGC,IAAA,KAAK,EAAG;AAAEC,MAAAA,OAAO,EAAE;AAAX,KAHT;AAIC,IAAA,KAAK,EAAGd,QAJT;AAKC,IAAA,QAAQ,EAAKe,YAAF,IAAoB;AAC9BpB,MAAAA,aAAa,CAAE;AACdK,QAAAA,QAAQ,EAAEe;AADI,OAAF,CAAb;AAGA,KATF;AAUC,IAAA,8BAA8B,MAV/B;AAWC,kBAAa,cAAI,gBAAJ,CAXd;AAYC,IAAA,WAAW,EACV;AACA;AACA,kBAAI,cAAJ,CAfF;AAiBC,IAAA,SAAS,EAAC,0BAjBX;AAkBC,IAAA,sBAAsB,EAAG,MACxBnB,iBAAiB,CAChB,yBAAa,kCAAb,CADgB;AAnBnB,KAuBQ,CAAEpB,aAAF,GAAkB;AAAEwC,IAAAA,SAAS,EAAEjB;AAAb,GAAlB,GAAyC,EAvBjD,EAHF,CATD,CADD;AA0CA","sourcesContent":["/**\n * External dependencies\n */\nimport classNames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tRichText,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { BlockQuotation } from '@wordpress/components';\nimport { useDispatch, useSelect, useRegistry } from '@wordpress/data';\nimport { createBlock, getDefaultBlockName } from '@wordpress/blocks';\nimport { Platform, useEffect } from '@wordpress/element';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { migrateToQuoteV2 } from './deprecated';\n\nconst isWebPlatform = Platform.OS === 'web';\n\nconst TEMPLATE = [ [ 'core/paragraph', {} ] ];\n\n/**\n * At the moment, deprecations don't handle create blocks from attributes\n * (like when using CPT templates). For this reason, this hook is necessary\n * to avoid breaking templates using the old quote block format.\n *\n * @param {Object} attributes Block attributes.\n * @param {string} clientId Block client ID.\n */\nconst useMigrateOnLoad = ( attributes, clientId ) => {\n\tconst registry = useRegistry();\n\tconst { updateBlockAttributes, replaceInnerBlocks } =\n\t\tuseDispatch( blockEditorStore );\n\tuseEffect( () => {\n\t\t// As soon as the block is loaded, migrate it to the new version.\n\n\t\tif ( ! attributes.value ) {\n\t\t\t// No need to migrate if it doesn't have the value attribute.\n\t\t\treturn;\n\t\t}\n\n\t\tconst [ newAttributes, newInnerBlocks ] =\n\t\t\tmigrateToQuoteV2( attributes );\n\n\t\tdeprecated( 'Value attribute on the quote block', {\n\t\t\tsince: '6.0',\n\t\t\tversion: '6.5',\n\t\t\talternative: 'inner blocks',\n\t\t} );\n\n\t\tregistry.batch( () => {\n\t\t\tupdateBlockAttributes( clientId, newAttributes );\n\t\t\treplaceInnerBlocks( clientId, newInnerBlocks );\n\t\t} );\n\t}, [ attributes.value ] );\n};\n\nexport default function QuoteEdit( {\n\tattributes,\n\tsetAttributes,\n\tinsertBlocksAfter,\n\tclientId,\n\tclassName,\n\tstyle,\n} ) {\n\tconst { align, citation } = attributes;\n\n\tuseMigrateOnLoad( attributes, clientId );\n\n\tconst hasSelection = useSelect( ( select ) => {\n\t\tconst { isBlockSelected, hasSelectedInnerBlock } =\n\t\t\tselect( blockEditorStore );\n\t\treturn hasSelectedInnerBlock( clientId ) || isBlockSelected( clientId );\n\t}, [] );\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classNames( className, {\n\t\t\t[ `has-text-align-${ align }` ]: align,\n\t\t} ),\n\t\t...( ! isWebPlatform && { style } ),\n\t} );\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\ttemplate: TEMPLATE,\n\t\ttemplateInsertUpdatesSelection: true,\n\t} );\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t<AlignmentControl\n\t\t\t\t\tvalue={ align }\n\t\t\t\t\tonChange={ ( nextAlign ) => {\n\t\t\t\t\t\tsetAttributes( { align: nextAlign } );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t\t<BlockQuotation { ...innerBlocksProps }>\n\t\t\t\t{ innerBlocksProps.children }\n\t\t\t\t{ ( ! RichText.isEmpty( citation ) || hasSelection ) && (\n\t\t\t\t\t<RichText\n\t\t\t\t\t\tidentifier=\"citation\"\n\t\t\t\t\t\ttagName={ isWebPlatform ? 'cite' : undefined }\n\t\t\t\t\t\tstyle={ { display: 'block' } }\n\t\t\t\t\t\tvalue={ citation }\n\t\t\t\t\t\tonChange={ ( nextCitation ) => {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tcitation: nextCitation,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\t__unstableMobileNoFocusOnMount\n\t\t\t\t\t\taria-label={ __( 'Quote citation' ) }\n\t\t\t\t\t\tplaceholder={\n\t\t\t\t\t\t\t// translators: placeholder text used for the\n\t\t\t\t\t\t\t// citation\n\t\t\t\t\t\t\t__( 'Add citation' )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclassName=\"wp-block-quote__citation\"\n\t\t\t\t\t\t__unstableOnSplitAtEnd={ () =>\n\t\t\t\t\t\t\tinsertBlocksAfter(\n\t\t\t\t\t\t\t\tcreateBlock( getDefaultBlockName() )\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t{ ...( ! isWebPlatform ? { textAlign: align } : {} ) }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</BlockQuotation>\n\t\t</>\n\t);\n}\n"]}
|
package/build/quote/index.js
CHANGED
|
@@ -5,13 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
9
|
-
Object.defineProperty(exports, "settingsV2", {
|
|
10
|
-
enumerable: true,
|
|
11
|
-
get: function () {
|
|
12
|
-
return _v.default;
|
|
13
|
-
}
|
|
14
|
-
});
|
|
8
|
+
exports.settings = exports.name = exports.metadata = void 0;
|
|
15
9
|
|
|
16
10
|
var _i18n = require("@wordpress/i18n");
|
|
17
11
|
|
|
@@ -25,8 +19,6 @@ var _save = _interopRequireDefault(require("./save"));
|
|
|
25
19
|
|
|
26
20
|
var _transforms = _interopRequireDefault(require("./transforms"));
|
|
27
21
|
|
|
28
|
-
var _v = _interopRequireDefault(require("./v2"));
|
|
29
|
-
|
|
30
22
|
/**
|
|
31
23
|
* WordPress dependencies
|
|
32
24
|
*/
|
|
@@ -104,51 +96,23 @@ const {
|
|
|
104
96
|
name
|
|
105
97
|
} = metadata;
|
|
106
98
|
exports.name = name;
|
|
107
|
-
const
|
|
99
|
+
const settings = {
|
|
108
100
|
icon: _icons.quote,
|
|
109
101
|
example: {
|
|
110
102
|
attributes: {
|
|
111
|
-
value: '<p>' + (0, _i18n.__)('In quoting others, we cite ourselves.') + '</p>',
|
|
112
103
|
citation: 'Julio Cortázar'
|
|
113
|
-
}
|
|
104
|
+
},
|
|
105
|
+
innerBlocks: [{
|
|
106
|
+
name: 'core/paragraph',
|
|
107
|
+
attributes: {
|
|
108
|
+
content: (0, _i18n.__)('In quoting others, we cite ourselves.')
|
|
109
|
+
}
|
|
110
|
+
}]
|
|
114
111
|
},
|
|
115
112
|
transforms: _transforms.default,
|
|
116
113
|
edit: _edit.default,
|
|
117
114
|
save: _save.default,
|
|
118
|
-
|
|
119
|
-
merge(attributes, _ref) {
|
|
120
|
-
let {
|
|
121
|
-
value,
|
|
122
|
-
citation
|
|
123
|
-
} = _ref;
|
|
124
|
-
|
|
125
|
-
// Quote citations cannot be merged. Pick the second one unless it's
|
|
126
|
-
// empty.
|
|
127
|
-
if (!citation) {
|
|
128
|
-
citation = attributes.citation;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
if (!value || value === '<p></p>') {
|
|
132
|
-
return { ...attributes,
|
|
133
|
-
citation
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
return { ...attributes,
|
|
138
|
-
value: attributes.value + value,
|
|
139
|
-
citation
|
|
140
|
-
};
|
|
141
|
-
},
|
|
142
|
-
|
|
143
115
|
deprecated: _deprecated.default
|
|
144
116
|
};
|
|
145
|
-
exports.settingsV1 = settingsV1;
|
|
146
|
-
let settings = settingsV1;
|
|
147
117
|
exports.settings = settings;
|
|
148
|
-
|
|
149
|
-
if (process.env.IS_GUTENBERG_PLUGIN) {
|
|
150
|
-
var _window;
|
|
151
|
-
|
|
152
|
-
exports.settings = settings = (_window = window) !== null && _window !== void 0 && _window.__experimentalEnableQuoteBlockV2 ? _v.default : settingsV1;
|
|
153
|
-
}
|
|
154
118
|
//# sourceMappingURL=index.js.map
|
package/build/quote/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/quote/index.js"],"names":["name","metadata","
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/quote/index.js"],"names":["name","metadata","settings","icon","example","attributes","citation","innerBlocks","content","transforms","edit","save","deprecated"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AAEA;;AACA;;AAbA;AACA;AACA;;AAIA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAIO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,IAAI,EAAJA,YADuB;AAEvBC,EAAAA,OAAO,EAAE;AACRC,IAAAA,UAAU,EAAE;AACXC,MAAAA,QAAQ,EAAE;AADC,KADJ;AAIRC,IAAAA,WAAW,EAAE,CACZ;AACCP,MAAAA,IAAI,EAAE,gBADP;AAECK,MAAAA,UAAU,EAAE;AACXG,QAAAA,OAAO,EAAE,cAAI,uCAAJ;AADE;AAFb,KADY;AAJL,GAFc;AAevBC,EAAAA,UAAU,EAAVA,mBAfuB;AAgBvBC,EAAAA,IAAI,EAAJA,aAhBuB;AAiBvBC,EAAAA,IAAI,EAAJA,aAjBuB;AAkBvBC,EAAAA,UAAU,EAAVA;AAlBuB,CAAjB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { quote as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tcitation: 'Julio Cortázar',\n\t\t},\n\t\tinnerBlocks: [\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcontent: __( 'In quoting others, we cite ourselves.' ),\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n\ttransforms,\n\tedit,\n\tsave,\n\tdeprecated,\n};\n"]}
|
package/build/quote/save.js
CHANGED
|
@@ -26,7 +26,6 @@ function save(_ref) {
|
|
|
26
26
|
} = _ref;
|
|
27
27
|
const {
|
|
28
28
|
align,
|
|
29
|
-
value,
|
|
30
29
|
citation
|
|
31
30
|
} = attributes;
|
|
32
31
|
const className = (0, _classnames.default)({
|
|
@@ -34,10 +33,7 @@ function save(_ref) {
|
|
|
34
33
|
});
|
|
35
34
|
return (0, _element.createElement)("blockquote", _blockEditor.useBlockProps.save({
|
|
36
35
|
className
|
|
37
|
-
}), (0, _element.createElement)(_blockEditor.RichText.Content, {
|
|
38
|
-
multiline: true,
|
|
39
|
-
value: value
|
|
40
|
-
}), !_blockEditor.RichText.isEmpty(citation) && (0, _element.createElement)(_blockEditor.RichText.Content, {
|
|
36
|
+
}), (0, _element.createElement)(_blockEditor.InnerBlocks.Content, null), !_blockEditor.RichText.isEmpty(citation) && (0, _element.createElement)(_blockEditor.RichText.Content, {
|
|
41
37
|
tagName: "cite",
|
|
42
38
|
value: citation
|
|
43
39
|
}));
|
package/build/quote/save.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/quote/save.js"],"names":["save","attributes","align","
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/quote/save.js"],"names":["save","attributes","align","citation","className","useBlockProps","RichText","isEmpty"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAGe,SAASA,IAAT,OAAgC;AAAA,MAAjB;AAAEC,IAAAA;AAAF,GAAiB;AAC9C,QAAM;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,MAAsBF,UAA5B;AAEA,QAAMG,SAAS,GAAG,yBAAY;AAC7B,KAAG,kBAAkBF,KAAO,EAA5B,GAAiCA;AADJ,GAAZ,CAAlB;AAIA,SACC,0CAAiBG,2BAAcL,IAAd,CAAoB;AAAEI,IAAAA;AAAF,GAApB,CAAjB,EACC,4BAAC,wBAAD,CAAa,OAAb,OADD,EAEG,CAAEE,sBAASC,OAAT,CAAkBJ,QAAlB,CAAF,IACD,4BAAC,qBAAD,CAAU,OAAV;AAAkB,IAAA,OAAO,EAAC,MAA1B;AAAiC,IAAA,KAAK,EAAGA;AAAzC,IAHF,CADD;AAQA","sourcesContent":["/**\n * External dependencies\n */\nimport classNames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { InnerBlocks, RichText, useBlockProps } from '@wordpress/block-editor';\n\nexport default function save( { attributes } ) {\n\tconst { align, citation } = attributes;\n\n\tconst className = classNames( {\n\t\t[ `has-text-align-${ align }` ]: align,\n\t} );\n\n\treturn (\n\t\t<blockquote { ...useBlockProps.save( { className } ) }>\n\t\t\t<InnerBlocks.Content />\n\t\t\t{ ! RichText.isEmpty( citation ) && (\n\t\t\t\t<RichText.Content tagName=\"cite\" value={ citation } />\n\t\t\t) }\n\t\t</blockquote>\n\t);\n}\n"]}
|
|
@@ -7,201 +7,153 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _blocks = require("@wordpress/blocks");
|
|
9
9
|
|
|
10
|
-
var _richText = require("@wordpress/rich-text");
|
|
11
|
-
|
|
12
10
|
/**
|
|
13
11
|
* WordPress dependencies
|
|
14
12
|
*/
|
|
15
13
|
const transforms = {
|
|
16
14
|
from: [{
|
|
17
15
|
type: 'block',
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
transform: attributes => {
|
|
21
|
-
return (0, _blocks.createBlock)('core/quote', {
|
|
22
|
-
value: (0, _richText.toHTMLString)({
|
|
23
|
-
value: (0, _richText.join)(attributes.map(_ref => {
|
|
24
|
-
let {
|
|
25
|
-
content
|
|
26
|
-
} = _ref;
|
|
27
|
-
return (0, _richText.create)({
|
|
28
|
-
html: content
|
|
29
|
-
});
|
|
30
|
-
}), '\u2028'),
|
|
31
|
-
multilineTag: 'p'
|
|
32
|
-
}),
|
|
33
|
-
anchor: attributes.anchor
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
}, {
|
|
37
|
-
type: 'block',
|
|
38
|
-
blocks: ['core/heading'],
|
|
39
|
-
transform: _ref2 => {
|
|
16
|
+
blocks: ['core/pullquote'],
|
|
17
|
+
transform: _ref => {
|
|
40
18
|
let {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
19
|
+
value,
|
|
20
|
+
citation,
|
|
21
|
+
anchor,
|
|
22
|
+
fontSize,
|
|
23
|
+
style
|
|
24
|
+
} = _ref;
|
|
44
25
|
return (0, _blocks.createBlock)('core/quote', {
|
|
45
|
-
|
|
46
|
-
anchor
|
|
47
|
-
|
|
26
|
+
citation,
|
|
27
|
+
anchor,
|
|
28
|
+
fontSize,
|
|
29
|
+
style
|
|
30
|
+
}, (0, _blocks.parseWithAttributeSchema)(value, {
|
|
31
|
+
type: 'array',
|
|
32
|
+
source: 'query',
|
|
33
|
+
selector: 'p',
|
|
34
|
+
query: {
|
|
35
|
+
content: {
|
|
36
|
+
type: 'string',
|
|
37
|
+
source: 'html'
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}).map(_ref2 => {
|
|
41
|
+
let {
|
|
42
|
+
content
|
|
43
|
+
} = _ref2;
|
|
44
|
+
return (0, _blocks.createBlock)('core/paragraph', {
|
|
45
|
+
content
|
|
46
|
+
});
|
|
47
|
+
}));
|
|
48
48
|
}
|
|
49
49
|
}, {
|
|
50
50
|
type: 'block',
|
|
51
|
-
blocks: ['core/
|
|
52
|
-
transform: _ref3 => {
|
|
51
|
+
blocks: ['core/group'],
|
|
52
|
+
transform: (_ref3, innerBlocks) => {
|
|
53
53
|
let {
|
|
54
|
-
value,
|
|
55
|
-
citation,
|
|
56
54
|
anchor
|
|
57
55
|
} = _ref3;
|
|
58
56
|
return (0, _blocks.createBlock)('core/quote', {
|
|
59
|
-
value,
|
|
60
|
-
citation,
|
|
61
57
|
anchor
|
|
62
|
-
});
|
|
58
|
+
}, innerBlocks);
|
|
63
59
|
}
|
|
64
60
|
}, {
|
|
65
61
|
type: 'prefix',
|
|
66
62
|
prefix: '>',
|
|
67
|
-
transform: content => {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
});
|
|
71
|
-
}
|
|
63
|
+
transform: content => (0, _blocks.createBlock)('core/quote', {}, [(0, _blocks.createBlock)('core/paragraph', {
|
|
64
|
+
content
|
|
65
|
+
})])
|
|
72
66
|
}, {
|
|
73
67
|
type: 'raw',
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
return child => {
|
|
78
|
-
// Child is a paragraph.
|
|
79
|
-
if (child.nodeName === 'P') {
|
|
80
|
-
return true;
|
|
81
|
-
} // Child is a cite and no other cite child exists before it.
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
if (!hasCitation && child.nodeName === 'CITE') {
|
|
85
|
-
hasCitation = true;
|
|
86
|
-
return true;
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
})();
|
|
90
|
-
|
|
91
|
-
return node.nodeName === 'BLOCKQUOTE' && // The quote block can only handle multiline paragraph
|
|
92
|
-
// content with an optional cite child.
|
|
93
|
-
Array.from(node.childNodes).every(isParagraphOrSingleCite);
|
|
94
|
-
},
|
|
95
|
-
schema: _ref4 => {
|
|
96
|
-
let {
|
|
97
|
-
phrasingContentSchema
|
|
98
|
-
} = _ref4;
|
|
99
|
-
return {
|
|
100
|
-
blockquote: {
|
|
101
|
-
children: {
|
|
102
|
-
p: {
|
|
103
|
-
children: phrasingContentSchema
|
|
104
|
-
},
|
|
105
|
-
cite: {
|
|
106
|
-
children: phrasingContentSchema
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
}],
|
|
113
|
-
to: [{
|
|
114
|
-
type: 'block',
|
|
115
|
-
blocks: ['core/paragraph'],
|
|
116
|
-
transform: _ref5 => {
|
|
117
|
-
let {
|
|
118
|
-
value,
|
|
119
|
-
citation
|
|
120
|
-
} = _ref5;
|
|
121
|
-
const paragraphs = [];
|
|
122
|
-
|
|
123
|
-
if (value && value !== '<p></p>') {
|
|
124
|
-
paragraphs.push(...(0, _richText.split)((0, _richText.create)({
|
|
125
|
-
html: value,
|
|
126
|
-
multilineTag: 'p'
|
|
127
|
-
}), '\u2028').map(piece => (0, _blocks.createBlock)('core/paragraph', {
|
|
128
|
-
content: (0, _richText.toHTMLString)({
|
|
129
|
-
value: piece
|
|
130
|
-
})
|
|
131
|
-
})));
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
if (citation && citation !== '<p></p>') {
|
|
135
|
-
paragraphs.push((0, _blocks.createBlock)('core/paragraph', {
|
|
136
|
-
content: citation
|
|
137
|
-
}));
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
if (paragraphs.length === 0) {
|
|
141
|
-
return (0, _blocks.createBlock)('core/paragraph', {
|
|
142
|
-
content: ''
|
|
143
|
-
});
|
|
68
|
+
schema: () => ({
|
|
69
|
+
blockquote: {
|
|
70
|
+
children: '*'
|
|
144
71
|
}
|
|
145
|
-
|
|
146
|
-
|
|
72
|
+
}),
|
|
73
|
+
selector: 'blockquote',
|
|
74
|
+
transform: node => {
|
|
75
|
+
return (0, _blocks.createBlock)('core/quote', // Don't try to parse any `cite` out of this content.
|
|
76
|
+
// * There may be more than one cite.
|
|
77
|
+
// * There may be more attribution text than just the cite.
|
|
78
|
+
// * If the cite is nested in the quoted text, it's wrong to
|
|
79
|
+
// remove it.
|
|
80
|
+
{}, (0, _blocks.rawHandler)({
|
|
81
|
+
HTML: node.innerHTML,
|
|
82
|
+
mode: 'BLOCKS'
|
|
83
|
+
}));
|
|
147
84
|
}
|
|
148
85
|
}, {
|
|
149
86
|
type: 'block',
|
|
150
|
-
|
|
151
|
-
|
|
87
|
+
isMultiBlock: true,
|
|
88
|
+
blocks: ['*'],
|
|
89
|
+
isMatch: (_ref4, blocks) => {
|
|
90
|
+
let {} = _ref4;
|
|
91
|
+
return !blocks.some(_ref5 => {
|
|
92
|
+
let {
|
|
93
|
+
name
|
|
94
|
+
} = _ref5;
|
|
95
|
+
return name === 'core/quote';
|
|
96
|
+
});
|
|
97
|
+
},
|
|
98
|
+
__experimentalConvert: blocks => (0, _blocks.createBlock)('core/quote', {}, blocks.map(block => (0, _blocks.createBlock)(block.name, block.attributes, block.innerBlocks)))
|
|
99
|
+
}],
|
|
100
|
+
to: [{
|
|
101
|
+
type: 'block',
|
|
102
|
+
blocks: ['core/pullquote'],
|
|
103
|
+
isMatch: (_ref6, block) => {
|
|
104
|
+
let {} = _ref6;
|
|
105
|
+
return block.innerBlocks.every(_ref7 => {
|
|
106
|
+
let {
|
|
107
|
+
name
|
|
108
|
+
} = _ref7;
|
|
109
|
+
return name === 'core/paragraph';
|
|
110
|
+
});
|
|
111
|
+
},
|
|
112
|
+
transform: (_ref8, innerBlocks) => {
|
|
152
113
|
let {
|
|
153
|
-
value,
|
|
154
114
|
citation,
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
const pieces = (0, _richText.split)((0, _richText.create)({
|
|
168
|
-
html: value,
|
|
169
|
-
multilineTag: 'p'
|
|
170
|
-
}), '\u2028');
|
|
171
|
-
const headingBlock = (0, _blocks.createBlock)('core/heading', {
|
|
172
|
-
content: (0, _richText.toHTMLString)({
|
|
173
|
-
value: pieces[0]
|
|
174
|
-
})
|
|
175
|
-
});
|
|
176
|
-
|
|
177
|
-
if (!citation && pieces.length === 1) {
|
|
178
|
-
return headingBlock;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
const quotePieces = pieces.slice(1);
|
|
182
|
-
const quoteBlock = (0, _blocks.createBlock)('core/quote', { ...attrs,
|
|
115
|
+
anchor,
|
|
116
|
+
fontSize,
|
|
117
|
+
style
|
|
118
|
+
} = _ref8;
|
|
119
|
+
const value = innerBlocks.map(_ref9 => {
|
|
120
|
+
let {
|
|
121
|
+
attributes
|
|
122
|
+
} = _ref9;
|
|
123
|
+
return `<p>${attributes.content}</p>`;
|
|
124
|
+
}).join('');
|
|
125
|
+
return (0, _blocks.createBlock)('core/pullquote', {
|
|
126
|
+
value,
|
|
183
127
|
citation,
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
})
|
|
128
|
+
anchor,
|
|
129
|
+
fontSize,
|
|
130
|
+
style
|
|
188
131
|
});
|
|
189
|
-
return [headingBlock, quoteBlock];
|
|
190
132
|
}
|
|
191
133
|
}, {
|
|
192
134
|
type: 'block',
|
|
193
|
-
blocks: ['core/
|
|
194
|
-
transform:
|
|
135
|
+
blocks: ['core/group'],
|
|
136
|
+
transform: (_ref10, innerBlocks) => {
|
|
195
137
|
let {
|
|
196
|
-
value,
|
|
197
138
|
citation,
|
|
198
139
|
anchor
|
|
199
|
-
} =
|
|
200
|
-
return (0, _blocks.createBlock)('core/
|
|
201
|
-
value,
|
|
202
|
-
citation,
|
|
140
|
+
} = _ref10;
|
|
141
|
+
return (0, _blocks.createBlock)('core/group', {
|
|
203
142
|
anchor
|
|
204
|
-
})
|
|
143
|
+
}, citation ? [...innerBlocks, (0, _blocks.createBlock)('core/paragraph', {
|
|
144
|
+
content: citation
|
|
145
|
+
})] : innerBlocks);
|
|
146
|
+
}
|
|
147
|
+
}, {
|
|
148
|
+
type: 'block',
|
|
149
|
+
blocks: ['*'],
|
|
150
|
+
transform: (_ref11, innerBlocks) => {
|
|
151
|
+
let {
|
|
152
|
+
citation
|
|
153
|
+
} = _ref11;
|
|
154
|
+
return citation ? [...innerBlocks, (0, _blocks.createBlock)('core/paragraph', {
|
|
155
|
+
content: citation
|
|
156
|
+
})] : innerBlocks;
|
|
205
157
|
}
|
|
206
158
|
}]
|
|
207
159
|
};
|