@wordpress/block-library 7.10.0 → 7.12.2-next.d6164808d3.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 +11 -1
- package/build/archives/edit.js +7 -0
- package/build/archives/edit.js.map +1 -1
- package/build/archives/index.js +9 -1
- package/build/archives/index.js.map +1 -1
- package/build/audio/index.js +4 -0
- package/build/audio/index.js.map +1 -1
- package/build/block/edit.js +4 -2
- package/build/block/edit.js.map +1 -1
- package/build/block/edit.native.js +4 -2
- package/build/block/edit.native.js.map +1 -1
- package/build/button/deprecated.js +14 -5
- package/build/button/deprecated.js.map +1 -1
- package/build/button/edit.js +2 -1
- package/build/button/edit.js.map +1 -1
- package/build/button/index.js +1 -1
- package/build/buttons/edit.js +1 -1
- package/build/buttons/edit.js.map +1 -1
- package/build/calendar/edit.js +12 -5
- package/build/calendar/edit.js.map +1 -1
- package/build/categories/edit.js +3 -1
- package/build/categories/edit.js.map +1 -1
- package/build/categories/index.js +14 -1
- package/build/categories/index.js.map +1 -1
- package/build/code/index.js +4 -2
- package/build/code/index.js.map +1 -1
- package/build/column/index.js +13 -0
- package/build/column/index.js.map +1 -1
- package/build/columns/deprecated.js +16 -5
- package/build/columns/deprecated.js.map +1 -1
- package/build/columns/edit.js +6 -2
- package/build/columns/edit.js.map +1 -1
- package/build/columns/edit.native.js +9 -4
- package/build/columns/edit.native.js.map +1 -1
- package/build/columns/index.js +13 -0
- package/build/columns/index.js.map +1 -1
- package/build/comment-author-name/index.js +5 -1
- package/build/comment-author-name/index.js.map +1 -1
- package/build/comment-content/index.js +5 -1
- package/build/comment-content/index.js.map +1 -1
- package/build/comment-date/index.js +1 -0
- package/build/comment-date/index.js.map +1 -1
- package/build/comment-edit-link/index.js +5 -1
- package/build/comment-edit-link/index.js.map +1 -1
- package/build/comment-reply-link/index.js +5 -1
- package/build/comment-reply-link/index.js.map +1 -1
- package/build/comment-template/index.js +14 -1
- package/build/comment-template/index.js.map +1 -1
- 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 -38
- 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 +19 -1
- 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 +13 -0
- package/build/comments-pagination/index.js.map +1 -1
- package/build/comments-pagination-next/index.js +4 -2
- package/build/comments-pagination-next/index.js.map +1 -1
- package/build/comments-pagination-numbers/edit.js +5 -1
- package/build/comments-pagination-numbers/edit.js.map +1 -1
- package/build/comments-pagination-numbers/index.js +14 -1
- package/build/comments-pagination-numbers/index.js.map +1 -1
- package/build/comments-pagination-previous/index.js +4 -2
- package/build/comments-pagination-previous/index.js.map +1 -1
- package/build/comments-title/deprecated.js +4 -2
- package/build/comments-title/deprecated.js.map +1 -1
- package/build/comments-title/index.js +4 -2
- package/build/comments-title/index.js.map +1 -1
- package/build/cover/deprecated.js +20 -5
- package/build/cover/deprecated.js.map +1 -1
- package/build/cover/edit/resizable-cover.js +6 -0
- package/build/cover/edit/resizable-cover.js.map +1 -1
- package/build/cover/index.js +13 -0
- package/build/cover/index.js.map +1 -1
- package/build/cover/shared.js +1 -1
- package/build/cover/shared.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/icons.js +1 -1
- package/build/embed/icons.js.map +1 -1
- package/build/gallery/deprecated.js +6 -1
- package/build/gallery/deprecated.js.map +1 -1
- package/build/gallery/edit.js +17 -4
- package/build/gallery/edit.js.map +1 -1
- package/build/gallery/index.js +5 -0
- package/build/gallery/index.js.map +1 -1
- package/build/gallery/transforms.js +20 -7
- package/build/gallery/transforms.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/utils.js +7 -6
- package/build/gallery/utils.js.map +1 -1
- package/build/group/deprecated.js +108 -12
- package/build/group/deprecated.js.map +1 -1
- package/build/group/edit.js +23 -1
- package/build/group/edit.js.map +1 -1
- package/build/group/index.js +11 -2
- package/build/group/index.js.map +1 -1
- package/build/group/transforms.js +5 -0
- package/build/group/transforms.js.map +1 -1
- package/build/group/variations.js +9 -9
- package/build/group/variations.js.map +1 -1
- package/build/heading/deprecated.js +5 -3
- package/build/heading/deprecated.js.map +1 -1
- package/build/heading/index.js +3 -1
- package/build/heading/index.js.map +1 -1
- package/build/heading/transforms.js +3 -1
- package/build/heading/transforms.js.map +1 -1
- package/build/home-link/edit.js +8 -4
- package/build/home-link/edit.js.map +1 -1
- package/build/image/deprecated.js +77 -9
- package/build/image/deprecated.js.map +1 -1
- package/build/image/edit.js +16 -2
- package/build/image/edit.js.map +1 -1
- package/build/image/edit.native.js +18 -8
- package/build/image/edit.native.js.map +1 -1
- package/build/image/image.js +27 -20
- package/build/image/image.js.map +1 -1
- package/build/image/index.js +20 -8
- package/build/image/index.js.map +1 -1
- package/build/image/save.js +8 -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 +16 -10
- package/build/index.native.js.map +1 -1
- package/build/list/index.js +6 -0
- package/build/list/index.js.map +1 -1
- package/build/list/transforms.js +4 -63
- package/build/list/transforms.js.map +1 -1
- package/build/list/v2/edit.js +16 -5
- package/build/list/v2/edit.js.map +1 -1
- package/build/list/v2/tag-name.js +31 -0
- package/build/list/v2/tag-name.js.map +1 -0
- package/build/list/v2/tag-name.native.js +32 -0
- package/build/list/v2/tag-name.native.js.map +1 -0
- package/build/list/v2/transforms.js +1 -38
- package/build/list/v2/transforms.js.map +1 -1
- package/build/list-item/edit.js +18 -10
- package/build/list-item/edit.js.map +1 -1
- package/build/list-item/edit.native.js +158 -0
- package/build/list-item/edit.native.js.map +1 -0
- package/build/list-item/hooks/index.js +12 -4
- package/build/list-item/hooks/index.js.map +1 -1
- package/build/list-item/hooks/use-copy.js +42 -0
- package/build/list-item/hooks/use-copy.js.map +1 -0
- 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 +86 -50
- package/build/list-item/hooks/use-outdent-list-item.js.map +1 -1
- package/build/list-item/icons.native.js +53 -0
- package/build/list-item/icons.native.js.map +1 -0
- package/build/list-item/list-style-type.native.js +139 -0
- package/build/list-item/list-style-type.native.js.map +1 -0
- package/build/list-item/utils.js +125 -1
- package/build/list-item/utils.js.map +1 -1
- package/build/media-text/deprecated.js +270 -17
- package/build/media-text/deprecated.js.map +1 -1
- package/build/media-text/edit.js +4 -3
- package/build/media-text/edit.js.map +1 -1
- package/build/media-text/index.js +13 -0
- package/build/media-text/index.js.map +1 -1
- package/build/media-text/media-container.js +1 -1
- package/build/media-text/media-container.js.map +1 -1
- package/build/media-text/save.js +13 -0
- package/build/media-text/save.js.map +1 -1
- package/build/more/save.js +1 -7
- package/build/more/save.js.map +1 -1
- package/build/navigation/deprecated.js +6 -1
- package/build/navigation/deprecated.js.map +1 -1
- package/build/navigation/edit/index.js +180 -154
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/navigation-menu-selector.js +11 -14
- package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build/navigation/edit/placeholder/index.js +4 -2
- package/build/navigation/edit/placeholder/index.js.map +1 -1
- package/build/navigation/edit/responsive-wrapper.js +13 -3
- package/build/navigation/edit/responsive-wrapper.js.map +1 -1
- package/build/navigation/edit/unsaved-inner-blocks.js +2 -1
- package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js +4 -7
- package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
- package/build/navigation/edit/use-create-navigation-menu.js +5 -1
- package/build/navigation/edit/use-create-navigation-menu.js.map +1 -1
- package/build/navigation/edit/use-inner-blocks.js +43 -0
- package/build/navigation/edit/use-inner-blocks.js.map +1 -0
- package/build/navigation/edit/utils.js +28 -0
- package/build/navigation/edit/utils.js.map +1 -0
- package/build/navigation/menu-items-to-blocks.js +1 -7
- package/build/navigation/menu-items-to-blocks.js.map +1 -1
- package/build/navigation/use-navigation-menu.js +15 -10
- package/build/navigation/use-navigation-menu.js.map +1 -1
- package/build/navigation-link/edit.js +11 -12
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-submenu/edit.js +6 -7
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/page-list/edit.js +15 -4
- package/build/page-list/edit.js.map +1 -1
- package/build/paragraph/deprecated.js +18 -10
- package/build/paragraph/deprecated.js.map +1 -1
- package/build/paragraph/edit.js +8 -11
- package/build/paragraph/edit.js.map +1 -1
- package/build/paragraph/index.js +5 -0
- package/build/paragraph/index.js.map +1 -1
- package/build/paragraph/transforms.js +5 -0
- package/build/paragraph/transforms.js.map +1 -1
- package/build/post-author/edit.js +5 -2
- package/build/post-author/edit.js.map +1 -1
- package/build/post-author/index.js +4 -2
- package/build/post-author/index.js.map +1 -1
- package/build/post-author-biography/edit.js +7 -1
- package/build/post-author-biography/edit.js.map +1 -1
- package/build/post-author-biography/index.js +1 -0
- package/build/post-author-biography/index.js.map +1 -1
- package/build/post-author-name/index.js +5 -1
- package/build/post-author-name/index.js.map +1 -1
- package/build/post-comments-count/edit.js +11 -1
- package/build/post-comments-count/edit.js.map +1 -1
- package/build/post-comments-count/index.js +4 -1
- package/build/post-comments-count/index.js.map +1 -1
- package/build/post-comments-form/edit.js +4 -45
- 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-comments-link/index.js +4 -2
- package/build/post-comments-link/index.js.map +1 -1
- package/build/post-content/edit.js +4 -2
- package/build/post-content/edit.js.map +1 -1
- package/build/post-date/edit.js +9 -2
- package/build/post-date/edit.js.map +1 -1
- package/build/post-date/index.js +9 -0
- package/build/post-date/index.js.map +1 -1
- package/build/post-featured-image/edit.js +43 -14
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/post-featured-image/index.js +21 -0
- package/build/post-featured-image/index.js.map +1 -1
- package/build/post-navigation-link/index.js +3 -2
- package/build/post-navigation-link/index.js.map +1 -1
- package/build/post-template/edit.js +8 -4
- package/build/post-template/edit.js.map +1 -1
- package/build/post-template/index.js +14 -1
- package/build/post-template/index.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 +5 -3
- package/build/post-terms/index.js.map +1 -1
- package/build/post-title/index.js +2 -1
- package/build/post-title/index.js.map +1 -1
- package/build/preformatted/index.js +4 -2
- package/build/preformatted/index.js.map +1 -1
- package/build/pullquote/deprecated.js +135 -25
- package/build/pullquote/deprecated.js.map +1 -1
- package/build/pullquote/edit.js +1 -1
- package/build/pullquote/edit.js.map +1 -1
- package/build/pullquote/edit.native.js +0 -1
- package/build/pullquote/edit.native.js.map +1 -1
- package/build/pullquote/index.js +13 -6
- package/build/pullquote/index.js.map +1 -1
- package/build/pullquote/save.js +2 -2
- package/build/pullquote/save.js.map +1 -1
- package/build/pullquote/transforms.js +14 -33
- package/build/pullquote/transforms.js.map +1 -1
- package/build/query/deprecated.js +10 -9
- package/build/query/deprecated.js.map +1 -1
- package/build/query/edit/index.js +19 -8
- package/build/query/edit/index.js.map +1 -1
- package/build/query/edit/inspector-controls/index.js +42 -9
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/edit/inspector-controls/taxonomy-controls.js +22 -14
- package/build/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
- package/build/query/edit/query-placeholder.js +6 -1
- package/build/query/edit/query-placeholder.js.map +1 -1
- package/build/query/utils.js +35 -9
- package/build/query/utils.js.map +1 -1
- package/build/query-no-results/edit.js +2 -2
- 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/query-title/edit.js +30 -8
- package/build/query-title/edit.js.map +1 -1
- package/build/query-title/index.js +11 -2
- package/build/query-title/index.js.map +1 -1
- package/build/query-title/variations.js +10 -0
- package/build/query-title/variations.js.map +1 -1
- package/build/quote/deprecated.js +176 -37
- 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 +96 -159
- package/build/quote/transforms.js.map +1 -1
- package/build/separator/deprecated.js +3 -4
- package/build/separator/deprecated.js.map +1 -1
- package/build/separator/edit.js +1 -1
- package/build/separator/edit.js.map +1 -1
- package/build/separator/index.js +1 -0
- package/build/separator/index.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/reddit.js +1 -1
- package/build/social-link/icons/reddit.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/social-links/edit.js +3 -1
- package/build/social-links/edit.js.map +1 -1
- package/build/spacer/index.js +7 -1
- package/build/spacer/index.js.map +1 -1
- package/build/table/index.js +4 -0
- package/build/table/index.js.map +1 -1
- package/build/table/state.js +9 -3
- package/build/table/state.js.map +1 -1
- package/build/table-of-contents/index.js +11 -1
- package/build/table-of-contents/index.js.map +1 -1
- package/build/tag-cloud/index.js +5 -1
- package/build/tag-cloud/index.js.map +1 -1
- package/build/template-part/edit/index.js +21 -10
- 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 +2 -2
- package/build/template-part/index.js.map +1 -1
- package/build/term-description/index.js +4 -0
- package/build/term-description/index.js.map +1 -1
- package/build/text-columns/edit.js +3 -1
- package/build/text-columns/edit.js.map +1 -1
- package/build/text-columns/save.js +3 -1
- package/build/text-columns/save.js.map +1 -1
- package/build/verse/index.js +1 -0
- package/build/verse/index.js.map +1 -1
- package/build/video/index.js +4 -0
- package/build/video/index.js.map +1 -1
- package/build-module/archives/edit.js +7 -0
- package/build-module/archives/edit.js.map +1 -1
- package/build-module/archives/index.js +9 -1
- package/build-module/archives/index.js.map +1 -1
- package/build-module/audio/index.js +4 -0
- package/build-module/audio/index.js.map +1 -1
- package/build-module/block/edit.js +5 -3
- package/build-module/block/edit.js.map +1 -1
- package/build-module/block/edit.native.js +5 -3
- package/build-module/block/edit.native.js.map +1 -1
- package/build-module/button/deprecated.js +14 -4
- package/build-module/button/deprecated.js.map +1 -1
- package/build-module/button/edit.js +2 -1
- package/build-module/button/edit.js.map +1 -1
- package/build-module/button/index.js +1 -1
- package/build-module/buttons/edit.js +2 -2
- package/build-module/buttons/edit.js.map +1 -1
- package/build-module/calendar/edit.js +12 -4
- package/build-module/calendar/edit.js.map +1 -1
- package/build-module/categories/edit.js +4 -2
- package/build-module/categories/edit.js.map +1 -1
- package/build-module/categories/index.js +14 -1
- package/build-module/categories/index.js.map +1 -1
- package/build-module/code/index.js +4 -2
- package/build-module/code/index.js.map +1 -1
- package/build-module/column/index.js +13 -0
- package/build-module/column/index.js.map +1 -1
- package/build-module/columns/deprecated.js +16 -4
- package/build-module/columns/deprecated.js.map +1 -1
- package/build-module/columns/edit.js +7 -3
- package/build-module/columns/edit.js.map +1 -1
- package/build-module/columns/edit.native.js +10 -5
- package/build-module/columns/edit.native.js.map +1 -1
- package/build-module/columns/index.js +13 -0
- package/build-module/columns/index.js.map +1 -1
- package/build-module/comment-author-name/index.js +5 -1
- package/build-module/comment-author-name/index.js.map +1 -1
- package/build-module/comment-content/index.js +5 -1
- package/build-module/comment-content/index.js.map +1 -1
- package/build-module/comment-date/index.js +1 -0
- package/build-module/comment-date/index.js.map +1 -1
- package/build-module/comment-edit-link/index.js +5 -1
- package/build-module/comment-edit-link/index.js.map +1 -1
- package/build-module/comment-reply-link/index.js +5 -1
- package/build-module/comment-reply-link/index.js.map +1 -1
- package/build-module/comment-template/index.js +14 -1
- package/build-module/comment-template/index.js.map +1 -1
- 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 +19 -1
- 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 +13 -0
- package/build-module/comments-pagination/index.js.map +1 -1
- package/build-module/comments-pagination-next/index.js +4 -2
- package/build-module/comments-pagination-next/index.js.map +1 -1
- package/build-module/comments-pagination-numbers/edit.js +5 -1
- package/build-module/comments-pagination-numbers/edit.js.map +1 -1
- package/build-module/comments-pagination-numbers/index.js +14 -1
- package/build-module/comments-pagination-numbers/index.js.map +1 -1
- package/build-module/comments-pagination-previous/index.js +4 -2
- package/build-module/comments-pagination-previous/index.js.map +1 -1
- package/build-module/comments-title/deprecated.js +4 -2
- package/build-module/comments-title/deprecated.js.map +1 -1
- package/build-module/comments-title/index.js +4 -2
- package/build-module/comments-title/index.js.map +1 -1
- package/build-module/cover/deprecated.js +20 -4
- package/build-module/cover/deprecated.js.map +1 -1
- package/build-module/cover/edit/resizable-cover.js +6 -0
- package/build-module/cover/edit/resizable-cover.js.map +1 -1
- package/build-module/cover/index.js +13 -0
- package/build-module/cover/index.js.map +1 -1
- package/build-module/cover/shared.js +1 -1
- package/build-module/cover/shared.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/icons.js +1 -1
- package/build-module/embed/icons.js.map +1 -1
- package/build-module/gallery/deprecated.js +7 -2
- package/build-module/gallery/deprecated.js.map +1 -1
- package/build-module/gallery/edit.js +17 -4
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/gallery/index.js +5 -0
- package/build-module/gallery/index.js.map +1 -1
- package/build-module/gallery/transforms.js +20 -7
- package/build-module/gallery/transforms.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/utils.js +7 -6
- package/build-module/gallery/utils.js.map +1 -1
- package/build-module/group/deprecated.js +109 -12
- package/build-module/group/deprecated.js.map +1 -1
- package/build-module/group/edit.js +25 -2
- package/build-module/group/edit.js.map +1 -1
- package/build-module/group/index.js +11 -2
- package/build-module/group/index.js.map +1 -1
- package/build-module/group/transforms.js +5 -0
- package/build-module/group/transforms.js.map +1 -1
- package/build-module/group/variations.js +10 -10
- package/build-module/group/variations.js.map +1 -1
- package/build-module/heading/deprecated.js +5 -2
- package/build-module/heading/deprecated.js.map +1 -1
- package/build-module/heading/index.js +3 -1
- package/build-module/heading/index.js.map +1 -1
- package/build-module/heading/transforms.js +3 -1
- package/build-module/heading/transforms.js.map +1 -1
- package/build-module/home-link/edit.js +10 -6
- package/build-module/home-link/edit.js.map +1 -1
- package/build-module/image/deprecated.js +77 -9
- package/build-module/image/deprecated.js.map +1 -1
- package/build-module/image/edit.js +19 -5
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/edit.native.js +18 -8
- package/build-module/image/edit.native.js.map +1 -1
- package/build-module/image/image.js +29 -22
- package/build-module/image/image.js.map +1 -1
- package/build-module/image/index.js +20 -8
- package/build-module/image/index.js.map +1 -1
- package/build-module/image/save.js +9 -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 +15 -9
- package/build-module/index.native.js.map +1 -1
- package/build-module/list/index.js +1 -1
- package/build-module/list/index.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/edit.js +15 -5
- package/build-module/list/v2/edit.js.map +1 -1
- package/build-module/list/v2/tag-name.js +21 -0
- package/build-module/list/v2/tag-name.js.map +1 -0
- package/build-module/list/v2/tag-name.native.js +21 -0
- package/build-module/list/v2/tag-name.native.js.map +1 -0
- package/build-module/list/v2/transforms.js +3 -39
- package/build-module/list/v2/transforms.js.map +1 -1
- package/build-module/list-item/edit.js +18 -14
- package/build-module/list-item/edit.js.map +1 -1
- package/build-module/list-item/edit.native.js +141 -0
- package/build-module/list-item/edit.native.js.map +1 -0
- package/build-module/list-item/hooks/index.js +2 -1
- package/build-module/list-item/hooks/index.js.map +1 -1
- package/build-module/list-item/hooks/use-copy.js +32 -0
- package/build-module/list-item/hooks/use-copy.js.map +1 -0
- 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 +82 -46
- package/build-module/list-item/hooks/use-outdent-list-item.js.map +1 -1
- package/build-module/list-item/icons.native.js +37 -0
- package/build-module/list-item/icons.native.js.map +1 -0
- package/build-module/list-item/list-style-type.native.js +126 -0
- package/build-module/list-item/list-style-type.native.js.map +1 -0
- 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 +273 -19
- package/build-module/media-text/deprecated.js.map +1 -1
- package/build-module/media-text/edit.js +4 -3
- package/build-module/media-text/edit.js.map +1 -1
- package/build-module/media-text/index.js +13 -0
- package/build-module/media-text/index.js.map +1 -1
- package/build-module/media-text/media-container.js +1 -1
- package/build-module/media-text/media-container.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/save.js +1 -6
- package/build-module/more/save.js.map +1 -1
- package/build-module/navigation/deprecated.js +7 -2
- package/build-module/navigation/deprecated.js.map +1 -1
- package/build-module/navigation/edit/index.js +178 -154
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/navigation-menu-selector.js +12 -15
- package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build-module/navigation/edit/placeholder/index.js +4 -2
- package/build-module/navigation/edit/placeholder/index.js.map +1 -1
- package/build-module/navigation/edit/responsive-wrapper.js +12 -3
- package/build-module/navigation/edit/responsive-wrapper.js.map +1 -1
- package/build-module/navigation/edit/unsaved-inner-blocks.js +2 -1
- package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js +4 -7
- package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
- package/build-module/navigation/edit/use-create-navigation-menu.js +5 -1
- package/build-module/navigation/edit/use-create-navigation-menu.js.map +1 -1
- package/build-module/navigation/edit/use-inner-blocks.js +33 -0
- package/build-module/navigation/edit/use-inner-blocks.js.map +1 -0
- package/build-module/navigation/edit/utils.js +21 -0
- package/build-module/navigation/edit/utils.js.map +1 -0
- package/build-module/navigation/menu-items-to-blocks.js +1 -6
- package/build-module/navigation/menu-items-to-blocks.js.map +1 -1
- package/build-module/navigation/use-navigation-menu.js +15 -10
- package/build-module/navigation/use-navigation-menu.js.map +1 -1
- package/build-module/navigation-link/edit.js +12 -13
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +7 -8
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/page-list/edit.js +15 -3
- package/build-module/page-list/edit.js.map +1 -1
- package/build-module/paragraph/deprecated.js +18 -9
- package/build-module/paragraph/deprecated.js.map +1 -1
- package/build-module/paragraph/edit.js +9 -12
- package/build-module/paragraph/edit.js.map +1 -1
- package/build-module/paragraph/index.js +5 -0
- package/build-module/paragraph/index.js.map +1 -1
- package/build-module/paragraph/transforms.js +5 -0
- package/build-module/paragraph/transforms.js.map +1 -1
- package/build-module/post-author/edit.js +5 -2
- package/build-module/post-author/edit.js.map +1 -1
- package/build-module/post-author/index.js +4 -2
- package/build-module/post-author/index.js.map +1 -1
- package/build-module/post-author-biography/edit.js +6 -1
- package/build-module/post-author-biography/edit.js.map +1 -1
- package/build-module/post-author-biography/index.js +1 -0
- package/build-module/post-author-biography/index.js.map +1 -1
- package/build-module/post-author-name/index.js +5 -1
- package/build-module/post-author-name/index.js.map +1 -1
- package/build-module/post-comments-count/edit.js +10 -1
- package/build-module/post-comments-count/edit.js.map +1 -1
- package/build-module/post-comments-count/index.js +4 -1
- package/build-module/post-comments-count/index.js.map +1 -1
- package/build-module/post-comments-form/edit.js +5 -42
- 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-comments-link/index.js +4 -2
- package/build-module/post-comments-link/index.js.map +1 -1
- package/build-module/post-content/edit.js +5 -3
- package/build-module/post-content/edit.js.map +1 -1
- package/build-module/post-date/edit.js +9 -2
- package/build-module/post-date/edit.js.map +1 -1
- package/build-module/post-date/index.js +9 -0
- package/build-module/post-date/index.js.map +1 -1
- package/build-module/post-featured-image/edit.js +45 -16
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/post-featured-image/index.js +21 -0
- package/build-module/post-featured-image/index.js.map +1 -1
- package/build-module/post-navigation-link/index.js +3 -2
- package/build-module/post-navigation-link/index.js.map +1 -1
- package/build-module/post-template/edit.js +8 -4
- package/build-module/post-template/edit.js.map +1 -1
- package/build-module/post-template/index.js +14 -1
- package/build-module/post-template/index.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 +5 -3
- package/build-module/post-terms/index.js.map +1 -1
- package/build-module/post-title/index.js +2 -1
- package/build-module/post-title/index.js.map +1 -1
- package/build-module/preformatted/index.js +4 -2
- package/build-module/preformatted/index.js.map +1 -1
- package/build-module/pullquote/deprecated.js +134 -25
- package/build-module/pullquote/deprecated.js.map +1 -1
- package/build-module/pullquote/edit.js +1 -1
- package/build-module/pullquote/edit.js.map +1 -1
- package/build-module/pullquote/edit.native.js +0 -1
- package/build-module/pullquote/edit.native.js.map +1 -1
- package/build-module/pullquote/index.js +13 -6
- package/build-module/pullquote/index.js.map +1 -1
- package/build-module/pullquote/save.js +2 -2
- package/build-module/pullquote/save.js.map +1 -1
- package/build-module/pullquote/transforms.js +15 -34
- package/build-module/pullquote/transforms.js.map +1 -1
- package/build-module/query/deprecated.js +10 -8
- package/build-module/query/deprecated.js.map +1 -1
- package/build-module/query/edit/index.js +23 -12
- package/build-module/query/edit/index.js.map +1 -1
- package/build-module/query/edit/inspector-controls/index.js +42 -9
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/query/edit/inspector-controls/taxonomy-controls.js +17 -12
- package/build-module/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
- package/build-module/query/edit/query-placeholder.js +6 -1
- package/build-module/query/edit/query-placeholder.js.map +1 -1
- package/build-module/query/utils.js +32 -7
- package/build-module/query/utils.js.map +1 -1
- package/build-module/query-no-results/edit.js +3 -3
- 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/query-title/edit.js +30 -9
- package/build-module/query-title/edit.js.map +1 -1
- package/build-module/query-title/index.js +11 -2
- package/build-module/query-title/index.js.map +1 -1
- package/build-module/query-title/variations.js +10 -0
- package/build-module/query-title/variations.js.map +1 -1
- package/build-module/quote/deprecated.js +171 -37
- 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 +96 -158
- package/build-module/quote/transforms.js.map +1 -1
- package/build-module/separator/deprecated.js +3 -3
- package/build-module/separator/deprecated.js.map +1 -1
- package/build-module/separator/edit.js +1 -1
- package/build-module/separator/edit.js.map +1 -1
- package/build-module/separator/index.js +1 -0
- package/build-module/separator/index.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/reddit.js +1 -1
- package/build-module/social-link/icons/reddit.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/social-links/edit.js +3 -1
- package/build-module/social-links/edit.js.map +1 -1
- package/build-module/spacer/index.js +7 -1
- package/build-module/spacer/index.js.map +1 -1
- package/build-module/table/index.js +4 -0
- package/build-module/table/index.js.map +1 -1
- package/build-module/table/state.js +10 -4
- package/build-module/table/state.js.map +1 -1
- package/build-module/table-of-contents/index.js +11 -1
- package/build-module/table-of-contents/index.js.map +1 -1
- package/build-module/tag-cloud/index.js +5 -1
- package/build-module/tag-cloud/index.js.map +1 -1
- package/build-module/template-part/edit/index.js +24 -13
- 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 +2 -2
- package/build-module/template-part/index.js.map +1 -1
- package/build-module/term-description/index.js +4 -0
- package/build-module/term-description/index.js.map +1 -1
- package/build-module/text-columns/edit.js +4 -2
- package/build-module/text-columns/edit.js.map +1 -1
- package/build-module/text-columns/save.js +4 -2
- package/build-module/text-columns/save.js.map +1 -1
- package/build-module/verse/index.js +1 -0
- package/build-module/verse/index.js.map +1 -1
- package/build-module/video/index.js +4 -0
- package/build-module/video/index.js.map +1 -1
- package/build-style/audio/style-rtl.css +3 -0
- package/build-style/audio/style.css +3 -0
- package/build-style/button/style-rtl.css +7 -7
- package/build-style/button/style.css +7 -7
- 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 +1 -0
- package/build-style/{post-comments → comments}/style.css +1 -0
- 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 +266 -132
- package/build-style/editor.css +266 -132
- package/build-style/gallery/style-rtl.css +7 -2
- package/build-style/gallery/style.css +7 -2
- package/build-style/group/editor-rtl.css +27 -8
- package/build-style/group/editor.css +27 -8
- package/build-style/image/editor-rtl.css +25 -5
- package/build-style/image/editor.css +25 -5
- package/build-style/image/style-rtl.css +33 -3
- package/build-style/image/style.css +33 -3
- package/build-style/latest-posts/editor-rtl.css +3 -0
- package/build-style/latest-posts/editor.css +3 -0
- package/build-style/navigation/editor-rtl.css +8 -4
- package/build-style/navigation/editor.css +8 -4
- package/build-style/navigation/style-rtl.css +17 -19
- package/build-style/navigation/style.css +17 -19
- package/build-style/paragraph/editor-rtl.css +1 -1
- package/build-style/paragraph/editor.css +1 -1
- 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-comments/editor-rtl.css → post-date/style-rtl.css} +2 -2
- package/build-style/{post-comments/editor.css → post-date/style.css} +2 -2
- package/build-style/post-featured-image/editor-rtl.css +45 -43
- package/build-style/post-featured-image/editor.css +45 -43
- package/build-style/post-featured-image/style-rtl.css +1 -0
- package/build-style/post-featured-image/style.css +1 -0
- package/build-style/post-title/style-rtl.css +1 -0
- package/build-style/post-title/style.css +1 -0
- package/build-style/pullquote/editor-rtl.css +0 -12
- package/build-style/pullquote/editor.css +0 -12
- package/build-style/pullquote/style-rtl.css +1 -8
- package/build-style/pullquote/style.css +1 -8
- package/build-style/query/editor-rtl.css +7 -0
- package/build-style/query/editor.css +7 -0
- package/build-style/query-pagination/style-rtl.css +6 -0
- package/build-style/query-pagination/style.css +6 -0
- package/build-style/query-title/style-rtl.css +79 -0
- package/build-style/query-title/style.css +79 -0
- package/build-style/search/style-rtl.css +2 -0
- package/build-style/search/style.css +2 -0
- package/build-style/site-logo/editor-rtl.css +3 -52
- package/build-style/site-logo/editor.css +3 -52
- 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 +10 -2
- package/build-style/social-links/style.css +10 -2
- package/build-style/style-rtl.css +221 -162
- package/build-style/style.css +221 -162
- package/build-style/tag-cloud/style-rtl.css +1 -0
- package/build-style/tag-cloud/style.css +1 -0
- package/build-style/template-part/editor-rtl.css +14 -3
- package/build-style/template-part/editor.css +14 -3
- package/build-style/video/style-rtl.css +3 -0
- package/build-style/video/style.css +3 -0
- package/package.json +30 -30
- package/src/archives/block.json +9 -1
- package/src/archives/edit.js +12 -1
- package/src/archives/index.php +5 -3
- package/src/audio/block.json +4 -0
- package/src/audio/style.scss +2 -0
- package/src/audio/test/__snapshots__/edit.native.js.snap +16 -2
- package/src/block/edit.js +4 -4
- package/src/block/edit.native.js +4 -4
- package/src/button/block.json +1 -1
- package/src/button/deprecated.js +21 -22
- package/src/button/edit.js +1 -0
- package/src/button/style.scss +9 -7
- package/src/buttons/edit.js +1 -5
- package/src/calendar/edit.js +11 -4
- package/src/calendar/index.php +2 -2
- package/src/categories/block.json +14 -1
- package/src/categories/edit.js +2 -2
- package/src/code/block.json +4 -2
- package/src/column/block.json +13 -0
- package/src/columns/block.json +13 -0
- package/src/columns/deprecated.js +10 -4
- package/src/columns/edit.js +7 -3
- package/src/columns/edit.native.js +11 -5
- package/src/comment-author-name/block.json +5 -1
- package/src/comment-content/block.json +5 -1
- package/src/comment-date/block.json +1 -0
- package/src/comment-edit-link/block.json +5 -1
- package/src/comment-reply-link/block.json +5 -1
- package/src/comment-template/block.json +14 -1
- package/src/comments/block.json +19 -1
- 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} +1 -28
- package/src/comments/editor.scss +9 -0
- package/src/comments/index.php +220 -0
- package/src/comments/save.js +8 -7
- package/src/{post-comments → comments}/style.scss +7 -0
- package/src/comments-pagination/block.json +13 -0
- package/src/comments-pagination-next/block.json +4 -2
- package/src/comments-pagination-numbers/block.json +14 -1
- package/src/comments-pagination-numbers/edit.js +12 -3
- package/src/comments-pagination-previous/block.json +4 -2
- package/src/comments-title/block.json +4 -2
- package/src/common.scss +2 -0
- package/src/cover/block.json +13 -0
- package/src/cover/deprecated.js +11 -4
- package/src/cover/edit/resizable-cover.js +6 -0
- package/src/cover/index.php +2 -2
- package/src/cover/shared.js +2 -1
- 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/embed/embed-placeholder.native.js +2 -3
- package/src/embed/icons.js +1 -1
- package/src/file/test/__snapshots__/edit.native.js.snap +32 -4
- package/src/gallery/block.json +5 -0
- package/src/gallery/deprecated.js +4 -2
- package/src/gallery/edit.js +26 -4
- package/src/gallery/style.scss +10 -1
- package/src/gallery/transforms.js +18 -5
- package/src/gallery/use-get-media.native.js +44 -0
- package/src/gallery/utils.js +11 -7
- package/src/group/block.json +11 -2
- package/src/group/deprecated.js +89 -2
- package/src/group/edit.js +15 -2
- package/src/group/editor.scss +28 -3
- package/src/group/transforms.js +7 -0
- package/src/group/variations.js +6 -5
- package/src/heading/block.json +3 -1
- package/src/heading/deprecated.js +4 -2
- package/src/home-link/edit.js +19 -20
- package/src/home-link/index.php +8 -17
- package/src/image/block.json +20 -8
- package/src/image/deprecated.js +86 -0
- package/src/image/edit.js +25 -2
- package/src/image/edit.native.js +18 -7
- package/src/image/editor.scss +48 -7
- package/src/image/image.js +26 -16
- package/src/image/index.php +1 -1
- package/src/image/save.js +10 -1
- package/src/image/style.scss +39 -3
- package/src/image/test/edit.native.js +6 -10
- package/src/index.js +0 -2
- package/src/index.native.js +26 -17
- package/src/latest-posts/editor.scss +5 -0
- package/src/list/index.js +1 -1
- package/src/list/test/__snapshots__/edit.native.js.snap +133 -0
- package/src/list/test/edit.native.js +511 -7
- package/src/list/transforms.js +0 -47
- package/src/list/v2/edit.js +12 -4
- package/src/list/v2/tag-name.js +13 -0
- package/src/list/v2/tag-name.native.js +12 -0
- package/src/list/v2/transforms.js +3 -49
- package/src/list-item/edit.js +13 -14
- package/src/list-item/edit.native.js +148 -0
- package/src/list-item/hooks/index.js +2 -1
- package/src/list-item/hooks/use-copy.js +36 -0
- package/src/list-item/hooks/use-merge.js +141 -0
- package/src/list-item/hooks/use-outdent-list-item.js +72 -74
- package/src/list-item/icons.native.js +34 -0
- package/src/list-item/list-style-type.native.js +146 -0
- package/src/list-item/style.native.scss +49 -0
- package/src/list-item/utils.js +27 -3
- package/src/media-text/block.json +13 -0
- package/src/media-text/deprecated.js +584 -290
- package/src/media-text/edit.js +3 -1
- package/src/media-text/media-container.js +3 -1
- package/src/media-text/save.js +18 -0
- package/src/media-text/test/media-container.js +24 -0
- package/src/more/save.js +3 -6
- package/src/navigation/deprecated.js +4 -2
- package/src/navigation/edit/index.js +234 -237
- package/src/navigation/edit/navigation-menu-selector.js +12 -26
- package/src/navigation/edit/placeholder/index.js +4 -2
- package/src/navigation/edit/responsive-wrapper.js +24 -3
- package/src/navigation/edit/unsaved-inner-blocks.js +3 -1
- package/src/navigation/edit/use-convert-classic-menu-to-block-menu.js +31 -37
- package/src/navigation/edit/use-create-navigation-menu.js +4 -0
- package/src/navigation/edit/use-inner-blocks.js +39 -0
- package/src/navigation/edit/utils.js +30 -0
- package/src/navigation/editor.scss +3 -2
- package/src/navigation/index.php +17 -16
- package/src/navigation/menu-items-to-blocks.js +3 -6
- package/src/navigation/style.scss +13 -22
- package/src/navigation/use-navigation-menu.js +20 -13
- package/src/navigation-link/edit.js +13 -16
- package/src/navigation-link/index.php +1 -1
- package/src/navigation-submenu/edit.js +10 -13
- package/src/navigation-submenu/index.php +1 -1
- package/src/page-list/edit.js +15 -2
- package/src/page-list/index.php +4 -4
- package/src/paragraph/block.json +5 -0
- package/src/paragraph/deprecated.js +33 -35
- package/src/paragraph/edit.js +9 -14
- package/src/paragraph/editor.scss +5 -3
- package/src/post-author/block.json +4 -2
- package/src/post-author/edit.js +6 -3
- package/src/post-author-biography/block.json +1 -0
- package/src/post-author-biography/edit.js +4 -1
- package/src/post-author-name/block.json +5 -1
- package/src/post-comments-count/block.json +4 -1
- package/src/post-comments-count/edit.js +10 -2
- package/src/post-comments-form/edit.js +2 -71
- package/src/post-comments-form/form.js +80 -5
- package/src/post-comments-form/index.php +1 -1
- package/src/post-comments-form/style.scss +0 -1
- package/src/post-comments-link/block.json +4 -2
- package/src/post-content/edit.js +4 -4
- package/src/post-date/block.json +9 -0
- package/src/post-date/edit.js +12 -2
- package/src/post-date/index.php +10 -2
- package/src/post-date/style.scss +4 -0
- package/src/post-featured-image/block.json +21 -0
- package/src/post-featured-image/edit.js +66 -14
- package/src/post-featured-image/editor.scss +44 -53
- package/src/post-featured-image/index.php +64 -5
- package/src/post-featured-image/style.scss +1 -0
- package/src/post-navigation-link/block.json +3 -2
- package/src/post-template/block.json +15 -1
- package/src/post-template/edit.js +6 -1
- package/src/post-template/index.php +7 -4
- package/src/post-terms/block.json +5 -3
- package/src/post-terms/edit.js +3 -2
- package/src/post-title/block.json +2 -1
- package/src/post-title/index.php +2 -1
- package/src/post-title/style.scss +2 -0
- package/src/preformatted/block.json +4 -2
- package/src/preformatted/test/__snapshots__/edit.native.js.snap +16 -2
- package/src/pullquote/block.json +11 -4
- package/src/pullquote/deprecated.js +490 -412
- package/src/pullquote/edit.js +1 -1
- package/src/pullquote/edit.native.js +0 -1
- package/src/pullquote/editor.scss +0 -16
- package/src/pullquote/index.js +1 -3
- package/src/pullquote/save.js +1 -1
- package/src/pullquote/style.scss +0 -11
- package/src/pullquote/transforms.js +17 -33
- package/src/query/deprecated.js +4 -9
- package/src/query/edit/index.js +28 -15
- package/src/query/edit/inspector-controls/index.js +129 -65
- package/src/query/edit/inspector-controls/taxonomy-controls.js +18 -11
- package/src/query/edit/query-placeholder.js +17 -2
- package/src/query/editor.scss +9 -0
- package/src/query/utils.js +29 -7
- package/src/query-no-results/edit.js +3 -6
- package/src/query-pagination/style.scss +14 -0
- package/src/query-pagination-next/edit.js +1 -0
- package/src/query-pagination-previous/edit.js +1 -0
- package/src/query-title/block.json +11 -2
- package/src/query-title/edit.js +51 -7
- package/src/query-title/index.php +28 -2
- package/src/query-title/style.scss +4 -0
- package/src/query-title/variations.js +13 -0
- package/src/quote/deprecated.js +215 -100
- 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 +98 -146
- package/src/search/index.php +1 -1
- package/src/search/style.scss +2 -0
- package/src/search/test/__snapshots__/edit.native.js.snap +56 -7
- package/src/separator/block.json +1 -0
- package/src/separator/deprecated.js +2 -3
- package/src/separator/edit.js +1 -1
- package/src/separator/test/edit.js +5 -3
- package/src/site-logo/editor.scss +8 -66
- package/src/site-title/index.php +8 -9
- package/src/social-link/editor.scss +3 -0
- package/src/social-link/icons/index.js +1 -0
- package/src/social-link/icons/reddit.js +1 -1
- package/src/social-link/icons/whatsapp.js +10 -0
- package/src/social-link/index.php +6 -2
- package/src/social-link/socials-with-bg.scss +6 -1
- package/src/social-link/socials-without-bg.scss +6 -1
- package/src/social-link/variations.js +7 -0
- package/src/social-links/edit.js +2 -0
- package/src/spacer/block.json +7 -1
- package/src/style.scss +3 -2
- package/src/table/block.json +4 -0
- package/src/table/state.js +21 -19
- package/src/table-of-contents/block.json +11 -1
- package/src/tag-cloud/block.json +5 -1
- package/src/tag-cloud/style.scss +1 -0
- package/src/template-part/edit/index.js +40 -27
- 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 +3 -2
- package/src/template-part/index.php +56 -2
- package/src/term-description/block.json +4 -0
- package/src/text-columns/edit.js +2 -2
- package/src/text-columns/save.js +2 -2
- package/src/verse/block.json +1 -0
- package/src/video/block.json +4 -0
- package/src/video/style.scss +2 -0
- package/build/comments/edit.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/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-module/comments/edit.js +0 -59
- package/build-module/comments/edit.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/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/src/list-item/hooks/use-backspace.js +0 -51
- 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
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = ListItemEdit;
|
|
9
|
+
|
|
10
|
+
var _element = require("@wordpress/element");
|
|
11
|
+
|
|
12
|
+
var _reactNative = require("react-native");
|
|
13
|
+
|
|
14
|
+
var _blockEditor = require("@wordpress/block-editor");
|
|
15
|
+
|
|
16
|
+
var _i18n = require("@wordpress/i18n");
|
|
17
|
+
|
|
18
|
+
var _data = require("@wordpress/data");
|
|
19
|
+
|
|
20
|
+
var _hooks = require("./hooks");
|
|
21
|
+
|
|
22
|
+
var _utils = require("./utils");
|
|
23
|
+
|
|
24
|
+
var _edit = require("./edit.js");
|
|
25
|
+
|
|
26
|
+
var _style = _interopRequireDefault(require("./style.scss"));
|
|
27
|
+
|
|
28
|
+
var _listStyleType = _interopRequireDefault(require("./list-style-type"));
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* External dependencies
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* WordPress dependencies
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Internal dependencies
|
|
40
|
+
*/
|
|
41
|
+
function ListItemEdit(_ref) {
|
|
42
|
+
let {
|
|
43
|
+
attributes,
|
|
44
|
+
setAttributes,
|
|
45
|
+
onReplace,
|
|
46
|
+
clientId,
|
|
47
|
+
style
|
|
48
|
+
} = _ref;
|
|
49
|
+
const [contentWidth, setContentWidth] = (0, _element.useState)();
|
|
50
|
+
const {
|
|
51
|
+
placeholder,
|
|
52
|
+
content
|
|
53
|
+
} = attributes;
|
|
54
|
+
const {
|
|
55
|
+
blockIndex,
|
|
56
|
+
hasInnerBlocks,
|
|
57
|
+
indentationLevel,
|
|
58
|
+
numberOfListItems,
|
|
59
|
+
ordered,
|
|
60
|
+
reversed,
|
|
61
|
+
start
|
|
62
|
+
} = (0, _data.useSelect)(select => {
|
|
63
|
+
const {
|
|
64
|
+
getBlockAttributes,
|
|
65
|
+
getBlockCount,
|
|
66
|
+
getBlockIndex,
|
|
67
|
+
getBlockParentsByBlockName,
|
|
68
|
+
getBlockRootClientId
|
|
69
|
+
} = select(_blockEditor.store);
|
|
70
|
+
const currentIdentationLevel = getBlockParentsByBlockName(clientId, 'core/list-item', true).length;
|
|
71
|
+
const currentBlockIndex = getBlockIndex(clientId);
|
|
72
|
+
const blockWithInnerBlocks = getBlockCount(clientId) > 0;
|
|
73
|
+
const rootClientId = getBlockRootClientId(clientId);
|
|
74
|
+
const blockAttributes = getBlockAttributes(rootClientId);
|
|
75
|
+
const totalListItems = getBlockCount(rootClientId);
|
|
76
|
+
const {
|
|
77
|
+
ordered: isOrdered,
|
|
78
|
+
reversed: isReversed,
|
|
79
|
+
start: startValue
|
|
80
|
+
} = blockAttributes || {};
|
|
81
|
+
return {
|
|
82
|
+
blockIndex: currentBlockIndex,
|
|
83
|
+
hasInnerBlocks: blockWithInnerBlocks,
|
|
84
|
+
indentationLevel: currentIdentationLevel,
|
|
85
|
+
numberOfListItems: totalListItems,
|
|
86
|
+
ordered: isOrdered,
|
|
87
|
+
reversed: isReversed,
|
|
88
|
+
start: startValue
|
|
89
|
+
};
|
|
90
|
+
}, [clientId]);
|
|
91
|
+
const blockProps = (0, _blockEditor.useBlockProps)({ ...(hasInnerBlocks && _style.default['wp-block-list-item__nested-blocks'])
|
|
92
|
+
});
|
|
93
|
+
const innerBlocksProps = (0, _blockEditor.useInnerBlocksProps)(blockProps, {
|
|
94
|
+
allowedBlocks: ['core/list'],
|
|
95
|
+
renderAppender: false
|
|
96
|
+
});
|
|
97
|
+
const onSplit = (0, _hooks.useSplit)(clientId);
|
|
98
|
+
const onMerge = (0, _hooks.useMerge)(clientId);
|
|
99
|
+
const onLayout = (0, _element.useCallback)(_ref2 => {
|
|
100
|
+
let {
|
|
101
|
+
nativeEvent
|
|
102
|
+
} = _ref2;
|
|
103
|
+
setContentWidth(prevState => {
|
|
104
|
+
const {
|
|
105
|
+
width
|
|
106
|
+
} = nativeEvent.layout;
|
|
107
|
+
|
|
108
|
+
if (!prevState || prevState.width !== width) {
|
|
109
|
+
return Math.floor(width);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return prevState;
|
|
113
|
+
});
|
|
114
|
+
}, []);
|
|
115
|
+
return (0, _element.createElement)(_reactNative.View, {
|
|
116
|
+
style: _style.default['wp-block-list-item__list-item-parent']
|
|
117
|
+
}, (0, _element.createElement)(_reactNative.View, {
|
|
118
|
+
style: _style.default['wp-block-list-item__list-item']
|
|
119
|
+
}, (0, _element.createElement)(_reactNative.View, {
|
|
120
|
+
style: _style.default['wp-block-list-item__list-item-icon']
|
|
121
|
+
}, (0, _element.createElement)(_listStyleType.default, {
|
|
122
|
+
blockIndex: blockIndex,
|
|
123
|
+
indentationLevel: indentationLevel,
|
|
124
|
+
numberOfListItems: numberOfListItems,
|
|
125
|
+
ordered: ordered,
|
|
126
|
+
reversed: reversed,
|
|
127
|
+
start: start,
|
|
128
|
+
style: style
|
|
129
|
+
})), (0, _element.createElement)(_reactNative.View, {
|
|
130
|
+
style: _style.default['wp-block-list-item__list-item-content'],
|
|
131
|
+
onLayout: onLayout
|
|
132
|
+
}, (0, _element.createElement)(_blockEditor.RichText, {
|
|
133
|
+
identifier: "content",
|
|
134
|
+
tagName: "p",
|
|
135
|
+
onChange: nextContent => setAttributes({
|
|
136
|
+
content: nextContent
|
|
137
|
+
}),
|
|
138
|
+
value: content,
|
|
139
|
+
placeholder: placeholder || (0, _i18n.__)('List'),
|
|
140
|
+
onSplit: onSplit,
|
|
141
|
+
onMerge: onMerge,
|
|
142
|
+
onReplace: function (blocks) {
|
|
143
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
144
|
+
args[_key - 1] = arguments[_key];
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
onReplace((0, _utils.convertToListItems)(blocks), ...args);
|
|
148
|
+
},
|
|
149
|
+
style: style,
|
|
150
|
+
deleteEnter: true,
|
|
151
|
+
containerWidth: contentWidth
|
|
152
|
+
}))), (0, _element.createElement)(_reactNative.View, innerBlocksProps), (0, _element.createElement)(_blockEditor.BlockControls, {
|
|
153
|
+
group: "block"
|
|
154
|
+
}, (0, _element.createElement)(_edit.IndentUI, {
|
|
155
|
+
clientId: clientId
|
|
156
|
+
})));
|
|
157
|
+
}
|
|
158
|
+
//# sourceMappingURL=edit.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/list-item/edit.native.js"],"names":["ListItemEdit","attributes","setAttributes","onReplace","clientId","style","contentWidth","setContentWidth","placeholder","content","blockIndex","hasInnerBlocks","indentationLevel","numberOfListItems","ordered","reversed","start","select","getBlockAttributes","getBlockCount","getBlockIndex","getBlockParentsByBlockName","getBlockRootClientId","blockEditorStore","currentIdentationLevel","length","currentBlockIndex","blockWithInnerBlocks","rootClientId","blockAttributes","totalListItems","isOrdered","isReversed","startValue","blockProps","styles","innerBlocksProps","allowedBlocks","renderAppender","onSplit","onMerge","onLayout","nativeEvent","prevState","width","layout","Math","floor","nextContent","blocks","args"],"mappings":"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","sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tRichText,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tBlockControls,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { useState, useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useSplit, useMerge } from './hooks';\nimport { convertToListItems } from './utils';\nimport { IndentUI } from './edit.js';\nimport styles from './style.scss';\nimport ListStyleType from './list-style-type';\n\nexport default function ListItemEdit( {\n\tattributes,\n\tsetAttributes,\n\tonReplace,\n\tclientId,\n\tstyle,\n} ) {\n\tconst [ contentWidth, setContentWidth ] = useState();\n\tconst { placeholder, content } = attributes;\n\tconst {\n\t\tblockIndex,\n\t\thasInnerBlocks,\n\t\tindentationLevel,\n\t\tnumberOfListItems,\n\t\tordered,\n\t\treversed,\n\t\tstart,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockAttributes,\n\t\t\t\tgetBlockCount,\n\t\t\t\tgetBlockIndex,\n\t\t\t\tgetBlockParentsByBlockName,\n\t\t\t\tgetBlockRootClientId,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst currentIdentationLevel = getBlockParentsByBlockName(\n\t\t\t\tclientId,\n\t\t\t\t'core/list-item',\n\t\t\t\ttrue\n\t\t\t).length;\n\t\t\tconst currentBlockIndex = getBlockIndex( clientId );\n\t\t\tconst blockWithInnerBlocks = getBlockCount( clientId ) > 0;\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\t\t\tconst blockAttributes = getBlockAttributes( rootClientId );\n\t\t\tconst totalListItems = getBlockCount( rootClientId );\n\t\t\tconst {\n\t\t\t\tordered: isOrdered,\n\t\t\t\treversed: isReversed,\n\t\t\t\tstart: startValue,\n\t\t\t} = blockAttributes || {};\n\n\t\t\treturn {\n\t\t\t\tblockIndex: currentBlockIndex,\n\t\t\t\thasInnerBlocks: blockWithInnerBlocks,\n\t\t\t\tindentationLevel: currentIdentationLevel,\n\t\t\t\tnumberOfListItems: totalListItems,\n\t\t\t\tordered: isOrdered,\n\t\t\t\treversed: isReversed,\n\t\t\t\tstart: startValue,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst blockProps = useBlockProps( {\n\t\t...( hasInnerBlocks && styles[ 'wp-block-list-item__nested-blocks' ] ),\n\t} );\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\tallowedBlocks: [ 'core/list' ],\n\t\trenderAppender: false,\n\t} );\n\n\tconst onSplit = useSplit( clientId );\n\tconst onMerge = useMerge( clientId );\n\tconst onLayout = useCallback( ( { nativeEvent } ) => {\n\t\tsetContentWidth( ( prevState ) => {\n\t\t\tconst { width } = nativeEvent.layout;\n\n\t\t\tif ( ! prevState || prevState.width !== width ) {\n\t\t\t\treturn Math.floor( width );\n\t\t\t}\n\t\t\treturn prevState;\n\t\t} );\n\t}, [] );\n\n\treturn (\n\t\t<View style={ styles[ 'wp-block-list-item__list-item-parent' ] }>\n\t\t\t<View style={ styles[ 'wp-block-list-item__list-item' ] }>\n\t\t\t\t<View style={ styles[ 'wp-block-list-item__list-item-icon' ] }>\n\t\t\t\t\t<ListStyleType\n\t\t\t\t\t\tblockIndex={ blockIndex }\n\t\t\t\t\t\tindentationLevel={ indentationLevel }\n\t\t\t\t\t\tnumberOfListItems={ numberOfListItems }\n\t\t\t\t\t\tordered={ ordered }\n\t\t\t\t\t\treversed={ reversed }\n\t\t\t\t\t\tstart={ start }\n\t\t\t\t\t\tstyle={ style }\n\t\t\t\t\t/>\n\t\t\t\t</View>\n\t\t\t\t<View\n\t\t\t\t\tstyle={ styles[ 'wp-block-list-item__list-item-content' ] }\n\t\t\t\t\tonLayout={ onLayout }\n\t\t\t\t>\n\t\t\t\t\t<RichText\n\t\t\t\t\t\tidentifier=\"content\"\n\t\t\t\t\t\ttagName=\"p\"\n\t\t\t\t\t\tonChange={ ( nextContent ) =>\n\t\t\t\t\t\t\tsetAttributes( { content: nextContent } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvalue={ content }\n\t\t\t\t\t\tplaceholder={ placeholder || __( 'List' ) }\n\t\t\t\t\t\tonSplit={ onSplit }\n\t\t\t\t\t\tonMerge={ onMerge }\n\t\t\t\t\t\tonReplace={ ( blocks, ...args ) => {\n\t\t\t\t\t\t\tonReplace( convertToListItems( blocks ), ...args );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tstyle={ style }\n\t\t\t\t\t\tdeleteEnter={ true }\n\t\t\t\t\t\tcontainerWidth={ contentWidth }\n\t\t\t\t\t/>\n\t\t\t\t</View>\n\t\t\t</View>\n\t\t\t<View { ...innerBlocksProps }></View>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t<IndentUI clientId={ clientId } />\n\t\t\t</BlockControls>\n\t\t</View>\n\t);\n}\n"]}
|
|
@@ -5,10 +5,10 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
Object.defineProperty(exports, "
|
|
8
|
+
Object.defineProperty(exports, "useCopy", {
|
|
9
9
|
enumerable: true,
|
|
10
10
|
get: function () {
|
|
11
|
-
return
|
|
11
|
+
return _useCopy.default;
|
|
12
12
|
}
|
|
13
13
|
});
|
|
14
14
|
Object.defineProperty(exports, "useEnter", {
|
|
@@ -23,6 +23,12 @@ Object.defineProperty(exports, "useIndentListItem", {
|
|
|
23
23
|
return _useIndentListItem.default;
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
|
+
Object.defineProperty(exports, "useMerge", {
|
|
27
|
+
enumerable: true,
|
|
28
|
+
get: function () {
|
|
29
|
+
return _useMerge.default;
|
|
30
|
+
}
|
|
31
|
+
});
|
|
26
32
|
Object.defineProperty(exports, "useOutdentListItem", {
|
|
27
33
|
enumerable: true,
|
|
28
34
|
get: function () {
|
|
@@ -48,9 +54,11 @@ var _useIndentListItem = _interopRequireDefault(require("./use-indent-list-item"
|
|
|
48
54
|
|
|
49
55
|
var _useEnter = _interopRequireDefault(require("./use-enter"));
|
|
50
56
|
|
|
51
|
-
var _useBackspace = _interopRequireDefault(require("./use-backspace"));
|
|
52
|
-
|
|
53
57
|
var _useSpace = _interopRequireDefault(require("./use-space"));
|
|
54
58
|
|
|
55
59
|
var _useSplit = _interopRequireDefault(require("./use-split"));
|
|
60
|
+
|
|
61
|
+
var _useMerge = _interopRequireDefault(require("./use-merge"));
|
|
62
|
+
|
|
63
|
+
var _useCopy = _interopRequireDefault(require("./use-copy"));
|
|
56
64
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/list-item/hooks/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/list-item/hooks/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA","sourcesContent":["export { default as useOutdentListItem } from './use-outdent-list-item';\nexport { default as useIndentListItem } from './use-indent-list-item';\nexport { default as useEnter } from './use-enter';\nexport { default as useSpace } from './use-space';\nexport { default as useSplit } from './use-split';\nexport { default as useMerge } from './use-merge';\nexport { default as useCopy } from './use-copy';\n"]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = useCopy;
|
|
7
|
+
|
|
8
|
+
var _compose = require("@wordpress/compose");
|
|
9
|
+
|
|
10
|
+
var _blockEditor = require("@wordpress/block-editor");
|
|
11
|
+
|
|
12
|
+
var _data = require("@wordpress/data");
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* WordPress dependencies
|
|
16
|
+
*/
|
|
17
|
+
function useCopy(clientId) {
|
|
18
|
+
const {
|
|
19
|
+
getBlockRootClientId,
|
|
20
|
+
getBlockName,
|
|
21
|
+
getBlockAttributes
|
|
22
|
+
} = (0, _data.useSelect)(_blockEditor.store);
|
|
23
|
+
return (0, _compose.useRefEffect)(node => {
|
|
24
|
+
function onCopy(event) {
|
|
25
|
+
// The event propagates through all nested lists, so don't override
|
|
26
|
+
// when copying nested list items.
|
|
27
|
+
if (event.clipboardData.getData('__unstableWrapperBlockName')) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const rootClientId = getBlockRootClientId(clientId);
|
|
32
|
+
event.clipboardData.setData('__unstableWrapperBlockName', getBlockName(rootClientId));
|
|
33
|
+
event.clipboardData.setData('__unstableWrapperBlockAttributes', JSON.stringify(getBlockAttributes(rootClientId)));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
node.addEventListener('copy', onCopy);
|
|
37
|
+
return () => {
|
|
38
|
+
node.removeEventListener('copy', onCopy);
|
|
39
|
+
};
|
|
40
|
+
}, []);
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=use-copy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/list-item/hooks/use-copy.js"],"names":["useCopy","clientId","getBlockRootClientId","getBlockName","getBlockAttributes","blockEditorStore","node","onCopy","event","clipboardData","getData","rootClientId","setData","JSON","stringify","addEventListener","removeEventListener"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AALA;AACA;AACA;AAKe,SAASA,OAAT,CAAkBC,QAAlB,EAA6B;AAC3C,QAAM;AAAEC,IAAAA,oBAAF;AAAwBC,IAAAA,YAAxB;AAAsCC,IAAAA;AAAtC,MACL,qBAAWC,kBAAX,CADD;AAGA,SAAO,2BAAgBC,IAAF,IAAY;AAChC,aAASC,MAAT,CAAiBC,KAAjB,EAAyB;AACxB;AACA;AACA,UAAKA,KAAK,CAACC,aAAN,CAAoBC,OAApB,CAA6B,4BAA7B,CAAL,EAAmE;AAClE;AACA;;AAED,YAAMC,YAAY,GAAGT,oBAAoB,CAAED,QAAF,CAAzC;AACAO,MAAAA,KAAK,CAACC,aAAN,CAAoBG,OAApB,CACC,4BADD,EAECT,YAAY,CAAEQ,YAAF,CAFb;AAIAH,MAAAA,KAAK,CAACC,aAAN,CAAoBG,OAApB,CACC,kCADD,EAECC,IAAI,CAACC,SAAL,CAAgBV,kBAAkB,CAAEO,YAAF,CAAlC,CAFD;AAIA;;AAEDL,IAAAA,IAAI,CAACS,gBAAL,CAAuB,MAAvB,EAA+BR,MAA/B;AACA,WAAO,MAAM;AACZD,MAAAA,IAAI,CAACU,mBAAL,CAA0B,MAA1B,EAAkCT,MAAlC;AACA,KAFD;AAGA,GAvBM,EAuBJ,EAvBI,CAAP;AAwBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRefEffect } from '@wordpress/compose';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\n\nexport default function useCopy( clientId ) {\n\tconst { getBlockRootClientId, getBlockName, getBlockAttributes } =\n\t\tuseSelect( blockEditorStore );\n\n\treturn useRefEffect( ( node ) => {\n\t\tfunction onCopy( event ) {\n\t\t\t// The event propagates through all nested lists, so don't override\n\t\t\t// when copying nested list items.\n\t\t\tif ( event.clipboardData.getData( '__unstableWrapperBlockName' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\t\t\tevent.clipboardData.setData(\n\t\t\t\t'__unstableWrapperBlockName',\n\t\t\t\tgetBlockName( rootClientId )\n\t\t\t);\n\t\t\tevent.clipboardData.setData(\n\t\t\t\t'__unstableWrapperBlockAttributes',\n\t\t\t\tJSON.stringify( getBlockAttributes( rootClientId ) )\n\t\t\t);\n\t\t}\n\n\t\tnode.addEventListener( 'copy', onCopy );\n\t\treturn () => {\n\t\t\tnode.removeEventListener( 'copy', onCopy );\n\t\t};\n\t}, [] );\n}\n"]}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = useMerge;
|
|
9
|
+
|
|
10
|
+
var _data = require("@wordpress/data");
|
|
11
|
+
|
|
12
|
+
var _blockEditor = require("@wordpress/block-editor");
|
|
13
|
+
|
|
14
|
+
var _blocks = require("@wordpress/blocks");
|
|
15
|
+
|
|
16
|
+
var _useOutdentListItem = _interopRequireDefault(require("./use-outdent-list-item"));
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* WordPress dependencies
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Internal dependencies
|
|
24
|
+
*/
|
|
25
|
+
const {
|
|
26
|
+
name: listItemName
|
|
27
|
+
} = {
|
|
28
|
+
$schema: "https://schemas.wp.org/trunk/block.json",
|
|
29
|
+
apiVersion: 2,
|
|
30
|
+
__experimental: "list-v2",
|
|
31
|
+
name: "core/list-item",
|
|
32
|
+
title: "List item",
|
|
33
|
+
category: "text",
|
|
34
|
+
parent: ["core/list"],
|
|
35
|
+
description: "Create a list item.",
|
|
36
|
+
textdomain: "default",
|
|
37
|
+
attributes: {
|
|
38
|
+
placeholder: {
|
|
39
|
+
type: "string"
|
|
40
|
+
},
|
|
41
|
+
content: {
|
|
42
|
+
type: "string",
|
|
43
|
+
source: "html",
|
|
44
|
+
selector: "li",
|
|
45
|
+
"default": "",
|
|
46
|
+
__experimentalRole: "content"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
supports: {
|
|
50
|
+
className: false,
|
|
51
|
+
__experimentalSelector: "li"
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
function useMerge(clientId) {
|
|
56
|
+
const registry = (0, _data.useRegistry)();
|
|
57
|
+
const {
|
|
58
|
+
getPreviousBlockClientId,
|
|
59
|
+
getNextBlockClientId,
|
|
60
|
+
getBlockOrder,
|
|
61
|
+
getBlockRootClientId,
|
|
62
|
+
getBlockName,
|
|
63
|
+
getBlock
|
|
64
|
+
} = (0, _data.useSelect)(_blockEditor.store);
|
|
65
|
+
const {
|
|
66
|
+
mergeBlocks,
|
|
67
|
+
moveBlocksToPosition,
|
|
68
|
+
replaceBlock,
|
|
69
|
+
selectBlock
|
|
70
|
+
} = (0, _data.useDispatch)(_blockEditor.store);
|
|
71
|
+
const [, outdentListItem] = (0, _useOutdentListItem.default)(clientId);
|
|
72
|
+
|
|
73
|
+
function getTrailingId(id) {
|
|
74
|
+
const order = getBlockOrder(id);
|
|
75
|
+
|
|
76
|
+
if (!order.length) {
|
|
77
|
+
return id;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return getTrailingId(order[order.length - 1]);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function getParentListItemId(id) {
|
|
84
|
+
const listId = getBlockRootClientId(id);
|
|
85
|
+
const parentListItemId = getBlockRootClientId(listId);
|
|
86
|
+
if (!parentListItemId) return;
|
|
87
|
+
if (getBlockName(parentListItemId) !== listItemName) return;
|
|
88
|
+
return parentListItemId;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Return the next list item with respect to the given list item. If none,
|
|
92
|
+
* return the next list item of the parent list item if it exists.
|
|
93
|
+
*
|
|
94
|
+
* @param {string} id A list item client ID.
|
|
95
|
+
* @return {string?} The client ID of the next list item.
|
|
96
|
+
*/
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
function _getNextId(id) {
|
|
100
|
+
const next = getNextBlockClientId(id);
|
|
101
|
+
if (next) return next;
|
|
102
|
+
const parentListItemId = getParentListItemId(id);
|
|
103
|
+
if (!parentListItemId) return;
|
|
104
|
+
return _getNextId(parentListItemId);
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Given a client ID, return the client ID of the list item on the next
|
|
108
|
+
* line, regardless of indentation level.
|
|
109
|
+
*
|
|
110
|
+
* @param {string} id The client ID of the current list item.
|
|
111
|
+
* @return {string?} The client ID of the next list item.
|
|
112
|
+
*/
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
function getNextId(id) {
|
|
116
|
+
const order = getBlockOrder(id); // If the list item does not have a nested list, return the next list
|
|
117
|
+
// item.
|
|
118
|
+
|
|
119
|
+
if (!order.length) {
|
|
120
|
+
return _getNextId(id);
|
|
121
|
+
} // Get the first list item in the nested list.
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
return getBlockOrder(order[0])[0];
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function switchToDefaultBlockType(forward) {
|
|
128
|
+
const rootClientId = getBlockRootClientId(clientId);
|
|
129
|
+
const replacement = (0, _blocks.switchToBlockType)(getBlock(rootClientId), (0, _blocks.getDefaultBlockName)());
|
|
130
|
+
const indexToSelect = forward ? replacement.length - 1 : 0;
|
|
131
|
+
const initialPosition = forward ? -1 : 0;
|
|
132
|
+
registry.batch(() => {
|
|
133
|
+
replaceBlock(rootClientId, replacement);
|
|
134
|
+
selectBlock(replacement[indexToSelect].clientId, initialPosition);
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
return forward => {
|
|
139
|
+
if (forward) {
|
|
140
|
+
const nextBlockClientId = getNextId(clientId);
|
|
141
|
+
|
|
142
|
+
if (!nextBlockClientId) {
|
|
143
|
+
switchToDefaultBlockType(forward);
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
if (getParentListItemId(nextBlockClientId)) {
|
|
148
|
+
outdentListItem(nextBlockClientId);
|
|
149
|
+
} else {
|
|
150
|
+
registry.batch(() => {
|
|
151
|
+
moveBlocksToPosition(getBlockOrder(nextBlockClientId), nextBlockClientId, getPreviousBlockClientId(nextBlockClientId));
|
|
152
|
+
mergeBlocks(clientId, nextBlockClientId);
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
} else {
|
|
156
|
+
// Merging is only done from the top level. For lowel levels, the
|
|
157
|
+
// list item is outdented instead.
|
|
158
|
+
const previousBlockClientId = getPreviousBlockClientId(clientId);
|
|
159
|
+
|
|
160
|
+
if (getParentListItemId(clientId)) {
|
|
161
|
+
outdentListItem(clientId);
|
|
162
|
+
} else if (previousBlockClientId) {
|
|
163
|
+
const trailingId = getTrailingId(previousBlockClientId);
|
|
164
|
+
registry.batch(() => {
|
|
165
|
+
moveBlocksToPosition(getBlockOrder(clientId), clientId, previousBlockClientId);
|
|
166
|
+
mergeBlocks(trailingId, clientId);
|
|
167
|
+
});
|
|
168
|
+
} else {
|
|
169
|
+
switchToDefaultBlockType(forward);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
//# sourceMappingURL=use-merge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/list-item/hooks/use-merge.js"],"names":["useMerge","clientId","registry","getPreviousBlockClientId","getNextBlockClientId","getBlockOrder","getBlockRootClientId","getBlockName","getBlock","blockEditorStore","mergeBlocks","moveBlocksToPosition","replaceBlock","selectBlock","outdentListItem","getTrailingId","id","order","length","getParentListItemId","listId","parentListItemId","listItemName","_getNextId","next","getNextId","switchToDefaultBlockType","forward","rootClientId","replacement","indexToSelect","initialPosition","batch","nextBlockClientId","previousBlockClientId","trailingId"],"mappings":"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","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRegistry, useDispatch, useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { getDefaultBlockName, switchToBlockType } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport useOutdentListItem from './use-outdent-list-item';\n\nimport { name as listItemName } from '../block.json';\n\nexport default function useMerge( clientId ) {\n\tconst registry = useRegistry();\n\tconst {\n\t\tgetPreviousBlockClientId,\n\t\tgetNextBlockClientId,\n\t\tgetBlockOrder,\n\t\tgetBlockRootClientId,\n\t\tgetBlockName,\n\t\tgetBlock,\n\t} = useSelect( blockEditorStore );\n\tconst { mergeBlocks, moveBlocksToPosition, replaceBlock, selectBlock } =\n\t\tuseDispatch( blockEditorStore );\n\tconst [ , outdentListItem ] = useOutdentListItem( clientId );\n\n\tfunction getTrailingId( id ) {\n\t\tconst order = getBlockOrder( id );\n\n\t\tif ( ! order.length ) {\n\t\t\treturn id;\n\t\t}\n\n\t\treturn getTrailingId( order[ order.length - 1 ] );\n\t}\n\n\tfunction getParentListItemId( id ) {\n\t\tconst listId = getBlockRootClientId( id );\n\t\tconst parentListItemId = getBlockRootClientId( listId );\n\t\tif ( ! parentListItemId ) return;\n\t\tif ( getBlockName( parentListItemId ) !== listItemName ) return;\n\t\treturn parentListItemId;\n\t}\n\n\t/**\n\t * Return the next list item with respect to the given list item. If none,\n\t * return the next list item of the parent list item if it exists.\n\t *\n\t * @param {string} id A list item client ID.\n\t * @return {string?} The client ID of the next list item.\n\t */\n\tfunction _getNextId( id ) {\n\t\tconst next = getNextBlockClientId( id );\n\t\tif ( next ) return next;\n\t\tconst parentListItemId = getParentListItemId( id );\n\t\tif ( ! parentListItemId ) return;\n\t\treturn _getNextId( parentListItemId );\n\t}\n\n\t/**\n\t * Given a client ID, return the client ID of the list item on the next\n\t * line, regardless of indentation level.\n\t *\n\t * @param {string} id The client ID of the current list item.\n\t * @return {string?} The client ID of the next list item.\n\t */\n\tfunction getNextId( id ) {\n\t\tconst order = getBlockOrder( id );\n\n\t\t// If the list item does not have a nested list, return the next list\n\t\t// item.\n\t\tif ( ! order.length ) {\n\t\t\treturn _getNextId( id );\n\t\t}\n\n\t\t// Get the first list item in the nested list.\n\t\treturn getBlockOrder( order[ 0 ] )[ 0 ];\n\t}\n\n\tfunction switchToDefaultBlockType( forward ) {\n\t\tconst rootClientId = getBlockRootClientId( clientId );\n\t\tconst replacement = switchToBlockType(\n\t\t\tgetBlock( rootClientId ),\n\t\t\tgetDefaultBlockName()\n\t\t);\n\t\tconst indexToSelect = forward ? replacement.length - 1 : 0;\n\t\tconst initialPosition = forward ? -1 : 0;\n\t\tregistry.batch( () => {\n\t\t\treplaceBlock( rootClientId, replacement );\n\t\t\tselectBlock(\n\t\t\t\treplacement[ indexToSelect ].clientId,\n\t\t\t\tinitialPosition\n\t\t\t);\n\t\t} );\n\t}\n\n\treturn ( forward ) => {\n\t\tif ( forward ) {\n\t\t\tconst nextBlockClientId = getNextId( clientId );\n\n\t\t\tif ( ! nextBlockClientId ) {\n\t\t\t\tswitchToDefaultBlockType( forward );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( getParentListItemId( nextBlockClientId ) ) {\n\t\t\t\toutdentListItem( nextBlockClientId );\n\t\t\t} else {\n\t\t\t\tregistry.batch( () => {\n\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\tgetBlockOrder( nextBlockClientId ),\n\t\t\t\t\t\tnextBlockClientId,\n\t\t\t\t\t\tgetPreviousBlockClientId( nextBlockClientId )\n\t\t\t\t\t);\n\t\t\t\t\tmergeBlocks( clientId, nextBlockClientId );\n\t\t\t\t} );\n\t\t\t}\n\t\t} else {\n\t\t\t// Merging is only done from the top level. For lowel levels, the\n\t\t\t// list item is outdented instead.\n\t\t\tconst previousBlockClientId = getPreviousBlockClientId( clientId );\n\t\t\tif ( getParentListItemId( clientId ) ) {\n\t\t\t\toutdentListItem( clientId );\n\t\t\t} else if ( previousBlockClientId ) {\n\t\t\t\tconst trailingId = getTrailingId( previousBlockClientId );\n\t\t\t\tregistry.batch( () => {\n\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\tgetBlockOrder( clientId ),\n\t\t\t\t\t\tclientId,\n\t\t\t\t\t\tpreviousBlockClientId\n\t\t\t\t\t);\n\t\t\t\t\tmergeBlocks( trailingId, clientId );\n\t\t\t\t} );\n\t\t\t} else {\n\t\t\t\tswitchToDefaultBlockType( forward );\n\t\t\t}\n\t\t}\n\t};\n}\n"]}
|
|
@@ -15,8 +15,6 @@ var _blockEditor = require("@wordpress/block-editor");
|
|
|
15
15
|
|
|
16
16
|
var _blocks = require("@wordpress/blocks");
|
|
17
17
|
|
|
18
|
-
var _utils = require("../utils");
|
|
19
|
-
|
|
20
18
|
/**
|
|
21
19
|
* External dependencies
|
|
22
20
|
*/
|
|
@@ -28,7 +26,38 @@ var _utils = require("../utils");
|
|
|
28
26
|
/**
|
|
29
27
|
* Internal dependencies
|
|
30
28
|
*/
|
|
29
|
+
const {
|
|
30
|
+
name: listItemName
|
|
31
|
+
} = {
|
|
32
|
+
$schema: "https://schemas.wp.org/trunk/block.json",
|
|
33
|
+
apiVersion: 2,
|
|
34
|
+
__experimental: "list-v2",
|
|
35
|
+
name: "core/list-item",
|
|
36
|
+
title: "List item",
|
|
37
|
+
category: "text",
|
|
38
|
+
parent: ["core/list"],
|
|
39
|
+
description: "Create a list item.",
|
|
40
|
+
textdomain: "default",
|
|
41
|
+
attributes: {
|
|
42
|
+
placeholder: {
|
|
43
|
+
type: "string"
|
|
44
|
+
},
|
|
45
|
+
content: {
|
|
46
|
+
type: "string",
|
|
47
|
+
source: "html",
|
|
48
|
+
selector: "li",
|
|
49
|
+
"default": "",
|
|
50
|
+
__experimentalRole: "content"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
supports: {
|
|
54
|
+
className: false,
|
|
55
|
+
__experimentalSelector: "li"
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
|
|
31
59
|
function useOutdentListItem(clientId) {
|
|
60
|
+
const registry = (0, _data.useRegistry)();
|
|
32
61
|
const {
|
|
33
62
|
canOutdent
|
|
34
63
|
} = (0, _data.useSelect)(innerSelect => {
|
|
@@ -41,58 +70,65 @@ function useOutdentListItem(clientId) {
|
|
|
41
70
|
};
|
|
42
71
|
}, [clientId]);
|
|
43
72
|
const {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
73
|
+
moveBlocksToPosition,
|
|
74
|
+
removeBlock,
|
|
75
|
+
insertBlock,
|
|
76
|
+
updateBlockListSettings
|
|
47
77
|
} = (0, _data.useDispatch)(_blockEditor.store);
|
|
48
78
|
const {
|
|
49
79
|
getBlockRootClientId,
|
|
50
|
-
|
|
51
|
-
|
|
80
|
+
getBlockName,
|
|
81
|
+
getBlockOrder,
|
|
52
82
|
getBlockIndex,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
getMultiSelectedBlockClientIds
|
|
83
|
+
getSelectedBlockClientIds,
|
|
84
|
+
getBlock,
|
|
85
|
+
getBlockListSettings
|
|
57
86
|
} = (0, _data.useSelect)(_blockEditor.store);
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
const
|
|
78
|
-
const
|
|
79
|
-
const
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
87
|
+
|
|
88
|
+
function getParentListItemId(id) {
|
|
89
|
+
const listId = getBlockRootClientId(id);
|
|
90
|
+
const parentListItemId = getBlockRootClientId(listId);
|
|
91
|
+
if (!parentListItemId) return;
|
|
92
|
+
if (getBlockName(parentListItemId) !== listItemName) return;
|
|
93
|
+
return parentListItemId;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
return [canOutdent, (0, _element.useCallback)(function () {
|
|
97
|
+
let clientIds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getSelectedBlockClientIds();
|
|
98
|
+
clientIds = (0, _lodash.castArray)(clientIds);
|
|
99
|
+
if (!clientIds.length) return;
|
|
100
|
+
const firstClientId = (0, _lodash.first)(clientIds); // Can't outdent if it's not a list item.
|
|
101
|
+
|
|
102
|
+
if (getBlockName(firstClientId) !== listItemName) return;
|
|
103
|
+
const parentListItemId = getParentListItemId(firstClientId); // Can't outdent if it's at the top level.
|
|
104
|
+
|
|
105
|
+
if (!parentListItemId) return;
|
|
106
|
+
const parentListId = getBlockRootClientId(firstClientId);
|
|
107
|
+
const lastClientId = (0, _lodash.last)(clientIds);
|
|
108
|
+
const order = getBlockOrder(parentListId);
|
|
109
|
+
const followingListItems = order.slice(getBlockIndex(lastClientId) + 1);
|
|
110
|
+
registry.batch(() => {
|
|
111
|
+
if (followingListItems.length) {
|
|
112
|
+
let nestedListId = (0, _lodash.first)(getBlockOrder(firstClientId));
|
|
113
|
+
|
|
114
|
+
if (!nestedListId) {
|
|
115
|
+
const nestedListBlock = (0, _blocks.cloneBlock)(getBlock(parentListId), {}, []);
|
|
116
|
+
nestedListId = nestedListBlock.clientId;
|
|
117
|
+
insertBlock(nestedListBlock, 0, firstClientId, false); // Immediately update the block list settings, otherwise
|
|
118
|
+
// blocks can't be moved here due to canInsert checks.
|
|
119
|
+
|
|
120
|
+
updateBlockListSettings(nestedListId, getBlockListSettings(parentListId));
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
moveBlocksToPosition(followingListItems, parentListId, nestedListId);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
moveBlocksToPosition(clientIds, parentListId, getBlockRootClientId(parentListItemId), getBlockIndex(parentListItemId) + 1);
|
|
127
|
+
|
|
128
|
+
if (!getBlockOrder(parentListId).length) {
|
|
129
|
+
removeBlock(parentListId);
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
}, [])];
|
|
97
133
|
}
|
|
98
134
|
//# sourceMappingURL=use-outdent-list-item.js.map
|