@wordpress/block-library 7.2.0 → 7.3.2
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 +2 -0
- package/README.md +1 -1
- package/build/archives/edit.js +21 -1
- package/build/archives/edit.js.map +1 -1
- package/build/archives/index.js +5 -1
- package/build/archives/index.js.map +1 -1
- package/build/audio/edit.js +1 -1
- package/build/audio/edit.js.map +1 -1
- package/build/audio/edit.native.js +0 -5
- package/build/audio/edit.native.js.map +1 -1
- package/build/avatar/edit.js +17 -11
- package/build/avatar/edit.js.map +1 -1
- package/build/block/edit.js +2 -1
- package/build/block/edit.js.map +1 -1
- package/build/column/index.js +1 -0
- package/build/column/index.js.map +1 -1
- package/build/comment-author-avatar/index.js +3 -3
- package/build/comment-author-name/index.js +7 -3
- package/build/comment-author-name/index.js.map +1 -1
- package/build/comment-content/index.js +1 -1
- package/build/comment-date/index.js +7 -3
- 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/edit.js +10 -15
- package/build/comment-template/edit.js.map +1 -1
- package/build/comment-template/hooks.js +10 -24
- package/build/comment-template/hooks.js.map +1 -1
- package/build/comment-template/index.js +2 -2
- package/build/comments-pagination-next/index.js +2 -2
- package/build/comments-pagination-numbers/index.js +1 -1
- package/build/comments-pagination-previous/index.js +1 -1
- package/build/comments-query-loop/edit/comments-inspector-controls.js +2 -69
- package/build/comments-query-loop/edit/comments-inspector-controls.js.map +1 -1
- package/build/comments-query-loop/edit.js +22 -1
- package/build/comments-query-loop/edit.js.map +1 -1
- package/build/comments-query-loop/index.js +1 -23
- package/build/comments-query-loop/index.js.map +1 -1
- package/build/cover/edit.js +35 -6
- package/build/cover/edit.js.map +1 -1
- package/build/cover/index.js +5 -0
- package/build/cover/index.js.map +1 -1
- package/build/cover/save.js +3 -2
- package/build/cover/save.js.map +1 -1
- package/build/cover/transforms.js +33 -32
- package/build/cover/transforms.js.map +1 -1
- package/build/gallery/gap-styles.js +8 -2
- package/build/gallery/gap-styles.js.map +1 -1
- package/build/gallery/index.js +1 -0
- package/build/gallery/index.js.map +1 -1
- package/build/group/edit.js +3 -1
- package/build/group/edit.js.map +1 -1
- package/build/group/index.js +2 -4
- package/build/group/index.js.map +1 -1
- package/build/group/variations.js +31 -9
- package/build/group/variations.js.map +1 -1
- package/build/heading/edit.js +1 -1
- package/build/heading/edit.js.map +1 -1
- package/build/html/edit.js +3 -2
- package/build/html/edit.js.map +1 -1
- package/build/image/edit.native.js +8 -10
- package/build/image/edit.native.js.map +1 -1
- package/build/index.js +4 -4
- package/build/index.js.map +1 -1
- package/build/list/deprecated.js +2 -2
- package/build/list/deprecated.js.map +1 -1
- package/build/list/index.js +13 -2
- package/build/list/index.js.map +1 -1
- package/build/list/v2/deprecated.js +117 -0
- package/build/list/v2/deprecated.js.map +1 -0
- package/build/list/v2/edit.js +106 -3
- package/build/list/v2/edit.js.map +1 -1
- package/build/list/v2/index.js +4 -1
- package/build/list/v2/index.js.map +1 -1
- package/build/list/v2/migrate.js +85 -0
- package/build/list/v2/migrate.js.map +1 -0
- package/build/list-item/edit.js +59 -10
- package/build/list-item/edit.js.map +1 -1
- package/build/list-item/hooks/index.js +32 -0
- package/build/list-item/hooks/index.js.map +1 -0
- package/build/list-item/hooks/use-enter.js +93 -0
- package/build/list-item/hooks/use-enter.js.map +1 -0
- package/build/list-item/hooks/use-indent-list-item.js +74 -0
- package/build/list-item/hooks/use-indent-list-item.js.map +1 -0
- package/build/list-item/hooks/use-outdent-list-item.js +77 -0
- package/build/list-item/hooks/use-outdent-list-item.js.map +1 -0
- package/build/list-item/index.js +1 -1
- package/build/list-item/index.js.map +1 -1
- package/build/list-item/utils.js +16 -0
- package/build/list-item/utils.js.map +1 -0
- package/build/media-text/media-container.native.js +1 -16
- package/build/media-text/media-container.native.js.map +1 -1
- package/build/navigation/edit/index.js +36 -17
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/navigation-menu-delete-control.js +1 -1
- package/build/navigation/edit/navigation-menu-delete-control.js.map +1 -1
- package/build/navigation/edit/unsaved-inner-blocks.js +34 -7
- package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build/navigation/index.js +9 -1
- package/build/navigation/index.js.map +1 -1
- package/build/navigation/use-navigation-menu.js +1 -0
- package/build/navigation/use-navigation-menu.js.map +1 -1
- package/build/navigation-link/edit.js +9 -5
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-link/index.js +1 -1
- package/build/navigation-submenu/edit.js +5 -9
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/navigation-submenu/index.js +1 -1
- package/build/post-comment/edit.js +2 -2
- package/build/post-comment/edit.js.map +1 -1
- package/build/post-comments/index.js +4 -3
- package/build/post-comments/index.js.map +1 -1
- package/build/post-comments-form/edit.js +3 -2
- package/build/post-comments-form/edit.js.map +1 -1
- package/build/post-featured-image/edit.js +19 -7
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/post-featured-image/index.js +1 -1
- package/build/post-template/edit.js +7 -2
- package/build/post-template/edit.js.map +1 -1
- package/build/post-terms/edit.js +3 -1
- package/build/post-terms/edit.js.map +1 -1
- package/build/post-terms/variations.js +1 -1
- package/build/post-terms/variations.js.map +1 -1
- package/build/query/edit/index.js +84 -22
- package/build/query/edit/index.js.map +1 -1
- package/build/query/edit/query-placeholder.js +7 -14
- package/build/query/edit/query-placeholder.js.map +1 -1
- package/build/query/edit/query-toolbar.js +6 -1
- package/build/query/edit/query-toolbar.js.map +1 -1
- package/build/query-pagination/edit.js +1 -1
- package/build/query-pagination/edit.js.map +1 -1
- package/build/query-pagination-numbers/index.js +19 -1
- package/build/query-pagination-numbers/index.js.map +1 -1
- package/build/quote/index.js +20 -2
- package/build/quote/index.js.map +1 -1
- package/build/quote/v2/deprecated.js +133 -0
- package/build/quote/v2/deprecated.js.map +1 -0
- package/build/quote/v2/edit.js +131 -0
- package/build/quote/v2/edit.js.map +1 -0
- package/build/quote/v2/index.js +49 -0
- package/build/quote/v2/index.js.map +1 -0
- package/build/quote/v2/save.js +43 -0
- package/build/quote/v2/save.js.map +1 -0
- package/build/quote/v2/transforms.js +156 -0
- package/build/quote/v2/transforms.js.map +1 -0
- package/build/read-more/index.js +1 -1
- package/build/rss/edit.js +6 -1
- package/build/rss/edit.js.map +1 -1
- package/build/site-logo/edit.js +3 -2
- package/build/site-logo/edit.js.map +1 -1
- package/build/site-logo/index.js +1 -1
- package/build/social-links/index.js +1 -0
- package/build/social-links/index.js.map +1 -1
- package/build/spacer/controls.native.js +1 -1
- package/build/spacer/controls.native.js.map +1 -1
- package/build/template-part/edit/utils/hooks.js +5 -2
- package/build/template-part/edit/utils/hooks.js.map +1 -1
- package/build-module/archives/edit.js +22 -2
- package/build-module/archives/edit.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/edit.js +1 -1
- package/build-module/audio/edit.js.map +1 -1
- package/build-module/audio/edit.native.js +0 -5
- package/build-module/audio/edit.native.js.map +1 -1
- package/build-module/avatar/edit.js +16 -11
- package/build-module/avatar/edit.js.map +1 -1
- package/build-module/block/edit.js +4 -3
- package/build-module/block/edit.js.map +1 -1
- package/build-module/column/index.js +1 -0
- package/build-module/column/index.js.map +1 -1
- package/build-module/comment-author-avatar/index.js +3 -3
- package/build-module/comment-author-name/index.js +7 -3
- package/build-module/comment-author-name/index.js.map +1 -1
- package/build-module/comment-content/index.js +1 -1
- package/build-module/comment-date/index.js +7 -3
- 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/edit.js +10 -15
- package/build-module/comment-template/edit.js.map +1 -1
- package/build-module/comment-template/hooks.js +10 -24
- package/build-module/comment-template/hooks.js.map +1 -1
- package/build-module/comment-template/index.js +2 -2
- package/build-module/comments-pagination-next/index.js +2 -2
- package/build-module/comments-pagination-numbers/index.js +1 -1
- package/build-module/comments-pagination-previous/index.js +1 -1
- package/build-module/comments-query-loop/edit/comments-inspector-controls.js +4 -70
- package/build-module/comments-query-loop/edit/comments-inspector-controls.js.map +1 -1
- package/build-module/comments-query-loop/edit.js +22 -1
- package/build-module/comments-query-loop/edit.js.map +1 -1
- package/build-module/comments-query-loop/index.js +1 -23
- package/build-module/comments-query-loop/index.js.map +1 -1
- package/build-module/cover/edit.js +36 -8
- package/build-module/cover/edit.js.map +1 -1
- package/build-module/cover/index.js +5 -0
- package/build-module/cover/index.js.map +1 -1
- package/build-module/cover/save.js +3 -2
- package/build-module/cover/save.js.map +1 -1
- package/build-module/cover/transforms.js +33 -32
- package/build-module/cover/transforms.js.map +1 -1
- package/build-module/gallery/gap-styles.js +8 -2
- package/build-module/gallery/gap-styles.js.map +1 -1
- package/build-module/gallery/index.js +1 -0
- package/build-module/gallery/index.js.map +1 -1
- package/build-module/group/edit.js +3 -1
- package/build-module/group/edit.js.map +1 -1
- package/build-module/group/index.js +2 -4
- package/build-module/group/index.js.map +1 -1
- package/build-module/group/variations.js +30 -9
- package/build-module/group/variations.js.map +1 -1
- package/build-module/heading/edit.js +1 -1
- package/build-module/heading/edit.js.map +1 -1
- package/build-module/html/edit.js +4 -3
- package/build-module/html/edit.js.map +1 -1
- package/build-module/image/edit.native.js +8 -10
- package/build-module/image/edit.native.js.map +1 -1
- package/build-module/index.js +4 -4
- package/build-module/index.js.map +1 -1
- package/build-module/list/deprecated.js +2 -2
- package/build-module/list/deprecated.js.map +1 -1
- package/build-module/list/index.js +9 -3
- package/build-module/list/index.js.map +1 -1
- package/build-module/list/v2/deprecated.js +104 -0
- package/build-module/list/v2/deprecated.js.map +1 -0
- package/build-module/list/v2/edit.js +104 -5
- package/build-module/list/v2/edit.js.map +1 -1
- package/build-module/list/v2/index.js +3 -1
- package/build-module/list/v2/index.js.map +1 -1
- package/build-module/list/v2/migrate.js +77 -0
- package/build-module/list/v2/migrate.js.map +1 -0
- package/build-module/list-item/edit.js +59 -13
- package/build-module/list-item/edit.js.map +1 -1
- package/build-module/list-item/hooks/index.js +4 -0
- package/build-module/list-item/hooks/index.js.map +1 -0
- package/build-module/list-item/hooks/use-enter.js +77 -0
- package/build-module/list-item/hooks/use-enter.js.map +1 -0
- package/build-module/list-item/hooks/use-indent-list-item.js +62 -0
- package/build-module/list-item/hooks/use-indent-list-item.js.map +1 -0
- package/build-module/list-item/hooks/use-outdent-list-item.js +66 -0
- package/build-module/list-item/hooks/use-outdent-list-item.js.map +1 -0
- package/build-module/list-item/index.js +1 -1
- package/build-module/list-item/index.js.map +1 -1
- package/build-module/list-item/utils.js +8 -0
- package/build-module/list-item/utils.js.map +1 -0
- package/build-module/media-text/media-container.native.js +1 -14
- package/build-module/media-text/media-container.native.js.map +1 -1
- package/build-module/navigation/edit/index.js +37 -17
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/navigation-menu-delete-control.js +1 -1
- package/build-module/navigation/edit/navigation-menu-delete-control.js.map +1 -1
- package/build-module/navigation/edit/unsaved-inner-blocks.js +35 -8
- package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build-module/navigation/index.js +9 -1
- package/build-module/navigation/index.js.map +1 -1
- package/build-module/navigation/use-navigation-menu.js +1 -0
- package/build-module/navigation/use-navigation-menu.js.map +1 -1
- package/build-module/navigation-link/edit.js +9 -5
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-link/index.js +1 -1
- package/build-module/navigation-submenu/edit.js +6 -10
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/navigation-submenu/index.js +1 -1
- package/build-module/post-comment/edit.js +2 -2
- package/build-module/post-comment/edit.js.map +1 -1
- package/build-module/post-comments/index.js +4 -3
- package/build-module/post-comments/index.js.map +1 -1
- package/build-module/post-comments-form/edit.js +3 -2
- package/build-module/post-comments-form/edit.js.map +1 -1
- package/build-module/post-featured-image/edit.js +19 -7
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/post-featured-image/index.js +1 -1
- package/build-module/post-template/edit.js +7 -2
- package/build-module/post-template/edit.js.map +1 -1
- package/build-module/post-terms/edit.js +4 -2
- package/build-module/post-terms/edit.js.map +1 -1
- package/build-module/post-terms/variations.js +3 -3
- package/build-module/post-terms/variations.js.map +1 -1
- package/build-module/query/edit/index.js +87 -26
- package/build-module/query/edit/index.js.map +1 -1
- package/build-module/query/edit/query-placeholder.js +8 -15
- package/build-module/query/edit/query-placeholder.js.map +1 -1
- package/build-module/query/edit/query-toolbar.js +6 -1
- package/build-module/query/edit/query-toolbar.js.map +1 -1
- package/build-module/query-pagination/edit.js +1 -1
- package/build-module/query-pagination/edit.js.map +1 -1
- package/build-module/query-pagination-numbers/index.js +19 -1
- package/build-module/query-pagination-numbers/index.js.map +1 -1
- package/build-module/quote/index.js +19 -1
- package/build-module/quote/index.js.map +1 -1
- package/build-module/quote/v2/deprecated.js +116 -0
- package/build-module/quote/v2/deprecated.js.map +1 -0
- package/build-module/quote/v2/edit.js +115 -0
- package/build-module/quote/v2/edit.js.map +1 -0
- package/build-module/quote/v2/index.js +33 -0
- package/build-module/quote/v2/index.js.map +1 -0
- package/build-module/quote/v2/save.js +30 -0
- package/build-module/quote/v2/save.js.map +1 -0
- package/build-module/quote/v2/transforms.js +147 -0
- package/build-module/quote/v2/transforms.js.map +1 -0
- package/build-module/read-more/index.js +1 -1
- package/build-module/rss/edit.js +5 -1
- package/build-module/rss/edit.js.map +1 -1
- package/build-module/site-logo/edit.js +3 -2
- package/build-module/site-logo/edit.js.map +1 -1
- package/build-module/site-logo/index.js +1 -1
- package/build-module/social-links/index.js +1 -0
- package/build-module/social-links/index.js.map +1 -1
- package/build-module/spacer/controls.native.js +1 -1
- package/build-module/spacer/controls.native.js.map +1 -1
- package/build-module/template-part/edit/utils/hooks.js +5 -2
- package/build-module/template-part/edit/utils/hooks.js.map +1 -1
- package/build-style/avatar/editor-rtl.css +4 -0
- package/build-style/avatar/editor.css +4 -0
- package/build-style/avatar/style-rtl.css +79 -0
- package/build-style/avatar/style.css +79 -0
- package/build-style/editor-rtl.css +69 -9
- package/build-style/editor.css +69 -9
- package/build-style/group/editor-rtl.css +26 -0
- package/build-style/group/editor.css +26 -0
- package/build-style/heading/style-rtl.css +0 -8
- package/build-style/heading/style.css +0 -8
- package/build-style/list/style-rtl.css +1 -1
- package/build-style/list/style.css +1 -1
- package/build-style/navigation/style-rtl.css +11 -9
- package/build-style/navigation/style.css +11 -9
- package/build-style/navigation-link/style-rtl.css +3 -0
- package/build-style/navigation-link/style.css +3 -0
- package/build-style/paragraph/style-rtl.css +0 -4
- package/build-style/paragraph/style.css +0 -4
- package/build-style/query/editor-rtl.css +39 -0
- package/build-style/query/editor.css +39 -0
- package/build-style/quote/style-rtl.css +1 -0
- package/build-style/quote/style.css +1 -0
- package/build-style/reset-rtl.css +1 -1
- package/build-style/reset.css +1 -1
- package/build-style/style-rtl.css +20 -22
- package/build-style/style.css +20 -22
- package/build-style/template-part/editor-rtl.css +0 -9
- package/build-style/template-part/editor.css +0 -9
- package/package.json +28 -28
- package/src/archives/block.json +5 -1
- package/src/archives/edit.js +20 -2
- package/src/archives/index.php +4 -4
- package/src/audio/edit.js +1 -1
- package/src/audio/edit.native.js +0 -5
- package/src/avatar/edit.js +21 -13
- package/src/avatar/editor.scss +6 -0
- package/src/avatar/index.php +2 -2
- package/src/avatar/style.scss +5 -0
- package/src/block/edit.js +21 -11
- package/src/column/block.json +1 -0
- package/src/comment-author-avatar/block.json +3 -3
- package/src/comment-author-name/block.json +7 -3
- package/src/comment-author-name/index.php +3 -0
- package/src/comment-content/block.json +1 -1
- package/src/comment-date/block.json +7 -3
- package/src/comment-date/index.php +6 -1
- package/src/comment-edit-link/block.json +5 -1
- package/src/comment-edit-link/index.php +3 -0
- package/src/comment-reply-link/block.json +5 -1
- package/src/comment-reply-link/index.php +4 -1
- package/src/comment-template/block.json +2 -8
- package/src/comment-template/edit.js +17 -22
- package/src/comment-template/hooks.js +10 -25
- package/src/comment-template/index.php +15 -5
- package/src/comments-pagination-next/block.json +2 -9
- package/src/comments-pagination-numbers/block.json +2 -8
- package/src/comments-pagination-previous/block.json +2 -2
- package/src/comments-query-loop/block.json +1 -23
- package/src/comments-query-loop/edit/comments-inspector-controls.js +2 -83
- package/src/comments-query-loop/edit.js +54 -1
- package/src/cover/block.json +5 -0
- package/src/cover/edit.js +77 -29
- package/src/cover/index.php +85 -0
- package/src/cover/save.js +18 -14
- package/src/cover/transforms.js +51 -28
- package/src/gallery/block.json +1 -0
- package/src/gallery/gap-styles.js +9 -4
- package/src/gallery/index.php +7 -6
- package/src/group/block.json +2 -4
- package/src/group/edit.js +4 -1
- package/src/group/editor.scss +31 -0
- package/src/group/variations.js +21 -4
- package/src/heading/edit.js +1 -1
- package/src/heading/style.scss +0 -3
- package/src/html/edit.js +22 -30
- package/src/image/edit.native.js +7 -11
- package/src/index.js +19 -16
- package/src/list/deprecated.js +2 -2
- package/src/list/index.js +7 -3
- package/src/list/style.scss +1 -2
- package/src/list/test/migrate.js +159 -0
- package/src/list/v2/deprecated.js +89 -0
- package/src/list/v2/edit.js +110 -1
- package/src/list/v2/index.js +2 -0
- package/src/list/v2/migrate.js +87 -0
- package/src/list-item/edit.js +69 -23
- package/src/list-item/hooks/index.js +3 -0
- package/src/list-item/hooks/use-enter.js +94 -0
- package/src/list-item/hooks/use-indent-list-item.js +89 -0
- package/src/list-item/hooks/use-outdent-list-item.js +95 -0
- package/src/list-item/index.js +1 -1
- package/src/list-item/utils.js +14 -0
- package/src/media-text/media-container.native.js +1 -14
- package/src/navigation/block.json +9 -1
- package/src/navigation/edit/index.js +50 -14
- package/src/navigation/edit/navigation-menu-delete-control.js +1 -1
- package/src/navigation/edit/unsaved-inner-blocks.js +57 -8
- package/src/navigation/index.php +6 -1
- package/src/navigation/style.scss +15 -13
- package/src/navigation/use-navigation-menu.js +4 -0
- package/src/navigation-link/block.json +1 -0
- package/src/navigation-link/edit.js +43 -35
- package/src/navigation-link/index.php +8 -0
- package/src/navigation-link/style.scss +6 -0
- package/src/navigation-submenu/block.json +1 -0
- package/src/navigation-submenu/edit.js +7 -9
- package/src/paragraph/style.scss +0 -5
- package/src/post-author/index.php +0 -1
- package/src/post-comment/edit.js +2 -2
- package/src/post-comments/block.json +4 -3
- package/src/post-comments-form/edit.js +6 -3
- package/src/post-comments-form/index.php +12 -4
- package/src/post-featured-image/block.json +1 -1
- package/src/post-featured-image/edit.js +24 -12
- package/src/post-template/edit.js +7 -1
- package/src/post-terms/edit.js +4 -1
- package/src/post-terms/variations.js +3 -3
- package/src/query/edit/index.js +125 -26
- package/src/query/edit/query-placeholder.js +3 -13
- package/src/query/edit/query-toolbar.js +6 -0
- package/src/query/editor.scss +38 -0
- package/src/query-pagination/edit.js +1 -1
- package/src/query-pagination/index.php +9 -2
- package/src/query-pagination-numbers/block.json +19 -1
- package/src/quote/block.json +8 -0
- package/src/quote/index.js +10 -1
- package/src/quote/style.scss +1 -0
- package/src/quote/v2/deprecated.js +107 -0
- package/src/quote/v2/edit.js +136 -0
- package/src/quote/v2/index.js +36 -0
- package/src/quote/v2/save.js +26 -0
- package/src/quote/v2/test/migrate.js +92 -0
- package/src/quote/v2/transforms.js +155 -0
- package/src/read-more/block.json +1 -1
- package/src/reset.scss +1 -1
- package/src/rss/edit.js +3 -1
- package/src/rss/index.php +14 -1
- package/src/site-logo/block.json +1 -1
- package/src/site-logo/edit.js +2 -1
- package/src/site-logo/index.php +0 -4
- package/src/social-link/index.php +1 -2
- package/src/social-links/block.json +1 -0
- package/src/spacer/controls.native.js +1 -1
- package/src/spacer/test/__snapshots__/index.native.js.snap +31 -0
- package/src/spacer/test/index.native.js +180 -0
- package/src/style.scss +1 -0
- package/src/template-part/edit/utils/hooks.js +6 -1
- package/src/template-part/editor.scss +0 -10
- package/build/navigation/edit/use-list-view-modal.js +0 -73
- package/build/navigation/edit/use-list-view-modal.js.map +0 -1
- package/build-module/navigation/edit/use-list-view-modal.js +0 -63
- package/build-module/navigation/edit/use-list-view-modal.js.map +0 -1
- package/src/navigation/edit/use-list-view-modal.js +0 -72
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/index.js"],"names":["registerBlock","block","metadata","settings","name","__experimentalGetCoreBlocks","paragraph","image","heading","gallery","list","listItem","quote","archives","audio","button","buttons","calendar","categories","window","wp","oldEditor","classic","code","column","columns","cover","embed","file","group","html","latestComments","latestPosts","mediaText","missing","more","nextpage","pageList","pattern","preformatted","pullquote","reusableBlock","rss","search","separator","shortcode","socialLink","socialLinks","spacer","table","tagCloud","textColumns","verse","video","navigation","navigationLink","navigationSubmenu","siteLogo","siteTitle","siteTagline","query","templatePart","postTitle","postExcerpt","postFeaturedImage","postContent","postAuthor","postDate","postTerms","postNavigationLink","postTemplate","queryPagination","queryPaginationNext","queryPaginationNumbers","queryPaginationPrevious","postComments","logInOut","termDescription","queryTitle","postAuthorBiography","registerCoreBlocks","blocks","forEach","__experimentalRegisterExperimentalCoreBlocks","process","env","IS_GUTENBERG_PLUGIN","enableFSEBlocks","avatar","homeLink","postAuthorName","queryNoResults","commentAuthorAvatar","commentAuthorName","commentContent","commentDate","commentEditLink","commentReplyLink","commentTemplate","commentsQueryLoop","commentsPagination","commentsPaginationNext","commentsPaginationNumbers","commentsPaginationPrevious","navigationArea","postComment","postCommentsCount","postCommentsForm","postCommentsLink","readMore","undefined"],"mappings":";;;;;;;AAGA;;AAWA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AA1GA;AACA;AACA;;AASA;AACA;AACA;;AA+FA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,aAAa,GAAKC,KAAF,IAAa;AAClC,MAAK,CAAEA,KAAP,EAAe;AACd;AACA;;AACD,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA,QAAZ;AAAsBC,IAAAA;AAAtB,MAA+BH,KAArC;AACA,iCAAmB;AAAEG,IAAAA,IAAF;AAAQ,OAAGF;AAAX,GAAnB,EAA0CC,QAA1C;AACA,CAND;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAME,2BAA2B,GAAG,MAAM,CAChD;AACA;AACAC,SAHgD,EAIhDC,KAJgD,EAKhDC,OALgD,EAMhDC,OANgD,EAOhDC,IAPgD,EAQhDC,QARgD,EAShDC,KATgD,EAWhD;AACAC,QAZgD,EAahDC,KAbgD,EAchDC,MAdgD,EAehDC,OAfgD,EAgBhDC,QAhBgD,EAiBhDC,UAjBgD,EAkBhDC,MAAM,CAACC,EAAP,IAAaD,MAAM,CAACC,EAAP,CAAUC,SAAvB,GAAmCC,OAAnC,GAA6C,IAlBG,EAkBG;AACnDC,IAnBgD,EAoBhDC,MApBgD,EAqBhDC,OArBgD,EAsBhDC,KAtBgD,EAuBhDC,KAvBgD,EAwBhDC,IAxBgD,EAyBhDC,KAzBgD,EA0BhDC,IA1BgD,EA2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AACD,8CAAgC8B,OAAO,CAAC9B,IAAxC;AACA,oCAAsByB,KAAK,CAACzB,IAA5B;AACA,CAXM;AAaP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAM+E,4CAA4C,GAAGC,OAAO,CAACC,GAAR,CAC1DC,mBAD0D,GAEzD,YAAgC;AAAA,MAA9B;AAAEC,IAAAA;AAAF,GAA8B,uEAAR,EAAQ;AAChC,GACC;AACAC,EAAAA,MAFD,EAGCC,QAHD,EAICC,cAJD,EAKCC,cALD,EAMC;AACA,MAAKJ,eAAe,GACjB,CACAK,mBADA,EAEAC,iBAFA,EAGAC,cAHA,EAIAC,WAJA,EAKAC,eALA,EAMAC,gBANA,EAOAC,eAPA,EAQAC,iBARA,EASAC,kBATA,EAUAC,sBAVA,EAWAC,yBAXA,EAYAC,0BAZA,EAaAC,cAbA,EAcAC,WAdA,EAeAC,iBAfA,EAgBAC,gBAhBA,EAiBAC,gBAjBA,EAkBAC,QAlBA,CADiB,GAqBjB,EArBH,CAPD,EA6BE3B,OA7BF,CA6BWlF,aA7BX;AA8BC,CAjCwD,GAkCzD8G,SAlCI","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tregisterBlockType,\n\tsetDefaultBlockName,\n\tsetFreeformContentHandlerName,\n\tsetUnregisteredTypeHandlerName,\n\tsetGroupingBlockName,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport * as archives from './archives';\nimport * as avatar from './avatar';\nimport * as audio from './audio';\nimport * as button from './button';\nimport * as buttons from './buttons';\nimport * as calendar from './calendar';\nimport * as categories from './categories';\nimport * as classic from './freeform';\nimport * as code from './code';\nimport * as column from './column';\nimport * as columns from './columns';\nimport * as commentAuthorAvatar from './comment-author-avatar';\nimport * as commentAuthorName from './comment-author-name';\nimport * as commentContent from './comment-content';\nimport * as commentDate from './comment-date';\nimport * as commentEditLink from './comment-edit-link';\nimport * as commentReplyLink from './comment-reply-link';\nimport * as commentTemplate from './comment-template';\nimport * as commentsPaginationPrevious from './comments-pagination-previous';\nimport * as commentsQueryLoop from './comments-query-loop';\nimport * as commentsPagination from './comments-pagination';\nimport * as commentsPaginationNext from './comments-pagination-next';\nimport * as commentsPaginationNumbers from './comments-pagination-numbers';\nimport * as cover from './cover';\nimport * as embed from './embed';\nimport * as file from './file';\nimport * as gallery from './gallery';\nimport * as group from './group';\nimport * as heading from './heading';\nimport * as homeLink from './home-link';\nimport * as html from './html';\nimport * as image from './image';\nimport * as latestComments from './latest-comments';\nimport * as latestPosts from './latest-posts';\nimport * as list from './list';\nimport * as listItem from './list-item';\nimport * as logInOut from './loginout';\nimport * as mediaText from './media-text';\nimport * as missing from './missing';\nimport * as more from './more';\nimport * as navigation from './navigation';\nimport * as navigationArea from './navigation-area';\nimport * as navigationLink from './navigation-link';\nimport * as navigationSubmenu from './navigation-submenu';\nimport * as nextpage from './nextpage';\nimport * as pattern from './pattern';\nimport * as pageList from './page-list';\nimport * as paragraph from './paragraph';\nimport * as postAuthor from './post-author';\nimport * as postAuthorName from './post-author-name';\nimport * as postAuthorBiography from './post-author-biography';\nimport * as postComment from './post-comment';\nimport * as postComments from './post-comments';\nimport * as postCommentsCount from './post-comments-count';\nimport * as postCommentsForm from './post-comments-form';\nimport * as postCommentsLink from './post-comments-link';\nimport * as postContent from './post-content';\nimport * as postDate from './post-date';\nimport * as postExcerpt from './post-excerpt';\nimport * as postFeaturedImage from './post-featured-image';\nimport * as postNavigationLink from './post-navigation-link';\nimport * as postTemplate from './post-template';\nimport * as postTerms from './post-terms';\nimport * as postTitle from './post-title';\nimport * as preformatted from './preformatted';\nimport * as pullquote from './pullquote';\nimport * as query from './query';\nimport * as queryNoResults from './query-no-results';\nimport * as queryPagination from './query-pagination';\nimport * as queryPaginationNext from './query-pagination-next';\nimport * as queryPaginationNumbers from './query-pagination-numbers';\nimport * as queryPaginationPrevious from './query-pagination-previous';\nimport * as queryTitle from './query-title';\nimport * as quote from './quote';\nimport * as reusableBlock from './block';\nimport * as readMore from './read-more';\nimport * as rss from './rss';\nimport * as search from './search';\nimport * as separator from './separator';\nimport * as shortcode from './shortcode';\nimport * as siteLogo from './site-logo';\nimport * as siteTagline from './site-tagline';\nimport * as siteTitle from './site-title';\nimport * as socialLink from './social-link';\nimport * as socialLinks from './social-links';\nimport * as spacer from './spacer';\nimport * as table from './table';\nimport * as tagCloud from './tag-cloud';\nimport * as templatePart from './template-part';\nimport * as termDescription from './term-description';\nimport * as textColumns from './text-columns';\nimport * as verse from './verse';\nimport * as video from './video';\n\n/**\n * Function to register an individual block.\n *\n * @param {Object} block The block to be registered.\n *\n */\nconst registerBlock = ( block ) => {\n\tif ( ! block ) {\n\t\treturn;\n\t}\n\tconst { metadata, settings, name } = block;\n\tregisterBlockType( { name, ...metadata }, settings );\n};\n\n/**\n * Function to get all the core blocks in an array.\n *\n * @example\n * ```js\n * import { __experimentalGetCoreBlocks } from '@wordpress/block-library';\n *\n * const coreBlocks = __experimentalGetCoreBlocks();\n * ```\n */\nexport const __experimentalGetCoreBlocks = () => [\n\t// Common blocks are grouped at the top to prioritize their display\n\t// in various contexts — like the inserter and auto-complete components.\n\tparagraph,\n\timage,\n\theading,\n\tgallery,\n\tlist,\n\tlistItem,\n\tquote,\n\n\t// Register all remaining core blocks.\n\tarchives,\n\taudio,\n\tbutton,\n\tbuttons,\n\tcalendar,\n\tcategories,\n\twindow.wp && window.wp.oldEditor ? classic : null, // Only add the classic block in WP Context.\n\tcode,\n\tcolumn,\n\tcolumns,\n\tcover,\n\tembed,\n\tfile,\n\tgroup,\n\thtml,\n\tlatestComments,\n\tlatestPosts,\n\tmediaText,\n\tmissing,\n\tmore,\n\tnextpage,\n\tpageList,\n\tpattern,\n\tpreformatted,\n\tpullquote,\n\treusableBlock,\n\trss,\n\tsearch,\n\tseparator,\n\tshortcode,\n\tsocialLink,\n\tsocialLinks,\n\tspacer,\n\ttable,\n\t// tableOfContents,\n\ttagCloud,\n\ttextColumns,\n\tverse,\n\tvideo,\n\n\t// theme blocks\n\tnavigation,\n\tnavigationLink,\n\tnavigationSubmenu,\n\tsiteLogo,\n\tsiteTitle,\n\tsiteTagline,\n\tquery,\n\ttemplatePart,\n\tpostTitle,\n\tpostExcerpt,\n\tpostFeaturedImage,\n\tpostContent,\n\tpostAuthor,\n\tpostDate,\n\tpostTerms,\n\tpostNavigationLink,\n\tpostTemplate,\n\tqueryPagination,\n\tqueryPaginationNext,\n\tqueryPaginationNumbers,\n\tqueryPaginationPrevious,\n\tpostComments,\n\tlogInOut,\n\ttermDescription,\n\tqueryTitle,\n\tpostAuthorBiography,\n];\n\n/**\n * Function to register core blocks provided by the block editor.\n *\n * @param {Array} blocks An optional array of the core blocks being registered.\n *\n * @example\n * ```js\n * import { registerCoreBlocks } from '@wordpress/block-library';\n *\n * registerCoreBlocks();\n * ```\n */\nexport const registerCoreBlocks = (\n\tblocks = __experimentalGetCoreBlocks()\n) => {\n\tblocks.forEach( registerBlock );\n\n\tsetDefaultBlockName( paragraph.name );\n\tif ( window.wp && window.wp.oldEditor ) {\n\t\tsetFreeformContentHandlerName( classic.name );\n\t}\n\tsetUnregisteredTypeHandlerName( missing.name );\n\tsetGroupingBlockName( group.name );\n};\n\n/**\n * Function to register experimental core blocks depending on editor settings.\n *\n * @param {boolean} enableFSEBlocks Whether to enable the full site editing blocks.\n * @example\n * ```js\n * import { __experimentalRegisterExperimentalCoreBlocks } from '@wordpress/block-library';\n *\n * __experimentalRegisterExperimentalCoreBlocks( settings );\n * ```\n */\nexport const __experimentalRegisterExperimentalCoreBlocks = process.env\n\t.IS_GUTENBERG_PLUGIN\n\t? ( { enableFSEBlocks } = {} ) => {\n\t\t\t[\n\t\t\t\t// Experimental blocks.\n\t\t\t\tavatar,\n\t\t\t\thomeLink,\n\t\t\t\tpostAuthorName,\n\t\t\t\tqueryNoResults,\n\t\t\t\t// Full Site Editing blocks.\n\t\t\t\t...( enableFSEBlocks\n\t\t\t\t\t? [\n\t\t\t\t\t\t\tcommentAuthorAvatar,\n\t\t\t\t\t\t\tcommentAuthorName,\n\t\t\t\t\t\t\tcommentContent,\n\t\t\t\t\t\t\tcommentDate,\n\t\t\t\t\t\t\tcommentEditLink,\n\t\t\t\t\t\t\tcommentReplyLink,\n\t\t\t\t\t\t\tcommentTemplate,\n\t\t\t\t\t\t\tcommentsQueryLoop,\n\t\t\t\t\t\t\tcommentsPagination,\n\t\t\t\t\t\t\tcommentsPaginationNext,\n\t\t\t\t\t\t\tcommentsPaginationNumbers,\n\t\t\t\t\t\t\tcommentsPaginationPrevious,\n\t\t\t\t\t\t\tnavigationArea,\n\t\t\t\t\t\t\tpostComment,\n\t\t\t\t\t\t\tpostCommentsCount,\n\t\t\t\t\t\t\tpostCommentsForm,\n\t\t\t\t\t\t\tpostCommentsLink,\n\t\t\t\t\t\t\treadMore,\n\t\t\t\t\t ]\n\t\t\t\t\t: [] ),\n\t\t\t].forEach( registerBlock );\n\t }\n\t: undefined;\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/index.js"],"names":["registerBlock","block","metadata","settings","name","__experimentalGetCoreBlocks","paragraph","image","heading","gallery","list","quote","archives","audio","button","buttons","calendar","categories","window","wp","oldEditor","classic","code","column","columns","cover","embed","file","group","html","latestComments","latestPosts","mediaText","missing","more","nextpage","pageList","pattern","preformatted","pullquote","reusableBlock","rss","search","separator","shortcode","socialLink","socialLinks","spacer","table","tagCloud","textColumns","verse","video","navigation","navigationLink","navigationSubmenu","siteLogo","siteTitle","siteTagline","query","templatePart","avatar","postTitle","postExcerpt","postFeaturedImage","postContent","postAuthor","postDate","postTerms","postNavigationLink","postTemplate","queryPagination","queryPaginationNext","queryPaginationNumbers","queryPaginationPrevious","queryNoResults","readMore","commentAuthorName","commentContent","commentDate","commentEditLink","commentReplyLink","commentTemplate","commentsQueryLoop","commentsPagination","commentsPaginationNext","commentsPaginationNumbers","commentsPaginationPrevious","postComments","homeLink","logInOut","termDescription","queryTitle","postAuthorBiography","registerCoreBlocks","blocks","forEach","__experimentalRegisterExperimentalCoreBlocks","process","env","IS_GUTENBERG_PLUGIN","enableFSEBlocks","postAuthorName","__experimentalEnableListBlockV2","listItem","commentAuthorAvatar","navigationArea","postComment","postCommentsCount","postCommentsForm","postCommentsLink","undefined"],"mappings":";;;;;;;AAGA;;AAWA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AA1GA;AACA;AACA;;AASA;AACA;AACA;;AA+FA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,aAAa,GAAKC,KAAF,IAAa;AAClC,MAAK,CAAEA,KAAP,EAAe;AACd;AACA;;AACD,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA,QAAZ;AAAsBC,IAAAA;AAAtB,MAA+BH,KAArC;AACA,iCAAmB;AAAEG,IAAAA,IAAF;AAAQ,OAAGF;AAAX,GAAnB,EAA0CC,QAA1C;AACA,CAND;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAME,2BAA2B,GAAG,MAAM,CAChD;AACA;AACAC,SAHgD,EAIhDC,KAJgD,EAKhDC,OALgD,EAMhDC,OANgD,EAOhDC,IAPgD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WordPress dependencies\n */\nimport {\n\tregisterBlockType,\n\tsetDefaultBlockName,\n\tsetFreeformContentHandlerName,\n\tsetUnregisteredTypeHandlerName,\n\tsetGroupingBlockName,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport * as archives from './archives';\nimport * as avatar from './avatar';\nimport * as audio from './audio';\nimport * as button from './button';\nimport * as buttons from './buttons';\nimport * as calendar from './calendar';\nimport * as categories from './categories';\nimport * as classic from './freeform';\nimport * as code from './code';\nimport * as column from './column';\nimport * as columns from './columns';\nimport * as commentAuthorAvatar from './comment-author-avatar';\nimport * as commentAuthorName from './comment-author-name';\nimport * as commentContent from './comment-content';\nimport * as commentDate from './comment-date';\nimport * as commentEditLink from './comment-edit-link';\nimport * as commentReplyLink from './comment-reply-link';\nimport * as commentTemplate from './comment-template';\nimport * as commentsPaginationPrevious from './comments-pagination-previous';\nimport * as commentsQueryLoop from './comments-query-loop';\nimport * as commentsPagination from './comments-pagination';\nimport * as commentsPaginationNext from './comments-pagination-next';\nimport * as commentsPaginationNumbers from './comments-pagination-numbers';\nimport * as cover from './cover';\nimport * as embed from './embed';\nimport * as file from './file';\nimport * as gallery from './gallery';\nimport * as group from './group';\nimport * as heading from './heading';\nimport * as homeLink from './home-link';\nimport * as html from './html';\nimport * as image from './image';\nimport * as latestComments from './latest-comments';\nimport * as latestPosts from './latest-posts';\nimport * as list from './list';\nimport * as listItem from './list-item';\nimport * as logInOut from './loginout';\nimport * as mediaText from './media-text';\nimport * as missing from './missing';\nimport * as more from './more';\nimport * as navigation from './navigation';\nimport * as navigationArea from './navigation-area';\nimport * as navigationLink from './navigation-link';\nimport * as navigationSubmenu from './navigation-submenu';\nimport * as nextpage from './nextpage';\nimport * as pattern from './pattern';\nimport * as pageList from './page-list';\nimport * as paragraph from './paragraph';\nimport * as postAuthor from './post-author';\nimport * as postAuthorName from './post-author-name';\nimport * as postAuthorBiography from './post-author-biography';\nimport * as postComment from './post-comment';\nimport * as postComments from './post-comments';\nimport * as postCommentsCount from './post-comments-count';\nimport * as postCommentsForm from './post-comments-form';\nimport * as postCommentsLink from './post-comments-link';\nimport * as postContent from './post-content';\nimport * as postDate from './post-date';\nimport * as postExcerpt from './post-excerpt';\nimport * as postFeaturedImage from './post-featured-image';\nimport * as postNavigationLink from './post-navigation-link';\nimport * as postTemplate from './post-template';\nimport * as postTerms from './post-terms';\nimport * as postTitle from './post-title';\nimport * as preformatted from './preformatted';\nimport * as pullquote from './pullquote';\nimport * as query from './query';\nimport * as queryNoResults from './query-no-results';\nimport * as queryPagination from './query-pagination';\nimport * as queryPaginationNext from './query-pagination-next';\nimport * as queryPaginationNumbers from './query-pagination-numbers';\nimport * as queryPaginationPrevious from './query-pagination-previous';\nimport * as queryTitle from './query-title';\nimport * as quote from './quote';\nimport * as reusableBlock from './block';\nimport * as readMore from './read-more';\nimport * as rss from './rss';\nimport * as search from './search';\nimport * as separator from './separator';\nimport * as shortcode from './shortcode';\nimport * as siteLogo from './site-logo';\nimport * as siteTagline from './site-tagline';\nimport * as siteTitle from './site-title';\nimport * as socialLink from './social-link';\nimport * as socialLinks from './social-links';\nimport * as spacer from './spacer';\nimport * as table from './table';\nimport * as tagCloud from './tag-cloud';\nimport * as templatePart from './template-part';\nimport * as termDescription from './term-description';\nimport * as textColumns from './text-columns';\nimport * as verse from './verse';\nimport * as video from './video';\n\n/**\n * Function to register an individual block.\n *\n * @param {Object} block The block to be registered.\n *\n */\nconst registerBlock = ( block ) => {\n\tif ( ! block ) {\n\t\treturn;\n\t}\n\tconst { metadata, settings, name } = block;\n\tregisterBlockType( { name, ...metadata }, settings );\n};\n\n/**\n * Function to get all the core blocks in an array.\n *\n * @example\n * ```js\n * import { __experimentalGetCoreBlocks } from '@wordpress/block-library';\n *\n * const coreBlocks = __experimentalGetCoreBlocks();\n * ```\n */\nexport const __experimentalGetCoreBlocks = () => [\n\t// Common blocks are grouped at the top to prioritize their display\n\t// in various contexts — like the inserter and auto-complete components.\n\tparagraph,\n\timage,\n\theading,\n\tgallery,\n\tlist,\n\tquote,\n\n\t// Register all remaining core blocks.\n\tarchives,\n\taudio,\n\tbutton,\n\tbuttons,\n\tcalendar,\n\tcategories,\n\twindow.wp && window.wp.oldEditor ? classic : null, // Only add the classic block in WP Context.\n\tcode,\n\tcolumn,\n\tcolumns,\n\tcover,\n\tembed,\n\tfile,\n\tgroup,\n\thtml,\n\tlatestComments,\n\tlatestPosts,\n\tmediaText,\n\tmissing,\n\tmore,\n\tnextpage,\n\tpageList,\n\tpattern,\n\tpreformatted,\n\tpullquote,\n\treusableBlock,\n\trss,\n\tsearch,\n\tseparator,\n\tshortcode,\n\tsocialLink,\n\tsocialLinks,\n\tspacer,\n\ttable,\n\t// tableOfContents,\n\ttagCloud,\n\ttextColumns,\n\tverse,\n\tvideo,\n\n\t// theme blocks\n\tnavigation,\n\tnavigationLink,\n\tnavigationSubmenu,\n\tsiteLogo,\n\tsiteTitle,\n\tsiteTagline,\n\tquery,\n\ttemplatePart,\n\tavatar,\n\tpostTitle,\n\tpostExcerpt,\n\tpostFeaturedImage,\n\tpostContent,\n\tpostAuthor,\n\tpostDate,\n\tpostTerms,\n\tpostNavigationLink,\n\tpostTemplate,\n\tqueryPagination,\n\tqueryPaginationNext,\n\tqueryPaginationNumbers,\n\tqueryPaginationPrevious,\n\tqueryNoResults,\n\treadMore,\n\tcommentAuthorName,\n\tcommentContent,\n\tcommentDate,\n\tcommentEditLink,\n\tcommentReplyLink,\n\tcommentTemplate,\n\tcommentsQueryLoop,\n\tcommentsPagination,\n\tcommentsPaginationNext,\n\tcommentsPaginationNumbers,\n\tcommentsPaginationPrevious,\n\tpostComments,\n\thomeLink,\n\tlogInOut,\n\ttermDescription,\n\tqueryTitle,\n\tpostAuthorBiography,\n];\n\n/**\n * Function to register core blocks provided by the block editor.\n *\n * @param {Array} blocks An optional array of the core blocks being registered.\n *\n * @example\n * ```js\n * import { registerCoreBlocks } from '@wordpress/block-library';\n *\n * registerCoreBlocks();\n * ```\n */\nexport const registerCoreBlocks = (\n\tblocks = __experimentalGetCoreBlocks()\n) => {\n\tblocks.forEach( registerBlock );\n\n\tsetDefaultBlockName( paragraph.name );\n\tif ( window.wp && window.wp.oldEditor ) {\n\t\tsetFreeformContentHandlerName( classic.name );\n\t}\n\tsetUnregisteredTypeHandlerName( missing.name );\n\tsetGroupingBlockName( group.name );\n};\n\n/**\n * Function to register experimental core blocks depending on editor settings.\n *\n * @param {boolean} enableFSEBlocks Whether to enable the full site editing blocks.\n * @example\n * ```js\n * import { __experimentalRegisterExperimentalCoreBlocks } from '@wordpress/block-library';\n *\n * __experimentalRegisterExperimentalCoreBlocks( settings );\n * ```\n */\nexport const __experimentalRegisterExperimentalCoreBlocks = process.env\n\t.IS_GUTENBERG_PLUGIN\n\t? ( { enableFSEBlocks } = {} ) => {\n\t\t\t[\n\t\t\t\t// Experimental blocks.\n\t\t\t\tpostAuthorName,\n\t\t\t\t...( window.__experimentalEnableListBlockV2\n\t\t\t\t\t? [ listItem ]\n\t\t\t\t\t: [] ),\n\n\t\t\t\t// Full Site Editing blocks.\n\t\t\t\t...( enableFSEBlocks\n\t\t\t\t\t? [\n\t\t\t\t\t\t\tcommentAuthorAvatar,\n\t\t\t\t\t\t\tnavigationArea,\n\t\t\t\t\t\t\tpostComment,\n\t\t\t\t\t\t\tpostCommentsCount,\n\t\t\t\t\t\t\tpostCommentsForm,\n\t\t\t\t\t\t\tpostCommentsLink,\n\t\t\t\t\t ]\n\t\t\t\t\t: [] ),\n\t\t\t].forEach( registerBlock );\n\t }\n\t: undefined;\n"]}
|
package/build/list/deprecated.js
CHANGED
|
@@ -20,7 +20,7 @@ var _migrateFontFamily = _interopRequireDefault(require("../utils/migrate-font-f
|
|
|
20
20
|
/**
|
|
21
21
|
* Internal dependencies
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const v0 = {
|
|
24
24
|
attributes: {
|
|
25
25
|
ordered: {
|
|
26
26
|
type: 'boolean',
|
|
@@ -108,6 +108,6 @@ const v1 = {
|
|
|
108
108
|
* See block-deprecation.md
|
|
109
109
|
*/
|
|
110
110
|
|
|
111
|
-
var _default = [
|
|
111
|
+
var _default = [v0];
|
|
112
112
|
exports.default = _default;
|
|
113
113
|
//# sourceMappingURL=deprecated.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/list/deprecated.js"],"names":["
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/list/deprecated.js"],"names":["v0","attributes","ordered","type","default","__experimentalRole","values","source","selector","multiline","__unstableMultilineWrapperTags","start","reversed","placeholder","supports","anchor","className","typography","fontSize","__experimentalFontFamily","color","gradients","link","__unstablePasteTextInline","__experimentalSelector","__experimentalSlashInserter","save","TagName","useBlockProps","migrate","migrateFontFamily","isEligible","style","fontFamily"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAGA,MAAMA,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,EAAE,MAFD;AAGPC,MAAAA,QAAQ,EAAE,OAHH;AAIPC,MAAAA,SAAS,EAAE,IAJJ;AAKPC,MAAAA,8BAA8B,EAAE,CAAE,IAAF,EAAQ,IAAR,CALzB;AAMPN,MAAAA,OAAO,EAAE,EANF;AAOPC,MAAAA,kBAAkB,EAAE;AAPb,KANG;AAeXF,IAAAA,IAAI,EAAE;AACLA,MAAAA,IAAI,EAAE;AADD,KAfK;AAkBXQ,IAAAA,KAAK,EAAE;AACNR,MAAAA,IAAI,EAAE;AADA,KAlBI;AAqBXS,IAAAA,QAAQ,EAAE;AACTT,MAAAA,IAAI,EAAE;AADG,KArBC;AAwBXU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A;AACA;;eACe,CAAEjC,EAAF,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { RichText, useBlockProps } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport migrateFontFamily from '../utils/migrate-font-family';\n\nconst v0 = {\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},\n\t\tcolor: {\n\t\t\tgradients: true,\n\t\t\tlink: true,\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: migrateFontFamily,\n\tisEligible( { style } ) {\n\t\treturn style?.typography?.fontFamily;\n\t},\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 [ v0 ];\n"]}
|
package/build/list/index.js
CHANGED
|
@@ -19,8 +19,13 @@ var _transforms = _interopRequireDefault(require("./transforms"));
|
|
|
19
19
|
|
|
20
20
|
var _v = _interopRequireDefault(require("./v2"));
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
/**
|
|
23
|
+
* WordPress dependencies
|
|
24
|
+
*/
|
|
23
25
|
|
|
26
|
+
/**
|
|
27
|
+
* Internal dependencies
|
|
28
|
+
*/
|
|
24
29
|
const metadata = {
|
|
25
30
|
$schema: "https://schemas.wp.org/trunk/block.json",
|
|
26
31
|
apiVersion: 2,
|
|
@@ -120,6 +125,12 @@ const settingsV1 = {
|
|
|
120
125
|
save: _save.default,
|
|
121
126
|
deprecated: _deprecated.default
|
|
122
127
|
};
|
|
123
|
-
|
|
128
|
+
let settings = settingsV1;
|
|
124
129
|
exports.settings = settings;
|
|
130
|
+
|
|
131
|
+
if (process.env.IS_GUTENBERG_PLUGIN) {
|
|
132
|
+
var _window;
|
|
133
|
+
|
|
134
|
+
exports.settings = settings = (_window = window) !== null && _window !== void 0 && _window.__experimentalEnableListBlockV2 ? _v.default : settingsV1;
|
|
135
|
+
}
|
|
125
136
|
//# sourceMappingURL=index.js.map
|
package/build/list/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/list/index.js"],"names":["name","metadata","settingsV1","icon","example","attributes","values","transforms","merge","attributesToMerge","edit","save","deprecated","settings","window","__experimentalEnableListBlockV2","settingsV2"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AAEA;;AACA;;AACA
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/list/index.js"],"names":["name","metadata","settingsV1","icon","example","attributes","values","transforms","merge","attributesToMerge","edit","save","deprecated","settings","process","env","IS_GUTENBERG_PLUGIN","window","__experimentalEnableListBlockV2","settingsV2"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AAEA;;AACA;;AACA;;AAbA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAIA,MAAMC,UAAU,GAAG;AAClBC,EAAAA,IAAI,EAAJA,WADkB;AAElBC,EAAAA,OAAO,EAAE;AACRC,IAAAA,UAAU,EAAE;AACXC,MAAAA,MAAM,EACL;AAFU;AADJ,GAFS;AAQlBC,EAAAA,UAAU,EAAVA,mBARkB;;AASlBC,EAAAA,KAAK,CAAEH,UAAF,EAAcI,iBAAd,EAAkC;AACtC,UAAM;AAAEH,MAAAA;AAAF,QAAaG,iBAAnB;;AAEA,QAAK,CAAEH,MAAF,IAAYA,MAAM,KAAK,WAA5B,EAA0C;AACzC,aAAOD,UAAP;AACA;;AAED,WAAO,EACN,GAAGA,UADG;AAENC,MAAAA,MAAM,EAAED,UAAU,CAACC,MAAX,GAAoBA;AAFtB,KAAP;AAIA,GApBiB;;AAqBlBI,EAAAA,IAAI,EAAJA,aArBkB;AAsBlBC,EAAAA,IAAI,EAAJA,aAtBkB;AAuBlBC,EAAAA,UAAU,EAAVA;AAvBkB,CAAnB;AA0BA,IAAIC,QAAQ,GAAGX,UAAf;;;AACA,IAAKY,OAAO,CAACC,GAAR,CAAYC,mBAAjB,EAAuC;AAAA;;AACtC,qBAAAH,QAAQ,GAAG,WAAAI,MAAM,UAAN,kCAAQC,+BAAR,GACRC,UADQ,GAERjB,UAFH;AAGA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { list as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\nimport settingsV2 from './v2';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nconst settingsV1 = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tvalues:\n\t\t\t\t'<li>Alice.</li><li>The White Rabbit.</li><li>The Cheshire Cat.</li><li>The Mad Hatter.</li><li>The Queen of Hearts.</li>',\n\t\t},\n\t},\n\ttransforms,\n\tmerge( attributes, attributesToMerge ) {\n\t\tconst { values } = attributesToMerge;\n\n\t\tif ( ! values || values === '<li></li>' ) {\n\t\t\treturn attributes;\n\t\t}\n\n\t\treturn {\n\t\t\t...attributes,\n\t\t\tvalues: attributes.values + values,\n\t\t};\n\t},\n\tedit,\n\tsave,\n\tdeprecated,\n};\n\nlet settings = settingsV1;\nif ( process.env.IS_GUTENBERG_PLUGIN ) {\n\tsettings = window?.__experimentalEnableListBlockV2\n\t\t? settingsV2\n\t\t: settingsV1;\n}\nexport { settings };\n"]}
|
|
@@ -0,0 +1,117 @@
|
|
|
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 = void 0;
|
|
9
|
+
|
|
10
|
+
var _element = require("@wordpress/element");
|
|
11
|
+
|
|
12
|
+
var _blockEditor = require("@wordpress/block-editor");
|
|
13
|
+
|
|
14
|
+
var _deprecated = _interopRequireDefault(require("../deprecated"));
|
|
15
|
+
|
|
16
|
+
var _migrate = require("./migrate");
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* WordPress dependencies
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Internal dependencies
|
|
24
|
+
*/
|
|
25
|
+
const v1 = {
|
|
26
|
+
attributes: {
|
|
27
|
+
ordered: {
|
|
28
|
+
type: 'boolean',
|
|
29
|
+
default: false,
|
|
30
|
+
__experimentalRole: 'content'
|
|
31
|
+
},
|
|
32
|
+
values: {
|
|
33
|
+
type: 'string',
|
|
34
|
+
source: 'html',
|
|
35
|
+
selector: 'ol,ul',
|
|
36
|
+
multiline: 'li',
|
|
37
|
+
__unstableMultilineWrapperTags: ['ol', 'ul'],
|
|
38
|
+
default: '',
|
|
39
|
+
__experimentalRole: 'content'
|
|
40
|
+
},
|
|
41
|
+
type: {
|
|
42
|
+
type: 'string'
|
|
43
|
+
},
|
|
44
|
+
start: {
|
|
45
|
+
type: 'number'
|
|
46
|
+
},
|
|
47
|
+
reversed: {
|
|
48
|
+
type: 'boolean'
|
|
49
|
+
},
|
|
50
|
+
placeholder: {
|
|
51
|
+
type: 'string'
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
supports: {
|
|
55
|
+
anchor: true,
|
|
56
|
+
className: false,
|
|
57
|
+
typography: {
|
|
58
|
+
fontSize: true,
|
|
59
|
+
__experimentalFontFamily: true,
|
|
60
|
+
lineHeight: true,
|
|
61
|
+
__experimentalFontStyle: true,
|
|
62
|
+
__experimentalFontWeight: true,
|
|
63
|
+
__experimentalLetterSpacing: true,
|
|
64
|
+
__experimentalTextTransform: true,
|
|
65
|
+
__experimentalDefaultControls: {
|
|
66
|
+
fontSize: true
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
color: {
|
|
70
|
+
gradients: true,
|
|
71
|
+
link: true,
|
|
72
|
+
__experimentalDefaultControls: {
|
|
73
|
+
background: true,
|
|
74
|
+
text: true
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
__unstablePasteTextInline: true,
|
|
78
|
+
__experimentalSelector: 'ol,ul',
|
|
79
|
+
__experimentalSlashInserter: true
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
save(_ref) {
|
|
83
|
+
let {
|
|
84
|
+
attributes
|
|
85
|
+
} = _ref;
|
|
86
|
+
const {
|
|
87
|
+
ordered,
|
|
88
|
+
values,
|
|
89
|
+
type,
|
|
90
|
+
reversed,
|
|
91
|
+
start
|
|
92
|
+
} = attributes;
|
|
93
|
+
const TagName = ordered ? 'ol' : 'ul';
|
|
94
|
+
return (0, _element.createElement)(TagName, _blockEditor.useBlockProps.save({
|
|
95
|
+
type,
|
|
96
|
+
reversed,
|
|
97
|
+
start
|
|
98
|
+
}), (0, _element.createElement)(_blockEditor.RichText.Content, {
|
|
99
|
+
value: values,
|
|
100
|
+
multiline: "li"
|
|
101
|
+
}));
|
|
102
|
+
},
|
|
103
|
+
|
|
104
|
+
migrate: _migrate.migrateToListV2
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* New deprecations need to be placed first
|
|
108
|
+
* for them to have higher priority.
|
|
109
|
+
*
|
|
110
|
+
* Old deprecations may need to be updated as well.
|
|
111
|
+
*
|
|
112
|
+
* See block-deprecation.md
|
|
113
|
+
*/
|
|
114
|
+
|
|
115
|
+
var _default = [v1, ..._deprecated.default];
|
|
116
|
+
exports.default = _default;
|
|
117
|
+
//# sourceMappingURL=deprecated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/list/v2/deprecated.js"],"names":["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","useBlockProps","migrate","migrateToListV2","initialDeprecations"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AATA;AACA;AACA;;AAGA;AACA;AACA;AAIA,MAAMA,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,EAAE,MAFD;AAGPC,MAAAA,QAAQ,EAAE,OAHH;AAIPC,M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AAF,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,4BAAC,OAAD,EAAckC,2BAAcF,IAAd,CAAoB;AAAE/B,MAAAA,IAAF;AAAQS,MAAAA,QAAR;AAAkBD,MAAAA;AAAlB,KAApB,CAAd,EACC,4BAAC,qBAAD,CAAU,OAAV;AAAkB,MAAA,KAAK,EAAGL,MAA1B;AAAmC,MAAA,SAAS,EAAC;AAA7C,MADD,CADD;AAKA,GAjES;;AAkEV+B,EAAAA,OAAO,EAAEC;AAlEC,CAAX;AAqEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;eACe,CAAEtC,EAAF,EAAM,GAAGuC,mBAAT,C","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"]}
|
package/build/list/v2/edit.js
CHANGED
|
@@ -11,16 +11,30 @@ var _element = require("@wordpress/element");
|
|
|
11
11
|
|
|
12
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
13
|
|
|
14
|
+
var _lodash = require("lodash");
|
|
15
|
+
|
|
14
16
|
var _blockEditor = require("@wordpress/block-editor");
|
|
15
17
|
|
|
16
18
|
var _components = require("@wordpress/components");
|
|
17
19
|
|
|
20
|
+
var _data = require("@wordpress/data");
|
|
21
|
+
|
|
18
22
|
var _i18n = require("@wordpress/i18n");
|
|
19
23
|
|
|
20
24
|
var _icons = require("@wordpress/icons");
|
|
21
25
|
|
|
26
|
+
var _blocks = require("@wordpress/blocks");
|
|
27
|
+
|
|
28
|
+
var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
|
|
29
|
+
|
|
22
30
|
var _orderedListSettings = _interopRequireDefault(require("../ordered-list-settings"));
|
|
23
31
|
|
|
32
|
+
var _migrate = require("./migrate");
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* External dependencies
|
|
36
|
+
*/
|
|
37
|
+
|
|
24
38
|
/**
|
|
25
39
|
* WordPress dependencies
|
|
26
40
|
*/
|
|
@@ -29,17 +43,104 @@ var _orderedListSettings = _interopRequireDefault(require("../ordered-list-setti
|
|
|
29
43
|
* Internal dependencies
|
|
30
44
|
*/
|
|
31
45
|
const TEMPLATE = [['core/list-item']];
|
|
46
|
+
/**
|
|
47
|
+
* At the moment, deprecations don't handle create blocks from attributes
|
|
48
|
+
* (like when using CPT templates). For this reason, this hook is necessary
|
|
49
|
+
* to avoid breaking templates using the old list block format.
|
|
50
|
+
*
|
|
51
|
+
* @param {Object} attributes Block attributes.
|
|
52
|
+
* @param {string} clientId Block client ID.
|
|
53
|
+
*/
|
|
54
|
+
|
|
55
|
+
function useMigrateOnLoad(attributes, clientId) {
|
|
56
|
+
const registry = (0, _data.useRegistry)();
|
|
57
|
+
const {
|
|
58
|
+
updateBlockAttributes,
|
|
59
|
+
replaceInnerBlocks
|
|
60
|
+
} = (0, _data.useDispatch)(_blockEditor.store);
|
|
61
|
+
(0, _element.useEffect)(() => {
|
|
62
|
+
// As soon as the block is loaded, migrate it to the new version.
|
|
63
|
+
if (!attributes.values) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const [newAttributes, newInnerBlocks] = (0, _migrate.migrateToListV2)(attributes);
|
|
68
|
+
(0, _deprecated.default)('Value attribute on the list block', {
|
|
69
|
+
since: '6.0',
|
|
70
|
+
version: '6.5',
|
|
71
|
+
alternative: 'inner blocks'
|
|
72
|
+
});
|
|
73
|
+
registry.batch(() => {
|
|
74
|
+
updateBlockAttributes(clientId, newAttributes);
|
|
75
|
+
replaceInnerBlocks(clientId, newInnerBlocks);
|
|
76
|
+
});
|
|
77
|
+
}, [attributes.values]);
|
|
78
|
+
}
|
|
32
79
|
|
|
33
|
-
function
|
|
80
|
+
function useOutdentList(clientId) {
|
|
81
|
+
const {
|
|
82
|
+
canOutdent
|
|
83
|
+
} = (0, _data.useSelect)(innerSelect => {
|
|
84
|
+
const {
|
|
85
|
+
getBlockRootClientId,
|
|
86
|
+
getBlock
|
|
87
|
+
} = innerSelect(_blockEditor.store);
|
|
88
|
+
const parentId = getBlockRootClientId(clientId);
|
|
89
|
+
return {
|
|
90
|
+
canOutdent: !!parentId && getBlock(parentId).name === 'core/list-item'
|
|
91
|
+
};
|
|
92
|
+
}, [clientId]);
|
|
93
|
+
const {
|
|
94
|
+
replaceBlocks,
|
|
95
|
+
selectionChange
|
|
96
|
+
} = (0, _data.useDispatch)(_blockEditor.store);
|
|
97
|
+
const {
|
|
98
|
+
getBlockRootClientId,
|
|
99
|
+
getBlockAttributes,
|
|
100
|
+
getBlock
|
|
101
|
+
} = (0, _data.useSelect)(_blockEditor.store);
|
|
102
|
+
return [canOutdent, (0, _element.useCallback)(() => {
|
|
103
|
+
const parentBlockId = getBlockRootClientId(clientId);
|
|
104
|
+
const parentBlockAttributes = getBlockAttributes(parentBlockId); // Create a new parent block without the inner blocks.
|
|
105
|
+
|
|
106
|
+
const newParentBlock = (0, _blocks.createBlock)('core/list-item', parentBlockAttributes);
|
|
107
|
+
const {
|
|
108
|
+
innerBlocks
|
|
109
|
+
} = getBlock(clientId); // Replace the parent block with a new parent block without inner blocks,
|
|
110
|
+
// and make the inner blocks siblings of the parent.
|
|
111
|
+
|
|
112
|
+
replaceBlocks([parentBlockId], [newParentBlock, ...innerBlocks]); // Select the last child of the list being outdent.
|
|
113
|
+
|
|
114
|
+
selectionChange((0, _lodash.last)(innerBlocks).clientId);
|
|
115
|
+
}, [clientId])];
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function IndentUI(_ref) {
|
|
34
119
|
let {
|
|
35
|
-
|
|
36
|
-
setAttributes
|
|
120
|
+
clientId
|
|
37
121
|
} = _ref;
|
|
122
|
+
const [canOutdent, outdentList] = useOutdentList(clientId);
|
|
123
|
+
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_components.ToolbarButton, {
|
|
124
|
+
icon: (0, _i18n.isRTL)() ? _icons.formatOutdentRTL : _icons.formatOutdent,
|
|
125
|
+
title: (0, _i18n.__)('Outdent'),
|
|
126
|
+
describedBy: (0, _i18n.__)('Outdent list item'),
|
|
127
|
+
disabled: !canOutdent,
|
|
128
|
+
onClick: outdentList
|
|
129
|
+
}));
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function Edit(_ref2) {
|
|
133
|
+
let {
|
|
134
|
+
attributes,
|
|
135
|
+
setAttributes,
|
|
136
|
+
clientId
|
|
137
|
+
} = _ref2;
|
|
38
138
|
const blockProps = (0, _blockEditor.useBlockProps)();
|
|
39
139
|
const innerBlocksProps = (0, _blockEditor.useInnerBlocksProps)(blockProps, {
|
|
40
140
|
allowedBlocks: ['core/list-item'],
|
|
41
141
|
template: TEMPLATE
|
|
42
142
|
});
|
|
143
|
+
useMigrateOnLoad(attributes, clientId);
|
|
43
144
|
const {
|
|
44
145
|
ordered,
|
|
45
146
|
reversed,
|
|
@@ -68,6 +169,8 @@ function Edit(_ref) {
|
|
|
68
169
|
ordered: true
|
|
69
170
|
});
|
|
70
171
|
}
|
|
172
|
+
}), (0, _element.createElement)(IndentUI, {
|
|
173
|
+
clientId: clientId
|
|
71
174
|
}));
|
|
72
175
|
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(TagName, (0, _extends2.default)({
|
|
73
176
|
reversed: reversed,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/list/v2/edit.js"],"names":["TEMPLATE","
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/list/v2/edit.js"],"names":["TEMPLATE","useMigrateOnLoad","attributes","clientId","registry","updateBlockAttributes","replaceInnerBlocks","blockEditorStore","values","newAttributes","newInnerBlocks","since","version","alternative","batch","useOutdentList","canOutdent","innerSelect","getBlockRootClientId","getBlock","parentId","name","replaceBlocks","selectionChange","getBlockAttributes","parentBlockId","parentBlockAttributes","newParentBlock","innerBlocks","IndentUI","outdentList","formatOutdentRTL","formatOutdent","Edit","setAttributes","blockProps","innerBlocksProps","allowedBlocks","template","ordered","reversed","start","TagName","controls","formatListBulletsRTL","formatListBullets","formatListNumberedRTL","formatListNumbered"],"mappings":";;;;;;;;;AA0BA;;;;AAvBA;;AAKA;;AAMA;;AACA;;AACA;;AACA;;AAQA;;AAEA;;AAKA;;AACA;;AAjCA;AACA;AACA;;AAGA;AACA;AACA;;AAsBA;AACA;AACA;AAIA,MAAMA,QAAQ,GAAG,CAAE,CAAE,gBAAF,CAAF,CAAjB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,gBAAT,CAA2BC,UAA3B,EAAuCC,QAAvC,EAAkD;AACjD,QAAMC,QAAQ,GAAG,wBAAjB;AACA,QAAM;AAAEC,IAAAA,qBAAF;AAAyBC,IAAAA;AAAzB,MAAgD,uBACrDC,kBADqD,CAAtD;AAIA,0BAAW,MAAM;AAChB;AAEA,QAAK,CAAEL,UAAU,CAACM,MAAlB,EAA2B;AAC1B;AACA;;AAED,UAAM,CAAEC,aAAF,EAAiBC,cAAjB,IAAoC,8BAAiBR,UAAjB,CAA1C;AAEA,6BAAY,mCAAZ,EAAiD;AAChDS,MAAAA,KAAK,EAAE,KADyC;AAEhDC,MAAAA,OAAO,EAAE,KAFuC;AAGhDC,MAAAA,WAAW,EAAE;AAHmC,KAAjD;AAMAT,IAAAA,QAAQ,CAACU,KAAT,CAAgB,MAAM;AACrBT,MAAAA,qBAAqB,CAAEF,QAAF,EAAYM,aAAZ,CAArB;AACAH,MAAAA,kBAAkB,CAAEH,QAAF,EAAYO,cAAZ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AACfL,MAAAA,aAAa,CAAE;AAAEK,QAAAA,OAAO,EAAE;AAAX,OAAF,CAAb;AACA;AAPF,IADD,EAUC,4BAAC,yBAAD;AACC,IAAA,IAAI,EAAG,qBAAUO,4BAAV,GAAkCC,yBAD1C;AAEC,IAAA,KAAK,EAAG,cAAI,SAAJ,CAFT;AAGC,IAAA,WAAW,EAAG,cAAI,yBAAJ,CAHf;AAIC,IAAA,QAAQ,EAAGR,OAAO,KAAK,IAJxB;AAKC,IAAA,OAAO,EAAG,MAAM;AACfL,MAAAA,aAAa,CAAE;AAAEK,QAAAA,OAAO,EAAE;AAAX,OAAF,CAAb;AACA;AAPF,IAVD,EAmBC,4BAAC,QAAD;AAAU,IAAA,QAAQ,EAAGpC;AAArB,IAnBD,CADD;AAwBA,SACC,qDACC,4BAAC,OAAD;AACC,IAAA,QAAQ,EAAGqC,QADZ;AAEC,IAAA,KAAK,EAAGC;AAFT,KAGML,gBAHN,EADD,EAMGO,QANH,EAOGJ,OAAO,IACR,4BAAC,4BAAD;AACC,IAAA,aAAa,EAAGL,aADjB;AAEC,IAAA,OAAO,EAAGK,OAFX;AAGC,IAAA,QAAQ,EAAGC,QAHZ;AAIC,IAAA,KAAK,EAAGC;AAJT,IARF,CADD;AAkBA;;eAEcR,I","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 } from '@wordpress/element';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport OrderedListSettings from '../ordered-list-settings';\nimport { migrateToListV2 } from './migrate';\n\nconst TEMPLATE = [ [ 'core/list-item' ] ];\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 } = useDispatch(\n\t\tblockEditorStore\n\t);\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 } = innerSelect(\n\t\t\t\tblockEditorStore\n\t\t\t);\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 } = useSelect(\n\t\tblockEditorStore\n\t);\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 } ) {\n\tconst blockProps = useBlockProps();\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\tallowedBlocks: [ 'core/list-item' ],\n\t\ttemplate: TEMPLATE,\n\t} );\n\tuseMigrateOnLoad( attributes, clientId );\n\tconst { ordered, reversed, start } = attributes;\n\tconst TagName = ordered ? 'ol' : 'ul';\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\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"]}
|
package/build/list/v2/index.js
CHANGED
|
@@ -15,6 +15,8 @@ var _save = _interopRequireDefault(require("./save"));
|
|
|
15
15
|
|
|
16
16
|
var _transforms = _interopRequireDefault(require("./transforms"));
|
|
17
17
|
|
|
18
|
+
var _deprecated = _interopRequireDefault(require("./deprecated"));
|
|
19
|
+
|
|
18
20
|
/**
|
|
19
21
|
* WordPress dependencies
|
|
20
22
|
*/
|
|
@@ -26,7 +28,8 @@ const settings = {
|
|
|
26
28
|
icon: _icons.list,
|
|
27
29
|
edit: _edit.default,
|
|
28
30
|
save: _save.default,
|
|
29
|
-
transforms: _transforms.default
|
|
31
|
+
transforms: _transforms.default,
|
|
32
|
+
deprecated: _deprecated.default
|
|
30
33
|
};
|
|
31
34
|
var _default = settings;
|
|
32
35
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/list/v2/index.js"],"names":["settings","icon","edit","save","transforms"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/list/v2/index.js"],"names":["settings","icon","edit","save","transforms","deprecated"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AAXA;AACA;AACA;;AAGA;AACA;AACA;AAMA,MAAMA,QAAQ,GAAG;AAChBC,EAAAA,IAAI,EAAJA,WADgB;AAEhBC,EAAAA,IAAI,EAAJA,aAFgB;AAGhBC,EAAAA,IAAI,EAAJA,aAHgB;AAIhBC,EAAAA,UAAU,EAAVA,mBAJgB;AAKhBC,EAAAA,UAAU,EAAVA;AALgB,CAAjB;eAQeL,Q","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"]}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.migrateToListV2 = migrateToListV2;
|
|
7
|
+
|
|
8
|
+
var _lodash = require("lodash");
|
|
9
|
+
|
|
10
|
+
var _blocks = require("@wordpress/blocks");
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* External dependencies
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* WordPress dependencies
|
|
18
|
+
*/
|
|
19
|
+
function createListBlockFromDOMElement(listElement) {
|
|
20
|
+
var _listElement$getAttri;
|
|
21
|
+
|
|
22
|
+
const listAttributes = {
|
|
23
|
+
ordered: 'OL' === listElement.tagName,
|
|
24
|
+
start: listElement.getAttribute('start') ? parseInt(listElement.getAttribute('start'), 10) : undefined,
|
|
25
|
+
reversed: listElement.getAttribute('reversed') === true ? true : undefined,
|
|
26
|
+
type: (_listElement$getAttri = listElement.getAttribute('type')) !== null && _listElement$getAttri !== void 0 ? _listElement$getAttri : undefined
|
|
27
|
+
};
|
|
28
|
+
const innerBlocks = Array.from(listElement.children).map(listItem => {
|
|
29
|
+
const children = Array.from(listItem.childNodes).filter(node => node.nodeType !== node.TEXT_NODE || node.textContent.trim().length !== 0);
|
|
30
|
+
children.reverse();
|
|
31
|
+
const [nestedList, ...nodes] = children;
|
|
32
|
+
const hasNestedList = nestedList.tagName === 'UL' || nestedList.tagName === 'OL';
|
|
33
|
+
|
|
34
|
+
if (!hasNestedList) {
|
|
35
|
+
return (0, _blocks.createBlock)('core/list-item', {
|
|
36
|
+
content: listItem.innerHTML
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const htmlNodes = nodes.map(node => {
|
|
41
|
+
if (node.nodeType === node.TEXT_NODE) {
|
|
42
|
+
return node.textContent;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return node.outerHTML;
|
|
46
|
+
});
|
|
47
|
+
htmlNodes.reverse();
|
|
48
|
+
const childAttributes = {
|
|
49
|
+
content: htmlNodes.join('').trim()
|
|
50
|
+
};
|
|
51
|
+
const childInnerBlocks = [createListBlockFromDOMElement(nestedList)];
|
|
52
|
+
return (0, _blocks.createBlock)('core/list-item', childAttributes, childInnerBlocks);
|
|
53
|
+
});
|
|
54
|
+
return (0, _blocks.createBlock)('core/list', listAttributes, innerBlocks);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function migrateToListV2(attributes) {
|
|
58
|
+
const {
|
|
59
|
+
values,
|
|
60
|
+
start,
|
|
61
|
+
reversed,
|
|
62
|
+
ordered,
|
|
63
|
+
type
|
|
64
|
+
} = attributes;
|
|
65
|
+
const list = document.createElement(ordered ? 'ol' : 'ul');
|
|
66
|
+
list.innerHTML = values;
|
|
67
|
+
|
|
68
|
+
if (start) {
|
|
69
|
+
list.setAttribute('start', start);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (reversed) {
|
|
73
|
+
list.setAttribute('reversed', true);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (type) {
|
|
77
|
+
list.setAttribute('type', type);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const listBlock = createListBlockFromDOMElement(list);
|
|
81
|
+
return [{ ...(0, _lodash.omit)(attributes, ['values']),
|
|
82
|
+
...listBlock.attributes
|
|
83
|
+
}, listBlock.innerBlocks];
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=migrate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/list/v2/migrate.js"],"names":["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":";;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAGA,SAASA,6BAAT,CAAwCC,WAAxC,EAAsD;AAAA;;AACrD,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,CAAC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ApB;AAsCA,SAAO,yBAAa,WAAb,EAA0BjC,cAA1B,EAA0CS,WAA1C,CAAP;AACA;;AAEM,SAASyB,eAAT,CAA0BC,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,GAAG,kBAAMF,UAAN,EAAkB,CAAE,QAAF,CAAlB,CADJ;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\nfunction 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"]}
|