@wordpress/block-library 7.12.0 → 7.13.1-next.957ca95e4c.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 +7 -1
- package/build/archives/index.js +5 -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/button/deprecated.js +14 -5
- package/build/button/deprecated.js.map +1 -1
- package/build/button/index.js +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 +6 -2
- 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/columns/transforms.js +10 -1
- package/build/columns/transforms.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/index.js +13 -0
- package/build/comments/index.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/block-controls.js +9 -2
- package/build/cover/edit/block-controls.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/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 +15 -2
- package/build/gallery/edit.js.map +1 -1
- package/build/gallery/gap-styles.js +5 -4
- package/build/gallery/gap-styles.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/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 +10 -2
- package/build/group/index.js.map +1 -1
- package/build/group/variations.js +8 -8
- 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/home-link/index.js +14 -1
- package/build/home-link/index.js.map +1 -1
- package/build/image/edit.js +16 -2
- package/build/image/edit.js.map +1 -1
- package/build/image/index.js +13 -7
- package/build/image/index.js.map +1 -1
- package/build/image/use-client-width.js +3 -1
- package/build/image/use-client-width.js.map +1 -1
- package/build/index.js +1 -1
- package/build/index.js.map +1 -1
- package/build/index.native.js +9 -18
- package/build/index.native.js.map +1 -1
- package/build/latest-posts/deprecated.js +14 -1
- package/build/latest-posts/deprecated.js.map +1 -1
- package/build/latest-posts/index.js +14 -1
- package/build/latest-posts/index.js.map +1 -1
- package/build/list/deprecated.js +84 -1
- package/build/list/deprecated.js.map +1 -1
- package/build/list/edit.js +153 -134
- package/build/list/edit.js.map +1 -1
- package/build/list/index.js +33 -34
- package/build/list/index.js.map +1 -1
- package/build/list/save.js +1 -5
- package/build/list/save.js.map +1 -1
- package/build/list/{v2/tag-name.js → tag-name.js} +0 -0
- package/build/list/tag-name.js.map +1 -0
- package/build/list/{v2/tag-name.native.js → tag-name.native.js} +0 -0
- package/build/list/tag-name.native.js.map +1 -0
- package/build/list/transforms.js +61 -95
- package/build/list/transforms.js.map +1 -1
- package/build/list/{v2/migrate.js → utils.js} +3 -2
- package/build/list/utils.js.map +1 -0
- package/build/list-item/edit.js +3 -1
- package/build/list-item/edit.js.map +1 -1
- package/build/list-item/edit.native.js +21 -3
- package/build/list-item/edit.native.js.map +1 -1
- package/build/list-item/hooks/index.js +8 -0
- package/build/list-item/hooks/index.js.map +1 -1
- package/build/list-item/hooks/use-copy.js +44 -0
- package/build/list-item/hooks/use-copy.js.map +1 -0
- package/build/list-item/hooks/use-merge.js +0 -1
- package/build/list-item/hooks/use-merge.js.map +1 -1
- package/build/list-item/hooks/use-outdent-list-item.js +0 -1
- package/build/list-item/hooks/use-outdent-list-item.js.map +1 -1
- package/build/list-item/hooks/use-space.js +10 -1
- package/build/list-item/hooks/use-space.js.map +1 -1
- package/build/list-item/index.js +0 -1
- package/build/list-item/index.js.map +1 -1
- package/build/list-item/list-style-type.native.js +4 -1
- package/build/list-item/list-style-type.native.js.map +1 -1
- package/build/list-item/utils.js +4 -1
- package/build/list-item/utils.js.map +1 -1
- package/build/media-text/deprecated.js +5 -1
- package/build/media-text/deprecated.js.map +1 -1
- package/build/media-text/index.js +17 -0
- package/build/media-text/index.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 +125 -41
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/responsive-wrapper.js +6 -4
- package/build/navigation/edit/responsive-wrapper.js.map +1 -1
- package/build/navigation/edit/unsaved-inner-blocks.js +6 -16
- 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/index.js +1 -0
- package/build/navigation/index.js.map +1 -1
- 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 +8 -7
- package/build/navigation/use-navigation-menu.js.map +1 -1
- package/build/navigation-link/edit.js +6 -8
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-submenu/edit.js +4 -6
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/page-list/edit.js +7 -3
- 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 +1 -0
- package/build/paragraph/edit.js.map +1 -1
- package/build/paragraph/index.js +7 -0
- package/build/paragraph/index.js.map +1 -1
- package/build/paragraph/transforms.js +7 -0
- package/build/paragraph/transforms.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/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-link/index.js +4 -2
- package/build/post-comments-link/index.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-excerpt/index.js +4 -2
- package/build/post-excerpt/index.js.map +1 -1
- package/build/post-featured-image/edit.js +27 -12
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/post-featured-image/index.js +12 -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 +0 -1
- 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-terms/use-post-terms.js +4 -24
- package/build/post-terms/use-post-terms.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/taxonomy-controls.js +1 -0
- 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 +1 -1
- package/build/query-no-results/edit.js.map +1 -1
- package/build/query-no-results/index.js +13 -0
- package/build/query-no-results/index.js.map +1 -1
- package/build/query-pagination-numbers/index.js +4 -2
- package/build/query-pagination-numbers/index.js.map +1 -1
- package/build/query-title/edit.js +10 -1
- package/build/query-title/edit.js.map +1 -1
- package/build/query-title/index.js +8 -2
- package/build/query-title/index.js.map +1 -1
- package/build/quote/deprecated.js +13 -6
- package/build/quote/deprecated.js.map +1 -1
- package/build/quote/index.js +4 -2
- package/build/quote/index.js.map +1 -1
- package/build/quote/transforms.js +22 -37
- 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/index.js +1 -0
- package/build/separator/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-links/edit.js +43 -9
- package/build/social-links/edit.js.map +1 -1
- package/build/social-links/index.js +9 -0
- package/build/social-links/index.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 +24 -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/index.js +2 -2
- package/build/template-part/index.js.map +1 -1
- package/build/term-description/index.js +10 -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 +2 -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/index.js +5 -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/button/deprecated.js +14 -4
- package/build-module/button/deprecated.js.map +1 -1
- package/build-module/button/index.js +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 +7 -3
- 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/columns/transforms.js +10 -1
- package/build-module/columns/transforms.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/index.js +13 -0
- package/build-module/comments/index.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/block-controls.js +10 -3
- package/build-module/cover/edit/block-controls.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/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 +15 -2
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/gallery/gap-styles.js +6 -5
- package/build-module/gallery/gap-styles.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/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 +10 -2
- package/build-module/group/index.js.map +1 -1
- package/build-module/group/variations.js +8 -8
- 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/home-link/index.js +14 -1
- package/build-module/home-link/index.js.map +1 -1
- package/build-module/image/edit.js +18 -4
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/index.js +13 -7
- package/build-module/image/index.js.map +1 -1
- package/build-module/image/use-client-width.js +3 -1
- package/build-module/image/use-client-width.js.map +1 -1
- package/build-module/index.js +1 -1
- package/build-module/index.js.map +1 -1
- package/build-module/index.native.js +9 -17
- package/build-module/index.native.js.map +1 -1
- package/build-module/latest-posts/deprecated.js +14 -1
- package/build-module/latest-posts/deprecated.js.map +1 -1
- package/build-module/latest-posts/index.js +14 -1
- package/build-module/latest-posts/index.js.map +1 -1
- package/build-module/list/deprecated.js +83 -1
- package/build-module/list/deprecated.js.map +1 -1
- package/build-module/list/edit.js +151 -134
- package/build-module/list/edit.js.map +1 -1
- package/build-module/list/index.js +33 -29
- package/build-module/list/index.js.map +1 -1
- package/build-module/list/save.js +2 -6
- package/build-module/list/save.js.map +1 -1
- package/build-module/list/{v2/tag-name.js → tag-name.js} +0 -0
- package/build-module/list/tag-name.js.map +1 -0
- package/build-module/list/{v2/tag-name.native.js → tag-name.native.js} +0 -0
- package/build-module/list/tag-name.native.js.map +1 -0
- package/build-module/list/transforms.js +62 -97
- package/build-module/list/transforms.js.map +1 -1
- package/build-module/list/{v2/migrate.js → utils.js} +3 -2
- package/build-module/list/utils.js.map +1 -0
- package/build-module/list-item/edit.js +4 -2
- package/build-module/list-item/edit.js.map +1 -1
- package/build-module/list-item/edit.native.js +19 -3
- package/build-module/list-item/edit.native.js.map +1 -1
- package/build-module/list-item/hooks/index.js +1 -0
- package/build-module/list-item/hooks/index.js.map +1 -1
- package/build-module/list-item/hooks/use-copy.js +34 -0
- package/build-module/list-item/hooks/use-copy.js.map +1 -0
- package/build-module/list-item/hooks/use-merge.js +0 -1
- package/build-module/list-item/hooks/use-merge.js.map +1 -1
- package/build-module/list-item/hooks/use-outdent-list-item.js +0 -1
- package/build-module/list-item/hooks/use-outdent-list-item.js.map +1 -1
- package/build-module/list-item/hooks/use-space.js +10 -1
- package/build-module/list-item/hooks/use-space.js.map +1 -1
- package/build-module/list-item/index.js +0 -1
- package/build-module/list-item/index.js.map +1 -1
- package/build-module/list-item/list-style-type.native.js +3 -1
- package/build-module/list-item/list-style-type.native.js.map +1 -1
- package/build-module/list-item/utils.js +4 -1
- package/build-module/list-item/utils.js.map +1 -1
- package/build-module/media-text/deprecated.js +6 -2
- package/build-module/media-text/deprecated.js.map +1 -1
- package/build-module/media-text/index.js +17 -0
- package/build-module/media-text/index.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 +125 -43
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/responsive-wrapper.js +6 -4
- package/build-module/navigation/edit/responsive-wrapper.js.map +1 -1
- package/build-module/navigation/edit/unsaved-inner-blocks.js +7 -16
- 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/index.js +1 -0
- package/build-module/navigation/index.js.map +1 -1
- 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 +8 -7
- package/build-module/navigation/use-navigation-menu.js.map +1 -1
- package/build-module/navigation-link/edit.js +7 -9
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +5 -7
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/page-list/edit.js +7 -2
- 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 +1 -0
- package/build-module/paragraph/edit.js.map +1 -1
- package/build-module/paragraph/index.js +7 -0
- package/build-module/paragraph/index.js.map +1 -1
- package/build-module/paragraph/transforms.js +7 -0
- package/build-module/paragraph/transforms.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/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-link/index.js +4 -2
- package/build-module/post-comments-link/index.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-excerpt/index.js +4 -2
- package/build-module/post-excerpt/index.js.map +1 -1
- package/build-module/post-featured-image/edit.js +28 -13
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/post-featured-image/index.js +12 -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 +0 -1
- 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-terms/use-post-terms.js +5 -25
- package/build-module/post-terms/use-post-terms.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/taxonomy-controls.js +1 -0
- 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 +1 -1
- package/build-module/query-no-results/edit.js.map +1 -1
- package/build-module/query-no-results/index.js +13 -0
- package/build-module/query-no-results/index.js.map +1 -1
- package/build-module/query-pagination-numbers/index.js +4 -2
- package/build-module/query-pagination-numbers/index.js.map +1 -1
- package/build-module/query-title/edit.js +10 -1
- package/build-module/query-title/edit.js.map +1 -1
- package/build-module/query-title/index.js +8 -2
- package/build-module/query-title/index.js.map +1 -1
- package/build-module/quote/deprecated.js +13 -5
- package/build-module/quote/deprecated.js.map +1 -1
- package/build-module/quote/index.js +4 -2
- package/build-module/quote/index.js.map +1 -1
- package/build-module/quote/transforms.js +23 -38
- 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/index.js +1 -0
- package/build-module/separator/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-links/edit.js +45 -12
- package/build-module/social-links/edit.js.map +1 -1
- package/build-module/social-links/index.js +9 -0
- package/build-module/social-links/index.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 +24 -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/index.js +2 -2
- package/build-module/template-part/index.js.map +1 -1
- package/build-module/term-description/index.js +10 -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 +2 -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 -10
- package/build-style/button/style.css +7 -10
- package/build-style/code/editor-rtl.css +79 -0
- package/build-style/code/editor.css +79 -0
- package/build-style/cover/editor-rtl.css +0 -3
- package/build-style/cover/editor.css +0 -3
- package/build-style/editor-rtl.css +94 -146
- package/build-style/editor.css +94 -146
- package/build-style/group/editor-rtl.css +9 -10
- package/build-style/group/editor.css +9 -10
- package/build-style/image/editor-rtl.css +21 -2
- package/build-style/image/editor.css +21 -2
- package/build-style/media-text/style-rtl.css +1 -0
- package/build-style/media-text/style.css +1 -0
- package/build-style/navigation/editor-rtl.css +11 -23
- package/build-style/navigation/editor.css +11 -23
- package/build-style/navigation/style-rtl.css +10 -3
- package/build-style/navigation/style.css +10 -3
- package/build-style/paragraph/editor-rtl.css +1 -1
- package/build-style/paragraph/editor.css +1 -1
- package/build-style/post-date/style-rtl.css +79 -0
- package/build-style/post-date/style.css +79 -0
- 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-title/style-rtl.css +79 -0
- package/build-style/query-title/style.css +79 -0
- package/build-style/site-logo/editor-rtl.css +3 -52
- package/build-style/site-logo/editor.css +3 -52
- package/build-style/social-links/style-rtl.css +2 -2
- package/build-style/social-links/style.css +2 -2
- package/build-style/style-rtl.css +37 -23
- package/build-style/style.css +37 -23
- package/build-style/video/style-rtl.css +3 -0
- package/build-style/video/style.css +3 -0
- package/package.json +30 -29
- package/src/archives/block.json +5 -1
- package/src/audio/block.json +4 -0
- package/src/audio/style.scss +2 -0
- package/src/button/block.json +1 -1
- package/src/button/deprecated.js +21 -22
- package/src/button/style.scss +7 -14
- 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/code/editor.scss +3 -0
- 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 +7 -3
- package/src/columns/transforms.js +17 -3
- 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 +13 -0
- package/src/comments/index.php +6 -5
- 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/cover/block.json +13 -0
- package/src/cover/deprecated.js +11 -4
- package/src/cover/edit/block-controls.js +15 -3
- package/src/cover/editor.scss +0 -4
- package/src/cover/shared.js +2 -1
- package/src/editor.scss +1 -0
- package/src/embed/icons.js +1 -1
- package/src/gallery/block.json +5 -0
- package/src/gallery/deprecated.js +4 -2
- package/src/gallery/edit.js +22 -2
- package/src/gallery/gap-styles.js +10 -6
- package/src/gallery/index.php +23 -2
- package/src/gallery/transforms.js +18 -5
- package/src/gallery/utils.js +11 -7
- package/src/group/block.json +10 -2
- package/src/group/deprecated.js +89 -2
- package/src/group/edit.js +15 -2
- package/src/group/editor.scss +4 -6
- package/src/group/variations.js +4 -3
- package/src/heading/block.json +3 -1
- package/src/heading/deprecated.js +4 -2
- package/src/home-link/block.json +14 -1
- package/src/home-link/edit.js +19 -20
- package/src/image/block.json +13 -7
- package/src/image/edit.js +22 -4
- package/src/image/editor.scss +39 -3
- package/src/image/index.php +1 -1
- package/src/image/use-client-width.js +1 -1
- package/src/index.js +1 -4
- package/src/index.native.js +17 -23
- package/src/latest-posts/block.json +14 -1
- package/src/list/block.json +4 -0
- package/src/list/deprecated.js +71 -1
- package/src/list/edit.js +146 -133
- package/src/list/index.js +25 -24
- package/src/list/save.js +3 -4
- package/src/list/{v2/tag-name.js → tag-name.js} +0 -0
- package/src/list/{v2/tag-name.native.js → tag-name.native.js} +0 -0
- package/src/list/test/__snapshots__/edit.native.js.snap +14 -2
- package/src/list/test/edit.native.js +0 -154
- package/src/list/transforms.js +57 -111
- package/src/list/{v2/migrate.js → utils.js} +2 -2
- package/src/list-item/block.json +0 -1
- package/src/list-item/edit.js +2 -1
- package/src/list-item/edit.native.js +32 -2
- package/src/list-item/hooks/index.js +1 -0
- package/src/list-item/hooks/use-copy.js +38 -0
- package/src/list-item/hooks/use-space.js +10 -2
- package/src/list-item/list-style-type.native.js +8 -1
- package/src/list-item/style.native.scss +12 -0
- package/src/media-text/block.json +17 -0
- package/src/media-text/deprecated.js +3 -2
- package/src/media-text/style.scss +2 -0
- package/src/navigation/block.json +1 -0
- package/src/navigation/deprecated.js +4 -2
- package/src/navigation/edit/index.js +173 -85
- package/src/navigation/edit/responsive-wrapper.js +8 -3
- package/src/navigation/edit/unsaved-inner-blocks.js +17 -25
- package/src/navigation/edit/use-convert-classic-menu-to-block-menu.js +31 -37
- package/src/navigation/editor.scss +5 -25
- package/src/navigation/index.php +24 -24
- package/src/navigation/menu-items-to-blocks.js +3 -6
- package/src/navigation/style.scss +14 -4
- package/src/navigation/test/use-navigation-menu.js +18 -1
- package/src/navigation/use-navigation-menu.js +11 -8
- package/src/navigation-link/edit.js +9 -13
- package/src/navigation-submenu/edit.js +9 -13
- package/src/page-list/edit.js +6 -2
- package/src/paragraph/block.json +7 -0
- package/src/paragraph/deprecated.js +33 -35
- package/src/paragraph/edit.js +1 -0
- package/src/paragraph/editor.scss +5 -3
- package/src/post-author/block.json +4 -2
- package/src/post-author-biography/block.json +1 -0
- 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-link/block.json +4 -2
- 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-excerpt/block.json +4 -2
- package/src/post-featured-image/block.json +12 -0
- package/src/post-featured-image/edit.js +43 -13
- package/src/post-featured-image/editor.scss +44 -53
- package/src/post-featured-image/index.php +61 -4
- 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 +0 -1
- package/src/post-terms/use-post-terms.js +10 -15
- package/src/post-title/block.json +2 -1
- package/src/post-title/style.scss +2 -0
- package/src/preformatted/block.json +4 -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/taxonomy-controls.js +1 -1
- package/src/query/edit/query-placeholder.js +17 -2
- package/src/query/utils.js +29 -7
- package/src/query-no-results/block.json +13 -0
- package/src/query-no-results/edit.js +1 -1
- package/src/query-pagination-numbers/block.json +4 -2
- package/src/query-title/block.json +8 -2
- package/src/query-title/edit.js +19 -2
- package/src/query-title/index.php +11 -1
- package/src/query-title/style.scss +4 -0
- package/src/quote/block.json +4 -2
- package/src/quote/deprecated.js +6 -5
- package/src/quote/transforms.js +4 -18
- package/src/search/index.php +1 -1
- package/src/separator/block.json +1 -0
- package/src/separator/deprecated.js +2 -3
- package/src/site-logo/editor.scss +8 -66
- package/src/social-link/icons/reddit.js +1 -1
- package/src/social-link/index.php +1 -1
- package/src/social-link/socials-with-bg.scss +1 -1
- package/src/social-link/socials-without-bg.scss +1 -1
- package/src/social-links/block.json +9 -0
- package/src/social-links/edit.js +47 -19
- package/src/spacer/block.json +7 -1
- package/src/style.scss +2 -0
- package/src/table/block.json +4 -0
- package/src/table/state.js +21 -19
- package/src/table-of-contents/block.json +24 -1
- package/src/tag-cloud/block.json +5 -1
- package/src/template-part/index.js +3 -2
- package/src/term-description/block.json +10 -0
- package/src/text-columns/edit.js +2 -2
- package/src/text-columns/save.js +2 -2
- package/src/verse/block.json +2 -0
- package/src/video/block.json +4 -0
- package/src/video/style.scss +2 -0
- package/build/list/v2/deprecated.js +0 -117
- package/build/list/v2/deprecated.js.map +0 -1
- package/build/list/v2/edit.js +0 -200
- package/build/list/v2/edit.js.map +0 -1
- package/build/list/v2/index.js +0 -36
- package/build/list/v2/index.js.map +0 -1
- package/build/list/v2/migrate.js.map +0 -1
- package/build/list/v2/save.js +0 -34
- package/build/list/v2/save.js.map +0 -1
- package/build/list/v2/tag-name.js.map +0 -1
- package/build/list/v2/tag-name.native.js.map +0 -1
- package/build/list/v2/transforms.js +0 -137
- package/build/list/v2/transforms.js.map +0 -1
- package/build-module/list/v2/deprecated.js +0 -104
- package/build-module/list/v2/deprecated.js.map +0 -1
- package/build-module/list/v2/edit.js +0 -179
- package/build-module/list/v2/edit.js.map +0 -1
- package/build-module/list/v2/index.js +0 -21
- package/build-module/list/v2/index.js.map +0 -1
- package/build-module/list/v2/migrate.js.map +0 -1
- package/build-module/list/v2/save.js +0 -23
- package/build-module/list/v2/save.js.map +0 -1
- package/build-module/list/v2/tag-name.js.map +0 -1
- package/build-module/list/v2/tag-name.native.js.map +0 -1
- package/build-module/list/v2/transforms.js +0 -127
- package/build-module/list/v2/transforms.js.map +0 -1
- package/src/list/test/migrate.js +0 -158
- package/src/list/v2/deprecated.js +0 -89
- package/src/list/v2/edit.js +0 -192
- package/src/list/v2/index.js +0 -22
- package/src/list/v2/save.js +0 -18
- package/src/list/v2/transforms.js +0 -120
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { createElement } from "@wordpress/element";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* WordPress dependencies
|
|
5
|
-
*/
|
|
6
|
-
import { RichText, useBlockProps } from '@wordpress/block-editor';
|
|
7
|
-
/**
|
|
8
|
-
* Internal dependencies
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import initialDeprecations from '../deprecated';
|
|
12
|
-
import { migrateToListV2 } from './migrate';
|
|
13
|
-
const v1 = {
|
|
14
|
-
attributes: {
|
|
15
|
-
ordered: {
|
|
16
|
-
type: 'boolean',
|
|
17
|
-
default: false,
|
|
18
|
-
__experimentalRole: 'content'
|
|
19
|
-
},
|
|
20
|
-
values: {
|
|
21
|
-
type: 'string',
|
|
22
|
-
source: 'html',
|
|
23
|
-
selector: 'ol,ul',
|
|
24
|
-
multiline: 'li',
|
|
25
|
-
__unstableMultilineWrapperTags: ['ol', 'ul'],
|
|
26
|
-
default: '',
|
|
27
|
-
__experimentalRole: 'content'
|
|
28
|
-
},
|
|
29
|
-
type: {
|
|
30
|
-
type: 'string'
|
|
31
|
-
},
|
|
32
|
-
start: {
|
|
33
|
-
type: 'number'
|
|
34
|
-
},
|
|
35
|
-
reversed: {
|
|
36
|
-
type: 'boolean'
|
|
37
|
-
},
|
|
38
|
-
placeholder: {
|
|
39
|
-
type: 'string'
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
supports: {
|
|
43
|
-
anchor: true,
|
|
44
|
-
className: false,
|
|
45
|
-
typography: {
|
|
46
|
-
fontSize: true,
|
|
47
|
-
__experimentalFontFamily: true,
|
|
48
|
-
lineHeight: true,
|
|
49
|
-
__experimentalFontStyle: true,
|
|
50
|
-
__experimentalFontWeight: true,
|
|
51
|
-
__experimentalLetterSpacing: true,
|
|
52
|
-
__experimentalTextTransform: true,
|
|
53
|
-
__experimentalDefaultControls: {
|
|
54
|
-
fontSize: true
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
color: {
|
|
58
|
-
gradients: true,
|
|
59
|
-
link: true,
|
|
60
|
-
__experimentalDefaultControls: {
|
|
61
|
-
background: true,
|
|
62
|
-
text: true
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
__unstablePasteTextInline: true,
|
|
66
|
-
__experimentalSelector: 'ol,ul',
|
|
67
|
-
__experimentalSlashInserter: true
|
|
68
|
-
},
|
|
69
|
-
|
|
70
|
-
save(_ref) {
|
|
71
|
-
let {
|
|
72
|
-
attributes
|
|
73
|
-
} = _ref;
|
|
74
|
-
const {
|
|
75
|
-
ordered,
|
|
76
|
-
values,
|
|
77
|
-
type,
|
|
78
|
-
reversed,
|
|
79
|
-
start
|
|
80
|
-
} = attributes;
|
|
81
|
-
const TagName = ordered ? 'ol' : 'ul';
|
|
82
|
-
return createElement(TagName, useBlockProps.save({
|
|
83
|
-
type,
|
|
84
|
-
reversed,
|
|
85
|
-
start
|
|
86
|
-
}), createElement(RichText.Content, {
|
|
87
|
-
value: values,
|
|
88
|
-
multiline: "li"
|
|
89
|
-
}));
|
|
90
|
-
},
|
|
91
|
-
|
|
92
|
-
migrate: migrateToListV2
|
|
93
|
-
};
|
|
94
|
-
/**
|
|
95
|
-
* New deprecations need to be placed first
|
|
96
|
-
* for them to have higher priority.
|
|
97
|
-
*
|
|
98
|
-
* Old deprecations may need to be updated as well.
|
|
99
|
-
*
|
|
100
|
-
* See block-deprecation.md
|
|
101
|
-
*/
|
|
102
|
-
|
|
103
|
-
export default [v1, ...initialDeprecations];
|
|
104
|
-
//# sourceMappingURL=deprecated.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/list/v2/deprecated.js"],"names":["RichText","useBlockProps","initialDeprecations","migrateToListV2","v1","attributes","ordered","type","default","__experimentalRole","values","source","selector","multiline","__unstableMultilineWrapperTags","start","reversed","placeholder","supports","anchor","className","typography","fontSize","__experimentalFontFamily","lineHeight","__experimentalFontStyle","__experimentalFontWeight","__experimentalLetterSpacing","__experimentalTextTransform","__experimentalDefaultControls","color","gradients","link","background","text","__unstablePasteTextInline","__experimentalSelector","__experimentalSlashInserter","save","TagName","migrate"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,QAAT,EAAmBC,aAAnB,QAAwC,yBAAxC;AAEA;AACA;AACA;;AACA,OAAOC,mBAAP,MAAgC,eAAhC;AACA,SAASC,eAAT,QAAgC,WAAhC;AAEA,MAAMC,EAAE,GAAG;AACVC,EAAAA,UAAU,EAAE;AACXC,IAAAA,OAAO,EAAE;AACRC,MAAAA,IAAI,EAAE,SADE;AAERC,MAAAA,OAAO,EAAE,KAFD;AAGRC,MAAAA,kBAAkB,EAAE;AAHZ,KADE;AAMXC,IAAAA,MAAM,EAAE;AACPH,MAAAA,IAAI,EAAE,QADC;AAEPI,MAAAA,MAAM,EA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,EAAAA,IAAI,OAAmB;AAAA,QAAjB;AAAEjC,MAAAA;AAAF,KAAiB;AACtB,UAAM;AAAEC,MAAAA,OAAF;AAAWI,MAAAA,MAAX;AAAmBH,MAAAA,IAAnB;AAAyBS,MAAAA,QAAzB;AAAmCD,MAAAA;AAAnC,QAA6CV,UAAnD;AACA,UAAMkC,OAAO,GAAGjC,OAAO,GAAG,IAAH,GAAU,IAAjC;AAEA,WACC,cAAC,OAAD,EAAcL,aAAa,CAACqC,IAAd,CAAoB;AAAE/B,MAAAA,IAAF;AAAQS,MAAAA,QAAR;AAAkBD,MAAAA;AAAlB,KAApB,CAAd,EACC,cAAC,QAAD,CAAU,OAAV;AAAkB,MAAA,KAAK,EAAGL,MAA1B;AAAmC,MAAA,SAAS,EAAC;AAA7C,MADD,CADD;AAKA,GAjES;;AAkEV8B,EAAAA,OAAO,EAAErC;AAlEC,CAAX;AAqEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,eAAe,CAAEC,EAAF,EAAM,GAAGF,mBAAT,CAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { RichText, useBlockProps } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport initialDeprecations from '../deprecated';\nimport { migrateToListV2 } from './migrate';\n\nconst v1 = {\n\tattributes: {\n\t\tordered: {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: false,\n\t\t\t__experimentalRole: 'content',\n\t\t},\n\t\tvalues: {\n\t\t\ttype: 'string',\n\t\t\tsource: 'html',\n\t\t\tselector: 'ol,ul',\n\t\t\tmultiline: 'li',\n\t\t\t__unstableMultilineWrapperTags: [ 'ol', 'ul' ],\n\t\t\tdefault: '',\n\t\t\t__experimentalRole: 'content',\n\t\t},\n\t\ttype: {\n\t\t\ttype: 'string',\n\t\t},\n\t\tstart: {\n\t\t\ttype: 'number',\n\t\t},\n\t\treversed: {\n\t\t\ttype: 'boolean',\n\t\t},\n\t\tplaceholder: {\n\t\t\ttype: 'string',\n\t\t},\n\t},\n\tsupports: {\n\t\tanchor: true,\n\t\tclassName: false,\n\t\ttypography: {\n\t\t\tfontSize: true,\n\t\t\t__experimentalFontFamily: true,\n\t\t\tlineHeight: true,\n\t\t\t__experimentalFontStyle: true,\n\t\t\t__experimentalFontWeight: true,\n\t\t\t__experimentalLetterSpacing: true,\n\t\t\t__experimentalTextTransform: true,\n\t\t\t__experimentalDefaultControls: {\n\t\t\t\tfontSize: true,\n\t\t\t},\n\t\t},\n\t\tcolor: {\n\t\t\tgradients: true,\n\t\t\tlink: true,\n\t\t\t__experimentalDefaultControls: {\n\t\t\t\tbackground: true,\n\t\t\t\ttext: true,\n\t\t\t},\n\t\t},\n\t\t__unstablePasteTextInline: true,\n\t\t__experimentalSelector: 'ol,ul',\n\t\t__experimentalSlashInserter: true,\n\t},\n\tsave( { attributes } ) {\n\t\tconst { ordered, values, type, reversed, start } = attributes;\n\t\tconst TagName = ordered ? 'ol' : 'ul';\n\n\t\treturn (\n\t\t\t<TagName { ...useBlockProps.save( { type, reversed, start } ) }>\n\t\t\t\t<RichText.Content value={ values } multiline=\"li\" />\n\t\t\t</TagName>\n\t\t);\n\t},\n\tmigrate: migrateToListV2,\n};\n\n/**\n * New deprecations need to be placed first\n * for them to have higher priority.\n *\n * Old deprecations may need to be updated as well.\n *\n * See block-deprecation.md\n */\nexport default [ v1, ...initialDeprecations ];\n"]}
|
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import { createElement, Fragment } from "@wordpress/element";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* External dependencies
|
|
6
|
-
*/
|
|
7
|
-
import { last } from 'lodash';
|
|
8
|
-
/**
|
|
9
|
-
* WordPress dependencies
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import { BlockControls, useBlockProps, useInnerBlocksProps, store as blockEditorStore } from '@wordpress/block-editor';
|
|
13
|
-
import { ToolbarButton } from '@wordpress/components';
|
|
14
|
-
import { useDispatch, useSelect, useRegistry } from '@wordpress/data';
|
|
15
|
-
import { isRTL, __ } from '@wordpress/i18n';
|
|
16
|
-
import { formatListBullets, formatListBulletsRTL, formatListNumbered, formatListNumberedRTL, formatOutdent, formatOutdentRTL } from '@wordpress/icons';
|
|
17
|
-
import { createBlock } from '@wordpress/blocks';
|
|
18
|
-
import { useCallback, useEffect, Platform } from '@wordpress/element';
|
|
19
|
-
import deprecated from '@wordpress/deprecated';
|
|
20
|
-
/**
|
|
21
|
-
* Internal dependencies
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
import OrderedListSettings from '../ordered-list-settings';
|
|
25
|
-
import { migrateToListV2 } from './migrate';
|
|
26
|
-
import TagName from './tag-name';
|
|
27
|
-
const TEMPLATE = [['core/list-item']];
|
|
28
|
-
const NATIVE_MARGIN_SPACING = 8;
|
|
29
|
-
/**
|
|
30
|
-
* At the moment, deprecations don't handle create blocks from attributes
|
|
31
|
-
* (like when using CPT templates). For this reason, this hook is necessary
|
|
32
|
-
* to avoid breaking templates using the old list block format.
|
|
33
|
-
*
|
|
34
|
-
* @param {Object} attributes Block attributes.
|
|
35
|
-
* @param {string} clientId Block client ID.
|
|
36
|
-
*/
|
|
37
|
-
|
|
38
|
-
function useMigrateOnLoad(attributes, clientId) {
|
|
39
|
-
const registry = useRegistry();
|
|
40
|
-
const {
|
|
41
|
-
updateBlockAttributes,
|
|
42
|
-
replaceInnerBlocks
|
|
43
|
-
} = useDispatch(blockEditorStore);
|
|
44
|
-
useEffect(() => {
|
|
45
|
-
// As soon as the block is loaded, migrate it to the new version.
|
|
46
|
-
if (!attributes.values) {
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
const [newAttributes, newInnerBlocks] = migrateToListV2(attributes);
|
|
51
|
-
deprecated('Value attribute on the list block', {
|
|
52
|
-
since: '6.0',
|
|
53
|
-
version: '6.5',
|
|
54
|
-
alternative: 'inner blocks'
|
|
55
|
-
});
|
|
56
|
-
registry.batch(() => {
|
|
57
|
-
updateBlockAttributes(clientId, newAttributes);
|
|
58
|
-
replaceInnerBlocks(clientId, newInnerBlocks);
|
|
59
|
-
});
|
|
60
|
-
}, [attributes.values]);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
function useOutdentList(clientId) {
|
|
64
|
-
const {
|
|
65
|
-
canOutdent
|
|
66
|
-
} = useSelect(innerSelect => {
|
|
67
|
-
const {
|
|
68
|
-
getBlockRootClientId,
|
|
69
|
-
getBlock
|
|
70
|
-
} = innerSelect(blockEditorStore);
|
|
71
|
-
const parentId = getBlockRootClientId(clientId);
|
|
72
|
-
return {
|
|
73
|
-
canOutdent: !!parentId && getBlock(parentId).name === 'core/list-item'
|
|
74
|
-
};
|
|
75
|
-
}, [clientId]);
|
|
76
|
-
const {
|
|
77
|
-
replaceBlocks,
|
|
78
|
-
selectionChange
|
|
79
|
-
} = useDispatch(blockEditorStore);
|
|
80
|
-
const {
|
|
81
|
-
getBlockRootClientId,
|
|
82
|
-
getBlockAttributes,
|
|
83
|
-
getBlock
|
|
84
|
-
} = useSelect(blockEditorStore);
|
|
85
|
-
return [canOutdent, useCallback(() => {
|
|
86
|
-
const parentBlockId = getBlockRootClientId(clientId);
|
|
87
|
-
const parentBlockAttributes = getBlockAttributes(parentBlockId); // Create a new parent block without the inner blocks.
|
|
88
|
-
|
|
89
|
-
const newParentBlock = createBlock('core/list-item', parentBlockAttributes);
|
|
90
|
-
const {
|
|
91
|
-
innerBlocks
|
|
92
|
-
} = getBlock(clientId); // Replace the parent block with a new parent block without inner blocks,
|
|
93
|
-
// and make the inner blocks siblings of the parent.
|
|
94
|
-
|
|
95
|
-
replaceBlocks([parentBlockId], [newParentBlock, ...innerBlocks]); // Select the last child of the list being outdent.
|
|
96
|
-
|
|
97
|
-
selectionChange(last(innerBlocks).clientId);
|
|
98
|
-
}, [clientId])];
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
function IndentUI(_ref) {
|
|
102
|
-
let {
|
|
103
|
-
clientId
|
|
104
|
-
} = _ref;
|
|
105
|
-
const [canOutdent, outdentList] = useOutdentList(clientId);
|
|
106
|
-
return createElement(Fragment, null, createElement(ToolbarButton, {
|
|
107
|
-
icon: isRTL() ? formatOutdentRTL : formatOutdent,
|
|
108
|
-
title: __('Outdent'),
|
|
109
|
-
describedBy: __('Outdent list item'),
|
|
110
|
-
disabled: !canOutdent,
|
|
111
|
-
onClick: outdentList
|
|
112
|
-
}));
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
function Edit(_ref2) {
|
|
116
|
-
let {
|
|
117
|
-
attributes,
|
|
118
|
-
setAttributes,
|
|
119
|
-
clientId,
|
|
120
|
-
style
|
|
121
|
-
} = _ref2;
|
|
122
|
-
const blockProps = useBlockProps({ ...(Platform.isNative && {
|
|
123
|
-
style
|
|
124
|
-
})
|
|
125
|
-
});
|
|
126
|
-
const innerBlocksProps = useInnerBlocksProps(blockProps, {
|
|
127
|
-
allowedBlocks: ['core/list-item'],
|
|
128
|
-
template: TEMPLATE,
|
|
129
|
-
templateInsertUpdatesSelection: true,
|
|
130
|
-
...(Platform.isNative && {
|
|
131
|
-
marginVertical: NATIVE_MARGIN_SPACING,
|
|
132
|
-
marginHorizontal: NATIVE_MARGIN_SPACING
|
|
133
|
-
})
|
|
134
|
-
});
|
|
135
|
-
useMigrateOnLoad(attributes, clientId);
|
|
136
|
-
const {
|
|
137
|
-
ordered,
|
|
138
|
-
reversed,
|
|
139
|
-
start
|
|
140
|
-
} = attributes;
|
|
141
|
-
const controls = createElement(BlockControls, {
|
|
142
|
-
group: "block"
|
|
143
|
-
}, createElement(ToolbarButton, {
|
|
144
|
-
icon: isRTL() ? formatListBulletsRTL : formatListBullets,
|
|
145
|
-
title: __('Unordered'),
|
|
146
|
-
describedBy: __('Convert to unordered list'),
|
|
147
|
-
isActive: ordered === false,
|
|
148
|
-
onClick: () => {
|
|
149
|
-
setAttributes({
|
|
150
|
-
ordered: false
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
}), createElement(ToolbarButton, {
|
|
154
|
-
icon: isRTL() ? formatListNumberedRTL : formatListNumbered,
|
|
155
|
-
title: __('Ordered'),
|
|
156
|
-
describedBy: __('Convert to ordered list'),
|
|
157
|
-
isActive: ordered === true,
|
|
158
|
-
onClick: () => {
|
|
159
|
-
setAttributes({
|
|
160
|
-
ordered: true
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
}), createElement(IndentUI, {
|
|
164
|
-
clientId: clientId
|
|
165
|
-
}));
|
|
166
|
-
return createElement(Fragment, null, createElement(TagName, _extends({
|
|
167
|
-
ordered: ordered,
|
|
168
|
-
reversed: reversed,
|
|
169
|
-
start: start
|
|
170
|
-
}, innerBlocksProps)), controls, ordered && createElement(OrderedListSettings, {
|
|
171
|
-
setAttributes: setAttributes,
|
|
172
|
-
ordered: ordered,
|
|
173
|
-
reversed: reversed,
|
|
174
|
-
start: start
|
|
175
|
-
}));
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
export default Edit;
|
|
179
|
-
//# sourceMappingURL=edit.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/list/v2/edit.js"],"names":["last","BlockControls","useBlockProps","useInnerBlocksProps","store","blockEditorStore","ToolbarButton","useDispatch","useSelect","useRegistry","isRTL","__","formatListBullets","formatListBulletsRTL","formatListNumbered","formatListNumberedRTL","formatOutdent","formatOutdentRTL","createBlock","useCallback","useEffect","Platform","deprecated","OrderedListSettings","migrateToListV2","TagName","TEMPLATE","NATIVE_MARGIN_SPACING","useMigrateOnLoad","attributes","clientId","registry","updateBlockAttributes","replaceInnerBlocks","values","newAttributes","newInnerBlocks","since","version","alternative","batch","useOutdentList","canOutdent","innerSelect","getBlockRootClientId","getBlock","parentId","name","replaceBlocks","selectionChange","getBlockAttributes","parentBlockId","parentBlockAttributes","newParentBlock","innerBlocks","IndentUI","outdentList","Edit","setAttributes","style","blockProps","isNative","innerBlocksProps","allowedBlocks","template","templateInsertUpdatesSelection","marginVertical","marginHorizontal","ordered","reversed","start","controls"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,IAAT,QAAqB,QAArB;AAEA;AACA;AACA;;AACA,SACCC,aADD,EAECC,aAFD,EAGCC,mBAHD,EAICC,KAAK,IAAIC,gBAJV,QAKO,yBALP;AAMA,SAASC,aAAT,QAA8B,uBAA9B;AACA,SAASC,WAAT,EAAsBC,SAAtB,EAAiCC,WAAjC,QAAoD,iBAApD;AACA,SAASC,KAAT,EAAgBC,EAAhB,QAA0B,iBAA1B;AACA,SACCC,iBADD,EAECC,oBAFD,EAGCC,kBAHD,EAICC,qBAJD,EAKCC,aALD,EAMCC,gBAND,QAOO,kBAPP;AAQA,SAASC,WAAT,QAA4B,mBAA5B;AACA,SAASC,WAAT,EAAsBC,SAAtB,EAAiCC,QAAjC,QAAiD,oBAAjD;AACA,OAAOC,UAAP,MAAuB,uBAAvB;AAEA;AACA;AACA;;AACA,OAAOC,mBAAP,MAAgC,0BAAhC;AACA,SAASC,eAAT,QAAgC,WAAhC;AACA,OAAOC,OAAP,MAAoB,YAApB;AAEA,MAAMC,QAAQ,GAAG,CAAE,CAAE,gBAAF,CAAF,CAAjB;AACA,MAAMC,qBAAqB,GAAG,CAA9B;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,gBAAT,CAA2BC,UAA3B,EAAuCC,QAAvC,EAAkD;AACjD,QAAMC,QAAQ,GAAGtB,WAAW,EAA5B;AACA,QAAM;AAAEuB,IAAAA,qBAAF;AAAyBC,IAAAA;AAAzB,MACL1B,WAAW,CAAEF,gBAAF,CADZ;AAGAe,EAAAA,SAAS,CAAE,MAAM;AAChB;AAEA,QAAK,CAAES,UAAU,CAACK,MAAlB,EAA2B;AAC1B;AACA;;AAED,UAAM,CAAEC,aAAF,EAAiBC,cAAjB,IAAoCZ,eAAe,CAAEK,UAAF,CAAzD;AAEAP,IAAAA,UAAU,CAAE,mCAA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AJN,EADD,EAOGS,QAPH,EAQGH,OAAO,IACR,cAAC,mBAAD;AACC,IAAA,aAAa,EAAGV,aADjB;AAEC,IAAA,OAAO,EAAGU,OAFX;AAGC,IAAA,QAAQ,EAAGC,QAHZ;AAIC,IAAA,KAAK,EAAGC;AAJT,IATF,CADD;AAmBA;;AAED,eAAeb,IAAf","sourcesContent":["/**\n * External dependencies\n */\nimport { last } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tBlockControls,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { ToolbarButton } from '@wordpress/components';\nimport { useDispatch, useSelect, useRegistry } from '@wordpress/data';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport {\n\tformatListBullets,\n\tformatListBulletsRTL,\n\tformatListNumbered,\n\tformatListNumberedRTL,\n\tformatOutdent,\n\tformatOutdentRTL,\n} from '@wordpress/icons';\nimport { createBlock } from '@wordpress/blocks';\nimport { useCallback, useEffect, Platform } from '@wordpress/element';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport OrderedListSettings from '../ordered-list-settings';\nimport { migrateToListV2 } from './migrate';\nimport TagName from './tag-name';\n\nconst TEMPLATE = [ [ 'core/list-item' ] ];\nconst NATIVE_MARGIN_SPACING = 8;\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 list block format.\n *\n * @param {Object} attributes Block attributes.\n * @param {string} clientId Block client ID.\n */\nfunction useMigrateOnLoad( attributes, clientId ) {\n\tconst registry = useRegistry();\n\tconst { updateBlockAttributes, replaceInnerBlocks } =\n\t\tuseDispatch( blockEditorStore );\n\n\tuseEffect( () => {\n\t\t// As soon as the block is loaded, migrate it to the new version.\n\n\t\tif ( ! attributes.values ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst [ newAttributes, newInnerBlocks ] = migrateToListV2( attributes );\n\n\t\tdeprecated( 'Value attribute on the list 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.values ] );\n}\n\nfunction useOutdentList( clientId ) {\n\tconst { canOutdent } = useSelect(\n\t\t( innerSelect ) => {\n\t\t\tconst { getBlockRootClientId, getBlock } =\n\t\t\t\tinnerSelect( blockEditorStore );\n\t\t\tconst parentId = getBlockRootClientId( clientId );\n\t\t\treturn {\n\t\t\t\tcanOutdent:\n\t\t\t\t\t!! parentId &&\n\t\t\t\t\tgetBlock( parentId ).name === 'core/list-item',\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\tconst { replaceBlocks, selectionChange } = useDispatch( blockEditorStore );\n\tconst { getBlockRootClientId, getBlockAttributes, getBlock } =\n\t\tuseSelect( blockEditorStore );\n\n\treturn [\n\t\tcanOutdent,\n\t\tuseCallback( () => {\n\t\t\tconst parentBlockId = getBlockRootClientId( clientId );\n\t\t\tconst parentBlockAttributes = getBlockAttributes( parentBlockId );\n\t\t\t// Create a new parent block without the inner blocks.\n\t\t\tconst newParentBlock = createBlock(\n\t\t\t\t'core/list-item',\n\t\t\t\tparentBlockAttributes\n\t\t\t);\n\t\t\tconst { innerBlocks } = getBlock( clientId );\n\t\t\t// Replace the parent block with a new parent block without inner blocks,\n\t\t\t// and make the inner blocks siblings of the parent.\n\t\t\treplaceBlocks(\n\t\t\t\t[ parentBlockId ],\n\t\t\t\t[ newParentBlock, ...innerBlocks ]\n\t\t\t);\n\t\t\t// Select the last child of the list being outdent.\n\t\t\tselectionChange( last( innerBlocks ).clientId );\n\t\t}, [ clientId ] ),\n\t];\n}\n\nfunction IndentUI( { clientId } ) {\n\tconst [ canOutdent, outdentList ] = useOutdentList( clientId );\n\treturn (\n\t\t<>\n\t\t\t<ToolbarButton\n\t\t\t\ticon={ isRTL() ? formatOutdentRTL : formatOutdent }\n\t\t\t\ttitle={ __( 'Outdent' ) }\n\t\t\t\tdescribedBy={ __( 'Outdent list item' ) }\n\t\t\t\tdisabled={ ! canOutdent }\n\t\t\t\tonClick={ outdentList }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nfunction Edit( { attributes, setAttributes, clientId, style } ) {\n\tconst blockProps = useBlockProps( {\n\t\t...( Platform.isNative && { style } ),\n\t} );\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\tallowedBlocks: [ 'core/list-item' ],\n\t\ttemplate: TEMPLATE,\n\t\ttemplateInsertUpdatesSelection: true,\n\t\t...( Platform.isNative && {\n\t\t\tmarginVertical: NATIVE_MARGIN_SPACING,\n\t\t\tmarginHorizontal: NATIVE_MARGIN_SPACING,\n\t\t} ),\n\t} );\n\tuseMigrateOnLoad( attributes, clientId );\n\tconst { ordered, reversed, start } = attributes;\n\n\tconst controls = (\n\t\t<BlockControls group=\"block\">\n\t\t\t<ToolbarButton\n\t\t\t\ticon={ isRTL() ? formatListBulletsRTL : formatListBullets }\n\t\t\t\ttitle={ __( 'Unordered' ) }\n\t\t\t\tdescribedBy={ __( 'Convert to unordered list' ) }\n\t\t\t\tisActive={ ordered === false }\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tsetAttributes( { ordered: false } );\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<ToolbarButton\n\t\t\t\ticon={ isRTL() ? formatListNumberedRTL : formatListNumbered }\n\t\t\t\ttitle={ __( 'Ordered' ) }\n\t\t\t\tdescribedBy={ __( 'Convert to ordered list' ) }\n\t\t\t\tisActive={ ordered === true }\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tsetAttributes( { ordered: true } );\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<IndentUI clientId={ clientId } />\n\t\t</BlockControls>\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<TagName\n\t\t\t\tordered={ ordered }\n\t\t\t\treversed={ reversed }\n\t\t\t\tstart={ start }\n\t\t\t\t{ ...innerBlocksProps }\n\t\t\t/>\n\t\t\t{ controls }\n\t\t\t{ ordered && (\n\t\t\t\t<OrderedListSettings\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tordered={ ordered }\n\t\t\t\t\treversed={ reversed }\n\t\t\t\t\tstart={ start }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default Edit;\n"]}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { list as icon } from '@wordpress/icons';
|
|
5
|
-
/**
|
|
6
|
-
* Internal dependencies
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import edit from './edit';
|
|
10
|
-
import save from './save';
|
|
11
|
-
import transforms from './transforms';
|
|
12
|
-
import deprecated from './deprecated';
|
|
13
|
-
const settings = {
|
|
14
|
-
icon,
|
|
15
|
-
edit,
|
|
16
|
-
save,
|
|
17
|
-
transforms,
|
|
18
|
-
deprecated
|
|
19
|
-
};
|
|
20
|
-
export default settings;
|
|
21
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/list/v2/index.js"],"names":["list","icon","edit","save","transforms","deprecated","settings"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAI,IAAIC,IAAjB,QAA6B,kBAA7B;AAEA;AACA;AACA;;AACA,OAAOC,IAAP,MAAiB,QAAjB;AACA,OAAOC,IAAP,MAAiB,QAAjB;AACA,OAAOC,UAAP,MAAuB,cAAvB;AACA,OAAOC,UAAP,MAAuB,cAAvB;AAEA,MAAMC,QAAQ,GAAG;AAChBL,EAAAA,IADgB;AAEhBC,EAAAA,IAFgB;AAGhBC,EAAAA,IAHgB;AAIhBC,EAAAA,UAJgB;AAKhBC,EAAAA;AALgB,CAAjB;AAQA,eAAeC,QAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { list as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport edit from './edit';\nimport save from './save';\nimport transforms from './transforms';\nimport deprecated from './deprecated';\n\nconst settings = {\n\ticon,\n\tedit,\n\tsave,\n\ttransforms,\n\tdeprecated,\n};\n\nexport default settings;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/list/v2/migrate.js"],"names":["omit","createBlock","createListBlockFromDOMElement","listElement","listAttributes","ordered","tagName","start","getAttribute","parseInt","undefined","reversed","type","innerBlocks","Array","from","children","map","listItem","childNodes","filter","node","nodeType","TEXT_NODE","textContent","trim","length","reverse","nestedList","nodes","hasNestedList","content","innerHTML","htmlNodes","outerHTML","childAttributes","join","childInnerBlocks","migrateToListV2","attributes","values","list","document","createElement","setAttribute","listBlock"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAT,QAAqB,QAArB;AAEA;AACA;AACA;;AACA,SAASC,WAAT,QAA4B,mBAA5B;AAEA,OAAO,SAASC,6BAAT,CAAwCC,WAAxC,EAAsD;AAAA;;AAC5D,QAAMC,cAAc,GAAG;AACtBC,IAAAA,OAAO,EAAE,SAASF,WAAW,CAACG,OADR;AAEtBC,IAAAA,KAAK,EAAEJ,WAAW,CAACK,YAAZ,CAA0B,OAA1B,IACJC,QAAQ,CAAEN,WAAW,CAACK,YAAZ,CAA0B,OAA1B,CAAF,EAAuC,EAAvC,CADJ,GAEJE,SAJmB;AAKtBC,IAAAA,QAAQ,EACPR,WAAW,CAACK,YAAZ,CAA0B,UAA1B,MAA2C,IAA3C,GAAkD,IAAlD,GAAyDE,SANpC;AAOtBE,IAAAA,IAAI,2BAAET,WAAW,CAACK,YAAZ,CAA0B,MAA1B,CAAF,yEAAwCE;AAPtB,GAAvB;AAUA,QAAMG,WAAW,GAAGC,KAAK,CAACC,IAAN,CAAYZ,WAAW,CAACa,QAAxB,EAAmC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0BC,UAA1B,EAAuC;AAC7C,QAAM;AAAEC,IAAAA,MAAF;AAAUjC,IAAAA,KAAV;AAAiBI,IAAAA,QAAjB;AAA2BN,IAAAA,OAA3B;AAAoCO,IAAAA;AAApC,MAA6C2B,UAAnD;AAEA,QAAME,IAAI,GAAGC,QAAQ,CAACC,aAAT,CAAwBtC,OAAO,GAAG,IAAH,GAAU,IAAzC,CAAb;AACAoC,EAAAA,IAAI,CAACT,SAAL,GAAiBQ,MAAjB;;AACA,MAAKjC,KAAL,EAAa;AACZkC,IAAAA,IAAI,CAACG,YAAL,CAAmB,OAAnB,EAA4BrC,KAA5B;AACA;;AACD,MAAKI,QAAL,EAAgB;AACf8B,IAAAA,IAAI,CAACG,YAAL,CAAmB,UAAnB,EAA+B,IAA/B;AACA;;AACD,MAAKhC,IAAL,EAAY;AACX6B,IAAAA,IAAI,CAACG,YAAL,CAAmB,MAAnB,EAA2BhC,IAA3B;AACA;;AAED,QAAMiC,SAAS,GAAG3C,6BAA6B,CAAEuC,IAAF,CAA/C;AAEA,SAAO,CACN,EACC,GAAGzC,IAAI,CAAEuC,UAAF,EAAc,CAAE,QAAF,CAAd,CADR;AAEC,OAAGM,SAAS,CAACN;AAFd,GADM,EAKNM,SAAS,CAAChC,WALJ,CAAP;AAOA","sourcesContent":["/**\n * External dependencies\n */\nimport { omit } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { createBlock } from '@wordpress/blocks';\n\nexport function createListBlockFromDOMElement( listElement ) {\n\tconst listAttributes = {\n\t\tordered: 'OL' === listElement.tagName,\n\t\tstart: listElement.getAttribute( 'start' )\n\t\t\t? parseInt( listElement.getAttribute( 'start' ), 10 )\n\t\t\t: undefined,\n\t\treversed:\n\t\t\tlistElement.getAttribute( 'reversed' ) === true ? true : undefined,\n\t\ttype: listElement.getAttribute( 'type' ) ?? undefined,\n\t};\n\n\tconst innerBlocks = Array.from( listElement.children ).map(\n\t\t( listItem ) => {\n\t\t\tconst children = Array.from( listItem.childNodes ).filter(\n\t\t\t\t( node ) =>\n\t\t\t\t\tnode.nodeType !== node.TEXT_NODE ||\n\t\t\t\t\tnode.textContent.trim().length !== 0\n\t\t\t);\n\t\t\tchildren.reverse();\n\t\t\tconst [ nestedList, ...nodes ] = children;\n\n\t\t\tconst hasNestedList =\n\t\t\t\tnestedList.tagName === 'UL' || nestedList.tagName === 'OL';\n\t\t\tif ( ! hasNestedList ) {\n\t\t\t\treturn createBlock( 'core/list-item', {\n\t\t\t\t\tcontent: listItem.innerHTML,\n\t\t\t\t} );\n\t\t\t}\n\t\t\tconst htmlNodes = nodes.map( ( node ) => {\n\t\t\t\tif ( node.nodeType === node.TEXT_NODE ) {\n\t\t\t\t\treturn node.textContent;\n\t\t\t\t}\n\t\t\t\treturn node.outerHTML;\n\t\t\t} );\n\t\t\thtmlNodes.reverse();\n\t\t\tconst childAttributes = {\n\t\t\t\tcontent: htmlNodes.join( '' ).trim(),\n\t\t\t};\n\t\t\tconst childInnerBlocks = [\n\t\t\t\tcreateListBlockFromDOMElement( nestedList ),\n\t\t\t];\n\t\t\treturn createBlock(\n\t\t\t\t'core/list-item',\n\t\t\t\tchildAttributes,\n\t\t\t\tchildInnerBlocks\n\t\t\t);\n\t\t}\n\t);\n\n\treturn createBlock( 'core/list', listAttributes, innerBlocks );\n}\n\nexport function migrateToListV2( attributes ) {\n\tconst { values, start, reversed, ordered, type } = attributes;\n\n\tconst list = document.createElement( ordered ? 'ol' : 'ul' );\n\tlist.innerHTML = values;\n\tif ( start ) {\n\t\tlist.setAttribute( 'start', start );\n\t}\n\tif ( reversed ) {\n\t\tlist.setAttribute( 'reversed', true );\n\t}\n\tif ( type ) {\n\t\tlist.setAttribute( 'type', type );\n\t}\n\n\tconst listBlock = createListBlockFromDOMElement( list );\n\n\treturn [\n\t\t{\n\t\t\t...omit( attributes, [ 'values' ] ),\n\t\t\t...listBlock.attributes,\n\t\t},\n\t\tlistBlock.innerBlocks,\n\t];\n}\n"]}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import { createElement } from "@wordpress/element";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* WordPress dependencies
|
|
6
|
-
*/
|
|
7
|
-
import { InnerBlocks, useBlockProps } from '@wordpress/block-editor';
|
|
8
|
-
export default function save(_ref) {
|
|
9
|
-
let {
|
|
10
|
-
attributes
|
|
11
|
-
} = _ref;
|
|
12
|
-
const {
|
|
13
|
-
ordered,
|
|
14
|
-
reversed,
|
|
15
|
-
start
|
|
16
|
-
} = attributes;
|
|
17
|
-
const TagName = ordered ? 'ol' : 'ul';
|
|
18
|
-
return createElement(TagName, _extends({
|
|
19
|
-
reversed: reversed,
|
|
20
|
-
start: start
|
|
21
|
-
}, useBlockProps.save()), createElement(InnerBlocks.Content, null));
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=save.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/list/v2/save.js"],"names":["InnerBlocks","useBlockProps","save","attributes","ordered","reversed","start","TagName"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,WAAT,EAAsBC,aAAtB,QAA2C,yBAA3C;AAEA,eAAe,SAASC,IAAT,OAAgC;AAAA,MAAjB;AAAEC,IAAAA;AAAF,GAAiB;AAC9C,QAAM;AAAEC,IAAAA,OAAF;AAAWC,IAAAA,QAAX;AAAqBC,IAAAA;AAArB,MAA+BH,UAArC;AACA,QAAMI,OAAO,GAAGH,OAAO,GAAG,IAAH,GAAU,IAAjC;AACA,SACC,cAAC,OAAD;AACC,IAAA,QAAQ,EAAGC,QADZ;AAEC,IAAA,KAAK,EAAGC;AAFT,KAGML,aAAa,CAACC,IAAd,EAHN,GAKC,cAAC,WAAD,CAAa,OAAb,OALD,CADD;AASA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { InnerBlocks, useBlockProps } from '@wordpress/block-editor';\n\nexport default function save( { attributes } ) {\n\tconst { ordered, reversed, start } = attributes;\n\tconst TagName = ordered ? 'ol' : 'ul';\n\treturn (\n\t\t<TagName\n\t\t\treversed={ reversed }\n\t\t\tstart={ start }\n\t\t\t{ ...useBlockProps.save() }\n\t\t>\n\t\t\t<InnerBlocks.Content />\n\t\t</TagName>\n\t);\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/list/v2/tag-name.js"],"names":["forwardRef","TagName","props","ref","ordered","extraProps","Tag"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,UAAT,QAA2B,oBAA3B;;AAEA,SAASC,OAAT,CAAkBC,KAAlB,EAAyBC,GAAzB,EAA+B;AAC9B,QAAM;AAAEC,IAAAA,OAAF;AAAW,OAAGC;AAAd,MAA6BH,KAAnC;AACA,QAAMI,GAAG,GAAGF,OAAO,GAAG,IAAH,GAAU,IAA7B;AAEA,SAAO,cAAC,GAAD;AAAK,IAAA,GAAG,EAAGD;AAAX,KAAsBE,UAAtB,EAAP;AACA;;AAED,eAAeL,UAAU,CAAEC,OAAF,CAAzB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\nfunction TagName( props, ref ) {\n\tconst { ordered, ...extraProps } = props;\n\tconst Tag = ordered ? 'ol' : 'ul';\n\n\treturn <Tag ref={ ref } { ...extraProps } />;\n}\n\nexport default forwardRef( TagName );\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/list/v2/tag-name.native.js"],"names":["forwardRef","View","TagName","props","ref","start","extraProps"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,UAAT,QAA2B,oBAA3B;AACA,SAASC,IAAT,QAAqB,uBAArB;;AAEA,SAASC,OAAT,CAAkBC,KAAlB,EAAyBC,GAAzB,EAA+B;AAC9B,QAAM;AAAEC,IAAAA,KAAF;AAAS,OAAGC;AAAZ,MAA2BH,KAAjC;AACA,SAAO,cAAC,IAAD;AAAM,IAAA,GAAG,EAAGC;AAAZ,KAAuBE,UAAvB,EAAP;AACA;;AAED,eAAeN,UAAU,CAAEE,OAAF,CAAzB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\nimport { View } from '@wordpress/primitives';\n\nfunction TagName( props, ref ) {\n\tconst { start, ...extraProps } = props;\n\treturn <View ref={ ref } { ...extraProps } />;\n}\n\nexport default forwardRef( TagName );\n"]}
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { createBlock } from '@wordpress/blocks';
|
|
5
|
-
import { create, split, toHTMLString } from '@wordpress/rich-text';
|
|
6
|
-
/**
|
|
7
|
-
* Internal dependencies
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import { createListBlockFromDOMElement } from './migrate';
|
|
11
|
-
|
|
12
|
-
function getListContentSchema(_ref) {
|
|
13
|
-
let {
|
|
14
|
-
phrasingContentSchema
|
|
15
|
-
} = _ref;
|
|
16
|
-
const listContentSchema = { ...phrasingContentSchema,
|
|
17
|
-
ul: {},
|
|
18
|
-
ol: {
|
|
19
|
-
attributes: ['type', 'start', 'reversed']
|
|
20
|
-
}
|
|
21
|
-
}; // Recursion is needed.
|
|
22
|
-
// Possible: ul > li > ul.
|
|
23
|
-
// Impossible: ul > ul.
|
|
24
|
-
|
|
25
|
-
['ul', 'ol'].forEach(tag => {
|
|
26
|
-
listContentSchema[tag].children = {
|
|
27
|
-
li: {
|
|
28
|
-
children: listContentSchema
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
});
|
|
32
|
-
return listContentSchema;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function getListContentFlat(blocks) {
|
|
36
|
-
return blocks.flatMap(_ref2 => {
|
|
37
|
-
let {
|
|
38
|
-
name,
|
|
39
|
-
attributes,
|
|
40
|
-
innerBlocks = []
|
|
41
|
-
} = _ref2;
|
|
42
|
-
|
|
43
|
-
if (name === 'core/list-item') {
|
|
44
|
-
return [attributes.content, ...getListContentFlat(innerBlocks)];
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
return getListContentFlat(innerBlocks);
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const transforms = {
|
|
52
|
-
from: [{
|
|
53
|
-
type: 'block',
|
|
54
|
-
isMultiBlock: true,
|
|
55
|
-
blocks: ['core/paragraph', 'core/heading'],
|
|
56
|
-
transform: blockAttributes => {
|
|
57
|
-
let childBlocks = [];
|
|
58
|
-
|
|
59
|
-
if (blockAttributes.length > 1) {
|
|
60
|
-
childBlocks = blockAttributes.map(_ref3 => {
|
|
61
|
-
let {
|
|
62
|
-
content
|
|
63
|
-
} = _ref3;
|
|
64
|
-
return createBlock('core/list-item', {
|
|
65
|
-
content
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
} else if (blockAttributes.length === 1) {
|
|
69
|
-
const value = create({
|
|
70
|
-
html: blockAttributes[0].content
|
|
71
|
-
});
|
|
72
|
-
childBlocks = split(value, '\n').map(result => {
|
|
73
|
-
return createBlock('core/list-item', {
|
|
74
|
-
content: toHTMLString({
|
|
75
|
-
value: result
|
|
76
|
-
})
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
return createBlock('core/list', {
|
|
82
|
-
anchor: blockAttributes.anchor
|
|
83
|
-
}, childBlocks);
|
|
84
|
-
}
|
|
85
|
-
}, ...['*', '-'].map(prefix => ({
|
|
86
|
-
type: 'prefix',
|
|
87
|
-
prefix,
|
|
88
|
-
|
|
89
|
-
transform(content) {
|
|
90
|
-
return createBlock('core/list', {}, [createBlock('core/list-item', {
|
|
91
|
-
content
|
|
92
|
-
})]);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
})), ...['1.', '1)'].map(prefix => ({
|
|
96
|
-
type: 'prefix',
|
|
97
|
-
prefix,
|
|
98
|
-
|
|
99
|
-
transform(content) {
|
|
100
|
-
return createBlock('core/list', {
|
|
101
|
-
ordered: true
|
|
102
|
-
}, [createBlock('core/list-item', {
|
|
103
|
-
content
|
|
104
|
-
})]);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
})), {
|
|
108
|
-
type: 'raw',
|
|
109
|
-
selector: 'ol,ul',
|
|
110
|
-
schema: args => ({
|
|
111
|
-
ol: getListContentSchema(args).ol,
|
|
112
|
-
ul: getListContentSchema(args).ul
|
|
113
|
-
}),
|
|
114
|
-
transform: createListBlockFromDOMElement
|
|
115
|
-
}],
|
|
116
|
-
to: [...['core/paragraph', 'core/heading'].map(block => ({
|
|
117
|
-
type: 'block',
|
|
118
|
-
blocks: [block],
|
|
119
|
-
transform: (_attributes, childBlocks) => {
|
|
120
|
-
return getListContentFlat(childBlocks).map(content => createBlock(block, {
|
|
121
|
-
content
|
|
122
|
-
}));
|
|
123
|
-
}
|
|
124
|
-
}))]
|
|
125
|
-
};
|
|
126
|
-
export default transforms;
|
|
127
|
-
//# sourceMappingURL=transforms.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/list/v2/transforms.js"],"names":["createBlock","create","split","toHTMLString","createListBlockFromDOMElement","getListContentSchema","phrasingContentSchema","listContentSchema","ul","ol","attributes","forEach","tag","children","li","getListContentFlat","blocks","flatMap","name","innerBlocks","content","transforms","from","type","isMultiBlock","transform","blockAttributes","childBlocks","length","map","value","html","result","anchor","prefix","ordered","selector","schema","args","to","block","_attributes"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAT,QAA4B,mBAA5B;AACA,SAASC,MAAT,EAAiBC,KAAjB,EAAwBC,YAAxB,QAA4C,sBAA5C;AAEA;AACA;AACA;;AACA,SAASC,6BAAT,QAA8C,WAA9C;;AAEA,SAASC,oBAAT,OAA2D;AAAA,MAA5B;AAAEC,IAAAA;AAAF,GAA4B;AAC1D,QAAMC,iBAAiB,GAAG,EACzB,GA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E;AADV,OAFiB,EAKjB,CAAEnC,WAAW,CAAE,gBAAF,EAAoB;AAAEoB,QAAAA;AAAF,OAApB,CAAb,CALiB,CAAlB;AAOA;;AAXqC,GAAhB,CAApB,CAvCE,EAoDL;AACCG,IAAAA,IAAI,EAAE,KADP;AAECa,IAAAA,QAAQ,EAAE,OAFX;AAGCC,IAAAA,MAAM,EAAIC,IAAF,KAAc;AACrB7B,MAAAA,EAAE,EAAEJ,oBAAoB,CAAEiC,IAAF,CAApB,CAA6B7B,EADZ;AAErBD,MAAAA,EAAE,EAAEH,oBAAoB,CAAEiC,IAAF,CAApB,CAA6B9B;AAFZ,KAAd,CAHT;AAOCiB,IAAAA,SAAS,EAAErB;AAPZ,GApDK,CADY;AA+DlBmC,EAAAA,EAAE,EAAE,CACH,GAAG,CAAE,gBAAF,EAAoB,cAApB,EAAqCV,GAArC,CAA4CW,KAAF,KAAe;AAC3DjB,IAAAA,IAAI,EAAE,OADqD;AAE3DP,IAAAA,MAAM,EAAE,CAAEwB,KAAF,CAFmD;AAG3Df,IAAAA,SAAS,EAAE,CAAEgB,WAAF,EAAed,WAAf,KAAgC;AAC1C,aAAOZ,kBAAkB,CAAEY,WAAF,CAAlB,CAAkCE,GAAlC,CAAyCT,OAAF,IAC7CpB,WAAW,CAAEwC,KAAF,EAAS;AACnBpB,QAAAA;AADmB,OAAT,CADL,CAAP;AAKA;AAT0D,GAAf,CAA1C,CADA;AA/Dc,CAAnB;AA8EA,eAAeC,UAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createBlock } from '@wordpress/blocks';\nimport { create, split, toHTMLString } from '@wordpress/rich-text';\n\n/**\n * Internal dependencies\n */\nimport { createListBlockFromDOMElement } from './migrate';\n\nfunction getListContentSchema( { phrasingContentSchema } ) {\n\tconst listContentSchema = {\n\t\t...phrasingContentSchema,\n\t\tul: {},\n\t\tol: { attributes: [ 'type', 'start', 'reversed' ] },\n\t};\n\n\t// Recursion is needed.\n\t// Possible: ul > li > ul.\n\t// Impossible: ul > ul.\n\t[ 'ul', 'ol' ].forEach( ( tag ) => {\n\t\tlistContentSchema[ tag ].children = {\n\t\t\tli: {\n\t\t\t\tchildren: listContentSchema,\n\t\t\t},\n\t\t};\n\t} );\n\n\treturn listContentSchema;\n}\n\nfunction getListContentFlat( blocks ) {\n\treturn blocks.flatMap( ( { name, attributes, innerBlocks = [] } ) => {\n\t\tif ( name === 'core/list-item' ) {\n\t\t\treturn [ attributes.content, ...getListContentFlat( innerBlocks ) ];\n\t\t}\n\t\treturn getListContentFlat( innerBlocks );\n\t} );\n}\n\nconst transforms = {\n\tfrom: [\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tisMultiBlock: true,\n\t\t\tblocks: [ 'core/paragraph', 'core/heading' ],\n\t\t\ttransform: ( blockAttributes ) => {\n\t\t\t\tlet childBlocks = [];\n\t\t\t\tif ( blockAttributes.length > 1 ) {\n\t\t\t\t\tchildBlocks = blockAttributes.map( ( { content } ) => {\n\t\t\t\t\t\treturn createBlock( 'core/list-item', { content } );\n\t\t\t\t\t} );\n\t\t\t\t} else if ( blockAttributes.length === 1 ) {\n\t\t\t\t\tconst value = create( {\n\t\t\t\t\t\thtml: blockAttributes[ 0 ].content,\n\t\t\t\t\t} );\n\t\t\t\t\tchildBlocks = split( value, '\\n' ).map( ( result ) => {\n\t\t\t\t\t\treturn createBlock( 'core/list-item', {\n\t\t\t\t\t\t\tcontent: toHTMLString( { value: result } ),\n\t\t\t\t\t\t} );\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t\treturn createBlock(\n\t\t\t\t\t'core/list',\n\t\t\t\t\t{\n\t\t\t\t\t\tanchor: blockAttributes.anchor,\n\t\t\t\t\t},\n\t\t\t\t\tchildBlocks\n\t\t\t\t);\n\t\t\t},\n\t\t},\n\t\t...[ '*', '-' ].map( ( prefix ) => ( {\n\t\t\ttype: 'prefix',\n\t\t\tprefix,\n\t\t\ttransform( content ) {\n\t\t\t\treturn createBlock( 'core/list', {}, [\n\t\t\t\t\tcreateBlock( 'core/list-item', { content } ),\n\t\t\t\t] );\n\t\t\t},\n\t\t} ) ),\n\t\t...[ '1.', '1)' ].map( ( prefix ) => ( {\n\t\t\ttype: 'prefix',\n\t\t\tprefix,\n\t\t\ttransform( content ) {\n\t\t\t\treturn createBlock(\n\t\t\t\t\t'core/list',\n\t\t\t\t\t{\n\t\t\t\t\t\tordered: true,\n\t\t\t\t\t},\n\t\t\t\t\t[ createBlock( 'core/list-item', { content } ) ]\n\t\t\t\t);\n\t\t\t},\n\t\t} ) ),\n\t\t{\n\t\t\ttype: 'raw',\n\t\t\tselector: 'ol,ul',\n\t\t\tschema: ( args ) => ( {\n\t\t\t\tol: getListContentSchema( args ).ol,\n\t\t\t\tul: getListContentSchema( args ).ul,\n\t\t\t} ),\n\t\t\ttransform: createListBlockFromDOMElement,\n\t\t},\n\t],\n\tto: [\n\t\t...[ 'core/paragraph', 'core/heading' ].map( ( block ) => ( {\n\t\t\ttype: 'block',\n\t\t\tblocks: [ block ],\n\t\t\ttransform: ( _attributes, childBlocks ) => {\n\t\t\t\treturn getListContentFlat( childBlocks ).map( ( content ) =>\n\t\t\t\t\tcreateBlock( block, {\n\t\t\t\t\t\tcontent,\n\t\t\t\t\t} )\n\t\t\t\t);\n\t\t\t},\n\t\t} ) ),\n\t],\n};\n\nexport default transforms;\n"]}
|