@wordpress/block-library 8.0.0 → 8.1.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 +2 -0
- package/build/categories/edit.js +1 -1
- package/build/categories/edit.js.map +1 -1
- package/build/cover/edit/inspector-controls.js +1 -1
- package/build/cover/edit/inspector-controls.js.map +1 -1
- package/build/freeform/edit.js +21 -6
- package/build/freeform/edit.js.map +1 -1
- package/build/freeform/modal.js +97 -0
- package/build/freeform/modal.js.map +1 -0
- package/build/gallery/edit.js +13 -2
- package/build/gallery/edit.js.map +1 -1
- package/build/gallery/gallery.js +2 -16
- package/build/gallery/gallery.js.map +1 -1
- package/build/image/image.js +1 -0
- package/build/image/image.js.map +1 -1
- package/build/media-text/edit.js +1 -0
- package/build/media-text/edit.js.map +1 -1
- package/build/missing/edit.native.js +2 -2
- package/build/missing/edit.native.js.map +1 -1
- package/build/navigation/edit/index.js +3 -4
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/menu-inspector-controls.js +29 -7
- package/build/navigation/edit/menu-inspector-controls.js.map +1 -1
- package/build/navigation/edit/navigation-menu-selector.js +11 -8
- package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build/navigation/edit/utils.js +81 -0
- package/build/navigation/edit/utils.js.map +1 -1
- package/build/navigation-link/edit.js +4 -58
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-submenu/edit.js +7 -72
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/page-list/edit.js +16 -15
- package/build/page-list/edit.js.map +1 -1
- package/build/page-list/index.js +29 -2
- package/build/page-list/index.js.map +1 -1
- package/build/page-list-item/edit.js +9 -5
- package/build/page-list-item/edit.js.map +1 -1
- package/build/post-featured-image/overlay.js +0 -1
- package/build/post-featured-image/overlay.js.map +1 -1
- package/build/query/edit/index.js +2 -1
- package/build/query/edit/index.js.map +1 -1
- package/build/query/edit/inspector-controls/index.js +10 -5
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/edit/inspector-controls/taxonomy-controls.js +101 -37
- package/build/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
- package/build/query/edit/query-content.js +2 -3
- package/build/query/edit/query-content.js.map +1 -1
- package/build/query/edit/query-placeholder.js +17 -12
- package/build/query/edit/query-placeholder.js.map +1 -1
- package/build/query/utils.js +73 -1
- package/build/query/utils.js.map +1 -1
- package/build/search/edit.js +2 -2
- package/build/search/edit.js.map +1 -1
- package/build/social-link/edit.js.map +1 -1
- package/build/social-links/edit.js +0 -1
- package/build/social-links/edit.js.map +1 -1
- package/build/table-of-contents/edit.js +1 -1
- package/build/table-of-contents/edit.js.map +1 -1
- package/build/template-part/edit/advanced-controls.js +11 -1
- package/build/template-part/edit/advanced-controls.js.map +1 -1
- package/build/template-part/edit/import-controls.js +160 -0
- package/build/template-part/edit/import-controls.js.map +1 -0
- package/build/template-part/edit/index.js +2 -1
- package/build/template-part/edit/index.js.map +1 -1
- package/build/template-part/edit/utils/transformers.js +48 -0
- package/build/template-part/edit/utils/transformers.js.map +1 -0
- package/build-module/categories/edit.js +1 -1
- package/build-module/categories/edit.js.map +1 -1
- package/build-module/cover/edit/inspector-controls.js +3 -3
- package/build-module/cover/edit/inspector-controls.js.map +1 -1
- package/build-module/freeform/edit.js +22 -8
- package/build-module/freeform/edit.js.map +1 -1
- package/build-module/freeform/modal.js +90 -0
- package/build-module/freeform/modal.js.map +1 -0
- package/build-module/gallery/edit.js +14 -3
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/gallery/gallery.js +3 -16
- package/build-module/gallery/gallery.js.map +1 -1
- package/build-module/image/image.js +1 -0
- package/build-module/image/image.js.map +1 -1
- package/build-module/media-text/edit.js +1 -0
- package/build-module/media-text/edit.js.map +1 -1
- package/build-module/missing/edit.native.js +2 -2
- package/build-module/missing/edit.native.js.map +1 -1
- package/build-module/navigation/edit/index.js +3 -4
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/menu-inspector-controls.js +30 -9
- package/build-module/navigation/edit/menu-inspector-controls.js.map +1 -1
- package/build-module/navigation/edit/navigation-menu-selector.js +12 -9
- package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build-module/navigation/edit/utils.js +75 -0
- package/build-module/navigation/edit/utils.js.map +1 -1
- package/build-module/navigation-link/edit.js +4 -59
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +6 -72
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/page-list/edit.js +17 -15
- package/build-module/page-list/edit.js.map +1 -1
- package/build-module/page-list/index.js +30 -3
- package/build-module/page-list/index.js.map +1 -1
- package/build-module/page-list-item/edit.js +9 -6
- package/build-module/page-list-item/edit.js.map +1 -1
- package/build-module/post-featured-image/overlay.js +0 -1
- package/build-module/post-featured-image/overlay.js.map +1 -1
- package/build-module/query/edit/index.js +2 -1
- package/build-module/query/edit/index.js.map +1 -1
- package/build-module/query/edit/inspector-controls/index.js +10 -5
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/query/edit/inspector-controls/taxonomy-controls.js +99 -35
- package/build-module/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
- package/build-module/query/edit/query-content.js +1 -1
- package/build-module/query/edit/query-content.js.map +1 -1
- package/build-module/query/edit/query-placeholder.js +16 -12
- package/build-module/query/edit/query-placeholder.js.map +1 -1
- package/build-module/query/utils.js +69 -0
- package/build-module/query/utils.js.map +1 -1
- package/build-module/search/edit.js +2 -2
- package/build-module/search/edit.js.map +1 -1
- package/build-module/social-link/edit.js +2 -2
- package/build-module/social-link/edit.js.map +1 -1
- package/build-module/social-links/edit.js +0 -1
- package/build-module/social-links/edit.js.map +1 -1
- package/build-module/table-of-contents/edit.js +1 -1
- package/build-module/table-of-contents/edit.js.map +1 -1
- package/build-module/template-part/edit/advanced-controls.js +10 -1
- package/build-module/template-part/edit/advanced-controls.js.map +1 -1
- package/build-module/template-part/edit/import-controls.js +146 -0
- package/build-module/template-part/edit/import-controls.js.map +1 -0
- package/build-module/template-part/edit/index.js +2 -1
- package/build-module/template-part/edit/index.js.map +1 -1
- package/build-module/template-part/edit/utils/transformers.js +40 -0
- package/build-module/template-part/edit/utils/transformers.js.map +1 -0
- package/build-style/archives/editor-rtl.css +3 -3
- package/build-style/archives/editor.css +3 -3
- package/build-style/archives/style-rtl.css +3 -3
- package/build-style/archives/style.css +3 -3
- package/build-style/audio/editor-rtl.css +3 -3
- package/build-style/audio/editor.css +3 -3
- package/build-style/audio/style-rtl.css +3 -3
- package/build-style/audio/style.css +3 -3
- package/build-style/audio/theme-rtl.css +3 -3
- package/build-style/audio/theme.css +3 -3
- package/build-style/avatar/editor-rtl.css +3 -3
- package/build-style/avatar/editor.css +3 -3
- package/build-style/avatar/style-rtl.css +3 -3
- package/build-style/avatar/style.css +3 -3
- package/build-style/block/editor-rtl.css +3 -3
- package/build-style/block/editor.css +3 -3
- package/build-style/button/editor-rtl.css +3 -3
- package/build-style/button/editor.css +3 -3
- package/build-style/button/style-rtl.css +3 -3
- package/build-style/button/style.css +3 -3
- package/build-style/buttons/editor-rtl.css +3 -3
- package/build-style/buttons/editor.css +3 -3
- package/build-style/buttons/style-rtl.css +3 -3
- package/build-style/buttons/style.css +3 -3
- package/build-style/calendar/style-rtl.css +3 -3
- package/build-style/calendar/style.css +3 -3
- package/build-style/categories/editor-rtl.css +3 -3
- package/build-style/categories/editor.css +3 -3
- package/build-style/categories/style-rtl.css +3 -3
- package/build-style/categories/style.css +3 -3
- package/build-style/classic-rtl.css +3 -3
- package/build-style/classic.css +3 -3
- package/build-style/code/editor-rtl.css +3 -3
- package/build-style/code/editor.css +3 -3
- package/build-style/code/style-rtl.css +3 -3
- package/build-style/code/style.css +3 -3
- package/build-style/code/theme-rtl.css +3 -3
- package/build-style/code/theme.css +3 -3
- package/build-style/columns/editor-rtl.css +3 -3
- package/build-style/columns/editor.css +3 -3
- package/build-style/columns/style-rtl.css +3 -3
- package/build-style/columns/style.css +3 -3
- package/build-style/comment-author-avatar/editor-rtl.css +3 -3
- package/build-style/comment-author-avatar/editor.css +3 -3
- package/build-style/comment-content/style-rtl.css +3 -3
- package/build-style/comment-content/style.css +3 -3
- package/build-style/comment-template/style-rtl.css +3 -3
- package/build-style/comment-template/style.css +3 -3
- package/build-style/comments/editor-rtl.css +3 -3
- package/build-style/comments/editor.css +3 -3
- package/build-style/comments/style-rtl.css +3 -3
- package/build-style/comments/style.css +3 -3
- package/build-style/comments-pagination/editor-rtl.css +3 -3
- package/build-style/comments-pagination/editor.css +3 -3
- package/build-style/comments-pagination/style-rtl.css +3 -3
- package/build-style/comments-pagination/style.css +3 -3
- package/build-style/comments-pagination-numbers/editor-rtl.css +3 -3
- package/build-style/comments-pagination-numbers/editor.css +3 -3
- package/build-style/comments-title/editor-rtl.css +3 -3
- package/build-style/comments-title/editor.css +3 -3
- package/build-style/common-rtl.css +3 -3
- package/build-style/common.css +3 -3
- package/build-style/cover/editor-rtl.css +3 -3
- package/build-style/cover/editor.css +3 -3
- package/build-style/cover/style-rtl.css +3 -3
- package/build-style/cover/style.css +3 -3
- package/build-style/editor-elements-rtl.css +3 -3
- package/build-style/editor-elements.css +3 -3
- package/build-style/editor-rtl.css +7 -9
- package/build-style/editor.css +7 -9
- package/build-style/elements-rtl.css +3 -3
- package/build-style/elements.css +3 -3
- package/build-style/embed/editor-rtl.css +3 -3
- package/build-style/embed/editor.css +3 -3
- package/build-style/embed/style-rtl.css +3 -3
- package/build-style/embed/style.css +3 -3
- package/build-style/embed/theme-rtl.css +3 -3
- package/build-style/embed/theme.css +3 -3
- package/build-style/file/editor-rtl.css +3 -3
- package/build-style/file/editor.css +3 -3
- package/build-style/file/style-rtl.css +3 -3
- package/build-style/file/style.css +3 -3
- package/build-style/freeform/editor-rtl.css +3 -3
- package/build-style/freeform/editor.css +3 -3
- package/build-style/gallery/editor-rtl.css +3 -3
- package/build-style/gallery/editor.css +3 -3
- package/build-style/gallery/style-rtl.css +3 -3
- package/build-style/gallery/style.css +3 -3
- package/build-style/gallery/theme-rtl.css +3 -3
- package/build-style/gallery/theme.css +3 -3
- package/build-style/group/editor-rtl.css +3 -3
- package/build-style/group/editor.css +3 -3
- package/build-style/group/style-rtl.css +3 -3
- package/build-style/group/style.css +3 -3
- package/build-style/group/theme-rtl.css +3 -3
- package/build-style/group/theme.css +3 -3
- package/build-style/heading/style-rtl.css +3 -3
- package/build-style/heading/style.css +3 -3
- package/build-style/html/editor-rtl.css +3 -3
- package/build-style/html/editor.css +3 -3
- package/build-style/image/editor-rtl.css +3 -3
- package/build-style/image/editor.css +3 -3
- package/build-style/image/style-rtl.css +3 -3
- package/build-style/image/style.css +3 -3
- package/build-style/image/theme-rtl.css +3 -3
- package/build-style/image/theme.css +3 -3
- package/build-style/latest-comments/style-rtl.css +3 -3
- package/build-style/latest-comments/style.css +3 -3
- package/build-style/latest-posts/editor-rtl.css +3 -3
- package/build-style/latest-posts/editor.css +3 -3
- package/build-style/latest-posts/style-rtl.css +3 -3
- package/build-style/latest-posts/style.css +3 -3
- package/build-style/list/style-rtl.css +3 -3
- package/build-style/list/style.css +3 -3
- package/build-style/media-text/editor-rtl.css +3 -3
- package/build-style/media-text/editor.css +3 -3
- package/build-style/media-text/style-rtl.css +3 -3
- package/build-style/media-text/style.css +3 -3
- package/build-style/more/editor-rtl.css +3 -3
- package/build-style/more/editor.css +3 -3
- package/build-style/navigation/editor-rtl.css +3 -9
- package/build-style/navigation/editor.css +3 -9
- package/build-style/navigation/style-rtl.css +3 -4
- package/build-style/navigation/style.css +3 -4
- package/build-style/navigation-link/editor-rtl.css +3 -3
- package/build-style/navigation-link/editor.css +3 -3
- package/build-style/navigation-link/style-rtl.css +3 -3
- package/build-style/navigation-link/style.css +3 -3
- package/build-style/navigation-submenu/editor-rtl.css +3 -3
- package/build-style/navigation-submenu/editor.css +3 -3
- package/build-style/nextpage/editor-rtl.css +3 -3
- package/build-style/nextpage/editor.css +3 -3
- package/build-style/page-list/editor-rtl.css +7 -3
- package/build-style/page-list/editor.css +7 -3
- package/build-style/page-list/style-rtl.css +3 -3
- package/build-style/page-list/style.css +3 -3
- package/build-style/paragraph/editor-rtl.css +3 -3
- package/build-style/paragraph/editor.css +3 -3
- package/build-style/paragraph/style-rtl.css +3 -3
- package/build-style/paragraph/style.css +3 -3
- package/build-style/post-author/style-rtl.css +3 -3
- package/build-style/post-author/style.css +3 -3
- package/build-style/post-comments-form/editor-rtl.css +3 -3
- package/build-style/post-comments-form/editor.css +3 -3
- package/build-style/post-comments-form/style-rtl.css +3 -3
- package/build-style/post-comments-form/style.css +3 -3
- package/build-style/post-date/style-rtl.css +3 -3
- package/build-style/post-date/style.css +3 -3
- package/build-style/post-excerpt/editor-rtl.css +3 -3
- package/build-style/post-excerpt/editor.css +3 -3
- package/build-style/post-excerpt/style-rtl.css +3 -3
- package/build-style/post-excerpt/style.css +3 -3
- package/build-style/post-featured-image/editor-rtl.css +3 -3
- package/build-style/post-featured-image/editor.css +3 -3
- package/build-style/post-featured-image/style-rtl.css +3 -3
- package/build-style/post-featured-image/style.css +3 -3
- package/build-style/post-navigation-link/style-rtl.css +3 -3
- package/build-style/post-navigation-link/style.css +3 -3
- package/build-style/post-template/editor-rtl.css +3 -3
- package/build-style/post-template/editor.css +3 -3
- package/build-style/post-template/style-rtl.css +3 -3
- package/build-style/post-template/style.css +3 -3
- package/build-style/post-terms/style-rtl.css +3 -3
- package/build-style/post-terms/style.css +3 -3
- package/build-style/post-title/style-rtl.css +3 -3
- package/build-style/post-title/style.css +3 -3
- package/build-style/preformatted/style-rtl.css +3 -3
- package/build-style/preformatted/style.css +3 -3
- package/build-style/pullquote/editor-rtl.css +3 -3
- package/build-style/pullquote/editor.css +3 -3
- package/build-style/pullquote/style-rtl.css +3 -3
- package/build-style/pullquote/style.css +3 -3
- package/build-style/pullquote/theme-rtl.css +3 -3
- package/build-style/pullquote/theme.css +3 -3
- package/build-style/query/editor-rtl.css +3 -3
- package/build-style/query/editor.css +3 -3
- package/build-style/query-pagination/editor-rtl.css +3 -3
- package/build-style/query-pagination/editor.css +3 -3
- package/build-style/query-pagination/style-rtl.css +3 -3
- package/build-style/query-pagination/style.css +3 -3
- package/build-style/query-pagination-numbers/editor-rtl.css +3 -3
- package/build-style/query-pagination-numbers/editor.css +3 -3
- package/build-style/query-title/style-rtl.css +3 -3
- package/build-style/query-title/style.css +3 -3
- package/build-style/quote/style-rtl.css +3 -3
- package/build-style/quote/style.css +3 -3
- package/build-style/quote/theme-rtl.css +3 -3
- package/build-style/quote/theme.css +3 -3
- package/build-style/read-more/style-rtl.css +3 -3
- package/build-style/read-more/style.css +3 -3
- package/build-style/reset-rtl.css +3 -3
- package/build-style/reset.css +3 -3
- package/build-style/rss/editor-rtl.css +3 -3
- package/build-style/rss/editor.css +3 -3
- package/build-style/rss/style-rtl.css +3 -3
- package/build-style/rss/style.css +3 -3
- package/build-style/search/editor-rtl.css +3 -3
- package/build-style/search/editor.css +3 -3
- package/build-style/search/style-rtl.css +3 -3
- package/build-style/search/style.css +3 -3
- package/build-style/search/theme-rtl.css +3 -3
- package/build-style/search/theme.css +3 -3
- package/build-style/separator/editor-rtl.css +3 -3
- package/build-style/separator/editor.css +3 -3
- package/build-style/separator/style-rtl.css +3 -3
- package/build-style/separator/style.css +3 -3
- package/build-style/separator/theme-rtl.css +3 -3
- package/build-style/separator/theme.css +3 -3
- package/build-style/shortcode/editor-rtl.css +3 -3
- package/build-style/shortcode/editor.css +3 -3
- package/build-style/site-logo/editor-rtl.css +3 -3
- package/build-style/site-logo/editor.css +3 -3
- package/build-style/site-logo/style-rtl.css +3 -3
- package/build-style/site-logo/style.css +3 -3
- package/build-style/site-tagline/editor-rtl.css +3 -3
- package/build-style/site-tagline/editor.css +3 -3
- package/build-style/site-title/editor-rtl.css +3 -3
- package/build-style/site-title/editor.css +3 -3
- package/build-style/site-title/style-rtl.css +3 -3
- package/build-style/site-title/style.css +3 -3
- package/build-style/social-link/editor-rtl.css +3 -3
- package/build-style/social-link/editor.css +3 -3
- package/build-style/social-links/editor-rtl.css +3 -3
- package/build-style/social-links/editor.css +3 -3
- package/build-style/social-links/style-rtl.css +3 -3
- package/build-style/social-links/style.css +3 -3
- package/build-style/spacer/editor-rtl.css +3 -3
- package/build-style/spacer/editor.css +3 -3
- package/build-style/spacer/style-rtl.css +3 -3
- package/build-style/spacer/style.css +3 -3
- package/build-style/style-rtl.css +13 -5
- package/build-style/style.css +13 -5
- package/build-style/table/editor-rtl.css +3 -3
- package/build-style/table/editor.css +3 -3
- package/build-style/table/style-rtl.css +9 -3
- package/build-style/table/style.css +9 -3
- package/build-style/table/theme-rtl.css +3 -9
- package/build-style/table/theme.css +3 -9
- package/build-style/tag-cloud/style-rtl.css +3 -3
- package/build-style/tag-cloud/style.css +3 -3
- package/build-style/template-part/editor-rtl.css +3 -3
- package/build-style/template-part/editor.css +3 -3
- package/build-style/template-part/theme-rtl.css +3 -3
- package/build-style/template-part/theme.css +3 -3
- package/build-style/text-columns/editor-rtl.css +3 -3
- package/build-style/text-columns/editor.css +3 -3
- package/build-style/text-columns/style-rtl.css +3 -3
- package/build-style/text-columns/style.css +3 -3
- package/build-style/theme-rtl.css +3 -9
- package/build-style/theme.css +3 -9
- package/build-style/verse/style-rtl.css +7 -4
- package/build-style/verse/style.css +7 -4
- package/build-style/video/editor-rtl.css +3 -3
- package/build-style/video/editor.css +3 -3
- package/build-style/video/style-rtl.css +3 -3
- package/build-style/video/style.css +3 -3
- package/build-style/video/theme-rtl.css +3 -3
- package/build-style/video/theme.css +3 -3
- package/package.json +29 -29
- package/src/categories/edit.js +1 -1
- package/src/comments/index.php +0 -1
- package/src/cover/edit/inspector-controls.js +4 -4
- package/src/freeform/edit.js +48 -29
- package/src/freeform/modal.js +111 -0
- package/src/gallery/edit.js +17 -2
- package/src/gallery/gallery.js +3 -13
- package/src/image/image.js +1 -0
- package/src/latest-posts/test/__snapshots__/edit.native.js.snap +3 -0
- package/src/latest-posts/test/edit.native.js +49 -0
- package/src/media-text/edit.js +1 -0
- package/src/missing/edit.native.js +13 -6
- package/src/more/test/__snapshots__/edit.native.js.snap +7 -0
- package/src/more/test/edit.native.js +41 -0
- package/src/navigation/edit/index.js +3 -4
- package/src/navigation/edit/menu-inspector-controls.js +70 -29
- package/src/navigation/edit/navigation-menu-selector.js +19 -9
- package/src/navigation/edit/utils.js +82 -0
- package/src/navigation/editor.scss +0 -7
- package/src/navigation/index.php +32 -0
- package/src/navigation/style.scss +0 -1
- package/src/navigation-link/edit.js +5 -58
- package/src/navigation-link/index.php +32 -0
- package/src/navigation-submenu/edit.js +29 -100
- package/src/navigation-submenu/index.php +32 -0
- package/src/page-list/block.json +18 -1
- package/src/page-list/edit.js +30 -22
- package/src/page-list/editor.scss +4 -0
- package/src/page-list/index.js +8 -2
- package/src/page-list/index.php +9 -10
- package/src/page-list-item/edit.js +17 -9
- package/src/post-featured-image/overlay.js +0 -1
- package/src/query/edit/index.js +1 -0
- package/src/query/edit/inspector-controls/index.js +49 -38
- package/src/query/edit/inspector-controls/taxonomy-controls.js +102 -38
- package/src/query/edit/query-content.js +2 -1
- package/src/query/edit/query-placeholder.js +15 -14
- package/src/query/utils.js +59 -1
- package/src/search/edit.js +2 -2
- package/src/separator/test/__snapshots__/edit.native.js.snap +7 -0
- package/src/separator/test/edit.native.js +41 -0
- package/src/social-link/edit.js +3 -3
- package/src/social-links/edit.js +0 -1
- package/src/table/style.scss +8 -0
- package/src/table/theme.scss +0 -8
- package/src/table-of-contents/edit.js +1 -1
- package/src/template-part/edit/advanced-controls.js +12 -0
- package/src/template-part/edit/import-controls.js +180 -0
- package/src/template-part/edit/index.js +1 -0
- package/src/template-part/edit/utils/transformers.js +37 -0
- package/src/verse/style.scss +4 -1
- package/src/verse/test/__snapshots__/edit.native.js.snap +13 -0
- package/src/verse/test/edit.native.js +40 -33
- package/tsconfig.tsbuildinfo +1 -1
- package/build/query/constants.js +0 -16
- package/build/query/constants.js.map +0 -1
- package/build-module/query/constants.js +0 -7
- package/build-module/query/constants.js.map +0 -1
- package/src/query/constants.js +0 -7
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/template-part/edit/import-controls.js"],"names":["__","sprintf","useMemo","useState","useDispatch","useSelect","useRegistry","Button","FlexBlock","FlexItem","SelectControl","__experimentalHStack","HStack","__experimentalSpacer","Spacer","switchToBlockType","getPossibleBlockTransformations","store","coreStore","noticesStore","useCreateTemplatePartFromBlocks","transformWidgetToBlock","TemplatePartImportControls","area","setAttributes","selectedSidebar","setSelectedSidebar","isBusy","setIsBusy","registry","sidebars","select","getSidebars","per_page","_fields","createErrorNotice","createFromBlocks","options","sidebarOptions","filter","widgetArea","id","widgets","length","map","value","label","name","createFromWidgets","event","preventDefault","sidebar","find","getWidgets","resolveSelect","_embed","skippedWidgets","Set","blocks","flatMap","widget","block","transforms","item","hasWildCardFrom","from","includes","hasWildCardTo","to","add","id_base","size","Array","join","type","marginBottom","marginTop"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SAASC,OAAT,EAAkBC,QAAlB,QAAkC,oBAAlC;AACA,SAASC,WAAT,EAAsBC,SAAtB,EAAiCC,WAAjC,QAAoD,iBAApD;AACA,SACCC,MADD,EAECC,SAFD,EAGCC,QAHD,EAICC,aAJD,EAKCC,oBAAoB,IAAIC,MALzB,EAMCC,oBAAoB,IAAIC,MANzB,QAOO,uBAPP;AAQA,SACCC,iBADD,EAECC,+BAFD,QAGO,mBAHP;AAIA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AACA,SAASD,KAAK,IAAIE,YAAlB,QAAsC,oBAAtC;AAEA;AACA;AACA;;AACA,SAASC,+BAAT,QAAgD,eAAhD;AACA,SAASC,sBAAT,QAAuC,sBAAvC;AAEA,OAAO,SAASC,0BAAT,OAA+D;AAAA,MAA1B;AAAEC,IAAAA,IAAF;AAAQC,IAAAA;AAAR,GAA0B;AACrE,QAA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;AAIC,IAAA,QAAQ,EAAKQ,KAAF,IAAanB,kBAAkB,CAAEmB,KAAF,CAJ3C;AAKC,IAAA,QAAQ,EAAG,CAAER,OAAO,CAACM,MALtB;AAMC,IAAA,qBAAqB,MANtB;AAOC,IAAA,uBAAuB;AAPxB,IADD,CADD,EAYC,cAAC,QAAD;AACC,IAAA,KAAK,EAAG;AACPgC,MAAAA,YAAY,EAAE,KADP;AAEPC,MAAAA,SAAS,EAAE;AAFJ;AADT,KAMC,cAAC,MAAD;AACC,IAAA,OAAO,EAAC,SADT;AAEC,IAAA,IAAI,EAAC,QAFN;AAGC,IAAA,MAAM,EAAGjD,MAHV;AAIC,qBAAgBA,MAAM,IAAI,CAAEF;AAJ7B,KAMGzB,EAAE,CAAE,QAAF,CANL,CAND,CAZD,CADD,CADD;AAgCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useMemo, useState } from '@wordpress/element';\nimport { useDispatch, useSelect, useRegistry } from '@wordpress/data';\nimport {\n\tButton,\n\tFlexBlock,\n\tFlexItem,\n\tSelectControl,\n\t__experimentalHStack as HStack,\n\t__experimentalSpacer as Spacer,\n} from '@wordpress/components';\nimport {\n\tswitchToBlockType,\n\tgetPossibleBlockTransformations,\n} from '@wordpress/blocks';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport { useCreateTemplatePartFromBlocks } from './utils/hooks';\nimport { transformWidgetToBlock } from './utils/transformers';\n\nexport function TemplatePartImportControls( { area, setAttributes } ) {\n\tconst [ selectedSidebar, setSelectedSidebar ] = useState( '' );\n\tconst [ isBusy, setIsBusy ] = useState( false );\n\n\tconst registry = useRegistry();\n\tconst sidebars = useSelect( ( select ) => {\n\t\treturn select( coreStore ).getSidebars( {\n\t\t\tper_page: -1,\n\t\t\t_fields: 'id,name,description,status,widgets',\n\t\t} );\n\t}, [] );\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\n\tconst createFromBlocks = useCreateTemplatePartFromBlocks(\n\t\tarea,\n\t\tsetAttributes\n\t);\n\n\tconst options = useMemo( () => {\n\t\tconst sidebarOptions = ( sidebars ?? [] )\n\t\t\t.filter(\n\t\t\t\t( widgetArea ) =>\n\t\t\t\t\twidgetArea.id !== 'wp_inactive_widgets' &&\n\t\t\t\t\twidgetArea.widgets.length > 0\n\t\t\t)\n\t\t\t.map( ( widgetArea ) => {\n\t\t\t\treturn {\n\t\t\t\t\tvalue: widgetArea.id,\n\t\t\t\t\tlabel: widgetArea.name,\n\t\t\t\t};\n\t\t\t} );\n\n\t\tif ( ! sidebarOptions.length ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn [\n\t\t\t{ value: '', label: __( 'Select widget area' ) },\n\t\t\t...sidebarOptions,\n\t\t];\n\t}, [ sidebars ] );\n\n\tasync function createFromWidgets( event ) {\n\t\tevent.preventDefault();\n\n\t\tif ( isBusy || ! selectedSidebar ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetIsBusy( true );\n\n\t\tconst sidebar = options.find(\n\t\t\t( { value } ) => value === selectedSidebar\n\t\t);\n\t\tconst { getWidgets } = registry.resolveSelect( coreStore );\n\n\t\t// The widgets API always returns a successful response.\n\t\tconst widgets = await getWidgets( {\n\t\t\tsidebar: sidebar.value,\n\t\t\t_embed: 'about',\n\t\t} );\n\n\t\tconst skippedWidgets = new Set();\n\t\tconst blocks = widgets.flatMap( ( widget ) => {\n\t\t\tconst block = transformWidgetToBlock( widget );\n\n\t\t\tif ( block.name !== 'core/legacy-widget' ) {\n\t\t\t\treturn block;\n\t\t\t}\n\n\t\t\tconst transforms = getPossibleBlockTransformations( [\n\t\t\t\tblock,\n\t\t\t] ).filter( ( item ) => {\n\t\t\t\t// The block without any transformations can't be a wildcard.\n\t\t\t\tif ( ! item.transforms ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tconst hasWildCardFrom = item.transforms?.from?.find(\n\t\t\t\t\t( from ) => from.blocks && from.blocks.includes( '*' )\n\t\t\t\t);\n\t\t\t\tconst hasWildCardTo = item.transforms?.to?.find(\n\t\t\t\t\t( to ) => to.blocks && to.blocks.includes( '*' )\n\t\t\t\t);\n\n\t\t\t\treturn ! hasWildCardFrom && ! hasWildCardTo;\n\t\t\t} );\n\n\t\t\t// Skip the block if we have no matching transformations.\n\t\t\tif ( ! transforms.length ) {\n\t\t\t\tskippedWidgets.add( widget.id_base );\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\t// Try transforming the Legacy Widget into a first matching block.\n\t\t\treturn switchToBlockType( block, transforms[ 0 ].name );\n\t\t} );\n\n\t\tawait createFromBlocks(\n\t\t\tblocks,\n\t\t\t/* translators: %s: name of the widget area */\n\t\t\tsprintf( __( 'Widget area: %s' ), sidebar.label )\n\t\t);\n\n\t\tif ( skippedWidgets.size ) {\n\t\t\tcreateErrorNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: the list of widgets */\n\t\t\t\t\t__( 'Unable to import the following widgets: %s.' ),\n\t\t\t\t\tArray.from( skippedWidgets ).join( ', ' )\n\t\t\t\t),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\tsetIsBusy( false );\n\t}\n\n\treturn (\n\t\t<Spacer marginBottom=\"4\">\n\t\t\t<HStack as=\"form\" onSubmit={ createFromWidgets }>\n\t\t\t\t<FlexBlock>\n\t\t\t\t\t<SelectControl\n\t\t\t\t\t\tlabel={ __( 'Import widget area' ) }\n\t\t\t\t\t\tvalue={ selectedSidebar }\n\t\t\t\t\t\toptions={ options }\n\t\t\t\t\t\tonChange={ ( value ) => setSelectedSidebar( value ) }\n\t\t\t\t\t\tdisabled={ ! options.length }\n\t\t\t\t\t\t__next36pxDefaultSize\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t/>\n\t\t\t\t</FlexBlock>\n\t\t\t\t<FlexItem\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\tmarginBottom: '8px',\n\t\t\t\t\t\tmarginTop: 'auto',\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\tisBusy={ isBusy }\n\t\t\t\t\t\taria-disabled={ isBusy || ! selectedSidebar }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Import' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</FlexItem>\n\t\t\t</HStack>\n\t\t</Spacer>\n\t);\n}\n"]}
|
|
@@ -101,7 +101,8 @@ export default function TemplatePartEdit(_ref) {
|
|
|
101
101
|
setAttributes: setAttributes,
|
|
102
102
|
isEntityAvailable: isEntityAvailable,
|
|
103
103
|
templatePartId: templatePartId,
|
|
104
|
-
defaultWrapper: areaObject.tagName
|
|
104
|
+
defaultWrapper: areaObject.tagName,
|
|
105
|
+
hasInnerBlocks: innerBlocks.length > 0
|
|
105
106
|
}), isPlaceholder && createElement(TagName, blockProps, createElement(TemplatePartPlaceholder, {
|
|
106
107
|
area: attributes.area,
|
|
107
108
|
templatePartId: templatePartId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/template-part/edit/index.js"],"names":["isEmpty","useSelect","BlockSettingsMenuControls","BlockTitle","useBlockProps","Warning","store","blockEditorStore","__experimentalRecursionProvider","RecursionProvider","__experimentalUseHasRecursion","useHasRecursion","Spinner","Modal","MenuItem","__","sprintf","coreStore","useState","createInterpolateElement","TemplatePartPlaceholder","TemplatePartSelectionModal","TemplatePartAdvancedControls","TemplatePartInnerBlocks","createTemplatePartId","useAlternativeBlockPatterns","useAlternativeTemplateParts","useTemplatePartArea","TemplatePartEdit","attributes","setAttributes","clientId","isSelected","slug","theme","tagName","layout","templatePartId","hasAlreadyRendered","isTemplatePartSelectionOpen","setIsTemplatePartSelectionOpen","isResolved","innerBlocks","isMissing","area","select","getEditedEntityRecord","hasFinishedResolution","getBlocks","getEntityArgs","entityRecord","_area","hasResolvedEntity","templateParts","blockPatterns","hasReplacements","length","areaObject","blockProps","isPlaceholder","isEntityAvailable","TagName","canReplace","label","toLowerCase"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,OAAT,QAAwB,QAAxB;AAEA;AACA;AACA;;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SACCC,yBADD,EAECC,UAFD,EAGCC,aAHD,EAICC,OAJD,EAKCC,KAAK,IAAIC,gBALV,EAMCC,+BAA+B,IAAIC,iBANpC,EAOCC,6BAA6B,IAAIC,eAPlC,QAQO,yBARP;AASA,SAASC,OAAT,EAAkBC,KAAlB,EAAyBC,QAAzB,QAAyC,uBAAzC;AACA,SAASC,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SAASV,KAAK,IAAIW,SAAlB,QAAmC,sBAAnC;AACA,SAASC,QAAT,EAAmBC,wBAAnB,QAAmD,oBAAnD;AAEA;AACA;AACA;;AACA,OAAOC,uBAAP,MAAoC,eAApC;AACA,OAAOC,0BAAP,MAAuC,mBAAvC;AACA,SAASC,4BAAT,QAA6C,qBAA7C;AACA,OAAOC,uBAAP,MAAoC,gBAApC;AACA,SAASC,oBAAT,QAAqC,iCAArC;AACA,SACCC,2BADD,EAECC,2BAFD,EAGCC,mBAHD,QAIO,eAJP;AAMA,eAAe,SAASC,gBAAT,OAKX;AAAA,MALsC;AACzCC,IAAAA,UADyC;AAEzCC,IAAAA,aAFyC;AAGzCC,IAAAA,QAHyC;AAIzCC,IAAAA;AAJyC,GAKtC;AACH,QAAM;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,KAAR;AAAeC,IAAAA,OAAf;AAAwBC,IAAAA,MAAM,GAAG;AAAjC,MAAwCP,UAA9C;AACA,QAAMQ,cAAc,GAAGb,oBAAoB,CAAEU,KAAF,EAASD,IAAT,CAA3C;AACA,QAAMK,kBAAkB,GAAG3B,eAAe,CAAE0B,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A,cAAc,EAAGH,cADlB;AAEC,IAAA,QAAQ,EAAGN,QAFZ;AAGC,IAAA,IAAI,EAAGa,IAHR;AAIC,IAAA,aAAa,EAAGd,aAJjB;AAKC,IAAA,OAAO,EAAG,MACTU,8BAA8B,CAAE,KAAF;AANhC,IAZD,CA7DF,CADD;AAuFA","sourcesContent":["/**\n * External dependencies\n */\nimport { isEmpty } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tBlockSettingsMenuControls,\n\tBlockTitle,\n\tuseBlockProps,\n\tWarning,\n\tstore as blockEditorStore,\n\t__experimentalRecursionProvider as RecursionProvider,\n\t__experimentalUseHasRecursion as useHasRecursion,\n} from '@wordpress/block-editor';\nimport { Spinner, Modal, MenuItem } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useState, createInterpolateElement } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport TemplatePartPlaceholder from './placeholder';\nimport TemplatePartSelectionModal from './selection-modal';\nimport { TemplatePartAdvancedControls } from './advanced-controls';\nimport TemplatePartInnerBlocks from './inner-blocks';\nimport { createTemplatePartId } from './utils/create-template-part-id';\nimport {\n\tuseAlternativeBlockPatterns,\n\tuseAlternativeTemplateParts,\n\tuseTemplatePartArea,\n} from './utils/hooks';\n\nexport default function TemplatePartEdit( {\n\tattributes,\n\tsetAttributes,\n\tclientId,\n\tisSelected,\n} ) {\n\tconst { slug, theme, tagName, layout = {} } = attributes;\n\tconst templatePartId = createTemplatePartId( theme, slug );\n\tconst hasAlreadyRendered = useHasRecursion( templatePartId );\n\tconst [ isTemplatePartSelectionOpen, setIsTemplatePartSelectionOpen ] =\n\t\tuseState( false );\n\n\t// Set the postId block attribute if it did not exist,\n\t// but wait until the inner blocks have loaded to allow\n\t// new edits to trigger this.\n\tconst { isResolved, innerBlocks, isMissing, area } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedEntityRecord, hasFinishedResolution } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst { getBlocks } = select( blockEditorStore );\n\n\t\t\tconst getEntityArgs = [\n\t\t\t\t'postType',\n\t\t\t\t'wp_template_part',\n\t\t\t\ttemplatePartId,\n\t\t\t];\n\t\t\tconst entityRecord = templatePartId\n\t\t\t\t? getEditedEntityRecord( ...getEntityArgs )\n\t\t\t\t: null;\n\t\t\tconst _area = entityRecord?.area || attributes.area;\n\t\t\tconst hasResolvedEntity = templatePartId\n\t\t\t\t? hasFinishedResolution(\n\t\t\t\t\t\t'getEditedEntityRecord',\n\t\t\t\t\t\tgetEntityArgs\n\t\t\t\t )\n\t\t\t\t: false;\n\n\t\t\treturn {\n\t\t\t\tinnerBlocks: getBlocks( clientId ),\n\t\t\t\tisResolved: hasResolvedEntity,\n\t\t\t\tisMissing: hasResolvedEntity && isEmpty( entityRecord ),\n\t\t\t\tarea: _area,\n\t\t\t};\n\t\t},\n\t\t[ templatePartId, clientId ]\n\t);\n\tconst { templateParts } = useAlternativeTemplateParts(\n\t\tarea,\n\t\ttemplatePartId\n\t);\n\tconst blockPatterns = useAlternativeBlockPatterns( area, clientId );\n\tconst hasReplacements = !! templateParts.length || !! blockPatterns.length;\n\tconst areaObject = useTemplatePartArea( area );\n\tconst blockProps = useBlockProps();\n\tconst isPlaceholder = ! slug;\n\tconst isEntityAvailable = ! isPlaceholder && ! isMissing && isResolved;\n\tconst TagName = tagName || areaObject.tagName;\n\n\t// The `isSelected` check ensures the `BlockSettingsMenuControls` fill\n\t// doesn't render multiple times. The block controls has similar internal check.\n\tconst canReplace =\n\t\tisSelected &&\n\t\tisEntityAvailable &&\n\t\thasReplacements &&\n\t\t( area === 'header' || area === 'footer' );\n\n\t// We don't want to render a missing state if we have any inner blocks.\n\t// A new template part is automatically created if we have any inner blocks but no entity.\n\tif (\n\t\tinnerBlocks.length === 0 &&\n\t\t( ( slug && ! theme ) || ( slug && isMissing ) )\n\t) {\n\t\treturn (\n\t\t\t<TagName { ...blockProps }>\n\t\t\t\t<Warning>\n\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t/* translators: %s: Template part slug */\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'Template part has been deleted or is unavailable: %s'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tslug\n\t\t\t\t\t) }\n\t\t\t\t</Warning>\n\t\t\t</TagName>\n\t\t);\n\t}\n\n\tif ( isEntityAvailable && hasAlreadyRendered ) {\n\t\treturn (\n\t\t\t<TagName { ...blockProps }>\n\t\t\t\t<Warning>\n\t\t\t\t\t{ __( 'Block cannot be rendered inside itself.' ) }\n\t\t\t\t</Warning>\n\t\t\t</TagName>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<RecursionProvider uniqueId={ templatePartId }>\n\t\t\t\t<TemplatePartAdvancedControls\n\t\t\t\t\ttagName={ tagName }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tisEntityAvailable={ isEntityAvailable }\n\t\t\t\t\ttemplatePartId={ templatePartId }\n\t\t\t\t\tdefaultWrapper={ areaObject.tagName }\n\t\t\t\t/>\n\t\t\t\t{ isPlaceholder && (\n\t\t\t\t\t<TagName { ...blockProps }>\n\t\t\t\t\t\t<TemplatePartPlaceholder\n\t\t\t\t\t\t\tarea={ attributes.area }\n\t\t\t\t\t\t\ttemplatePartId={ templatePartId }\n\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\t\tonOpenSelectionModal={ () =>\n\t\t\t\t\t\t\t\tsetIsTemplatePartSelectionOpen( true )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</TagName>\n\t\t\t\t) }\n\t\t\t\t{ canReplace && (\n\t\t\t\t\t<BlockSettingsMenuControls>\n\t\t\t\t\t\t{ () => (\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tsetIsTemplatePartSelectionOpen( true );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t\t__( 'Replace <BlockTitle />' ),\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tBlockTitle: (\n\t\t\t\t\t\t\t\t\t\t\t<BlockTitle\n\t\t\t\t\t\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t\t\t\t\t\t\tmaximumLength={ 25 }\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</BlockSettingsMenuControls>\n\t\t\t\t) }\n\t\t\t\t{ isEntityAvailable && (\n\t\t\t\t\t<TemplatePartInnerBlocks\n\t\t\t\t\t\ttagName={ TagName }\n\t\t\t\t\t\tblockProps={ blockProps }\n\t\t\t\t\t\tpostId={ templatePartId }\n\t\t\t\t\t\thasInnerBlocks={ innerBlocks.length > 0 }\n\t\t\t\t\t\tlayout={ layout }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ ! isPlaceholder && ! isResolved && (\n\t\t\t\t\t<TagName { ...blockProps }>\n\t\t\t\t\t\t<Spinner />\n\t\t\t\t\t</TagName>\n\t\t\t\t) }\n\t\t\t</RecursionProvider>\n\t\t\t{ isTemplatePartSelectionOpen && (\n\t\t\t\t<Modal\n\t\t\t\t\toverlayClassName=\"block-editor-template-part__selection-modal\"\n\t\t\t\t\ttitle={ sprintf(\n\t\t\t\t\t\t// Translators: %s as template part area title (\"Header\", \"Footer\", etc.).\n\t\t\t\t\t\t__( 'Choose a %s' ),\n\t\t\t\t\t\tareaObject.label.toLowerCase()\n\t\t\t\t\t) }\n\t\t\t\t\tcloseLabel={ __( 'Cancel' ) }\n\t\t\t\t\tonRequestClose={ () =>\n\t\t\t\t\t\tsetIsTemplatePartSelectionOpen( false )\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t<TemplatePartSelectionModal\n\t\t\t\t\t\ttemplatePartId={ templatePartId }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\tarea={ area }\n\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\tonClose={ () =>\n\t\t\t\t\t\t\tsetIsTemplatePartSelectionOpen( false )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</Modal>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/template-part/edit/index.js"],"names":["isEmpty","useSelect","BlockSettingsMenuControls","BlockTitle","useBlockProps","Warning","store","blockEditorStore","__experimentalRecursionProvider","RecursionProvider","__experimentalUseHasRecursion","useHasRecursion","Spinner","Modal","MenuItem","__","sprintf","coreStore","useState","createInterpolateElement","TemplatePartPlaceholder","TemplatePartSelectionModal","TemplatePartAdvancedControls","TemplatePartInnerBlocks","createTemplatePartId","useAlternativeBlockPatterns","useAlternativeTemplateParts","useTemplatePartArea","TemplatePartEdit","attributes","setAttributes","clientId","isSelected","slug","theme","tagName","layout","templatePartId","hasAlreadyRendered","isTemplatePartSelectionOpen","setIsTemplatePartSelectionOpen","isResolved","innerBlocks","isMissing","area","select","getEditedEntityRecord","hasFinishedResolution","getBlocks","getEntityArgs","entityRecord","_area","hasResolvedEntity","templateParts","blockPatterns","hasReplacements","length","areaObject","blockProps","isPlaceholder","isEntityAvailable","TagName","canReplace","label","toLowerCase"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,OAAT,QAAwB,QAAxB;AAEA;AACA;AACA;;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SACCC,yBADD,EAECC,UAFD,EAGCC,aAHD,EAICC,OAJD,EAKCC,KAAK,IAAIC,gBALV,EAMCC,+BAA+B,IAA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O,EAAG,MAAM;AACftB,MAAAA,8BAA8B,CAAE,IAAF,CAA9B;AACA;AAHF,KAKGrB,wBAAwB,CACzBJ,EAAE,CAAE,wBAAF,CADuB,EAEzB;AACCZ,IAAAA,UAAU,EACT,cAAC,UAAD;AACC,MAAA,QAAQ,EAAG4B,QADZ;AAEC,MAAA,aAAa,EAAG;AAFjB;AAFF,GAFyB,CAL3B,CAFF,CAvBF,EA6CG6B,iBAAiB,IAClB,cAAC,uBAAD;AACC,IAAA,OAAO,EAAGC,OADX;AAEC,IAAA,UAAU,EAAGH,UAFd;AAGC,IAAA,MAAM,EAAGrB,cAHV;AAIC,IAAA,cAAc,EAAGK,WAAW,CAACc,MAAZ,GAAqB,CAJvC;AAKC,IAAA,MAAM,EAAGpB;AALV,IA9CF,EAsDG,CAAEuB,aAAF,IAAmB,CAAElB,UAArB,IACD,cAAC,OAAD,EAAciB,UAAd,EACC,cAAC,OAAD,OADD,CAvDF,CADD,EA6DGnB,2BAA2B,IAC5B,cAAC,KAAD;AACC,IAAA,gBAAgB,EAAC,6CADlB;AAEC,IAAA,KAAK,EAAGvB,OAAO,EACd;AACAD,IAAAA,EAAE,CAAE,aAAF,CAFY,EAGd0C,UAAU,CAACM,KAAX,CAAiBC,WAAjB,EAHc,CAFhB;AAOC,IAAA,UAAU,EAAGjD,EAAE,CAAE,QAAF,CAPhB;AAQC,IAAA,cAAc,EAAG,MAChByB,8BAA8B,CAAE,KAAF;AAThC,KAYC,cAAC,0BAAD;AACC,IAAA,cAAc,EAAGH,cADlB;AAEC,IAAA,QAAQ,EAAGN,QAFZ;AAGC,IAAA,IAAI,EAAGa,IAHR;AAIC,IAAA,aAAa,EAAGd,aAJjB;AAKC,IAAA,OAAO,EAAG,MACTU,8BAA8B,CAAE,KAAF;AANhC,IAZD,CA9DF,CADD;AAwFA","sourcesContent":["/**\n * External dependencies\n */\nimport { isEmpty } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tBlockSettingsMenuControls,\n\tBlockTitle,\n\tuseBlockProps,\n\tWarning,\n\tstore as blockEditorStore,\n\t__experimentalRecursionProvider as RecursionProvider,\n\t__experimentalUseHasRecursion as useHasRecursion,\n} from '@wordpress/block-editor';\nimport { Spinner, Modal, MenuItem } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useState, createInterpolateElement } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport TemplatePartPlaceholder from './placeholder';\nimport TemplatePartSelectionModal from './selection-modal';\nimport { TemplatePartAdvancedControls } from './advanced-controls';\nimport TemplatePartInnerBlocks from './inner-blocks';\nimport { createTemplatePartId } from './utils/create-template-part-id';\nimport {\n\tuseAlternativeBlockPatterns,\n\tuseAlternativeTemplateParts,\n\tuseTemplatePartArea,\n} from './utils/hooks';\n\nexport default function TemplatePartEdit( {\n\tattributes,\n\tsetAttributes,\n\tclientId,\n\tisSelected,\n} ) {\n\tconst { slug, theme, tagName, layout = {} } = attributes;\n\tconst templatePartId = createTemplatePartId( theme, slug );\n\tconst hasAlreadyRendered = useHasRecursion( templatePartId );\n\tconst [ isTemplatePartSelectionOpen, setIsTemplatePartSelectionOpen ] =\n\t\tuseState( false );\n\n\t// Set the postId block attribute if it did not exist,\n\t// but wait until the inner blocks have loaded to allow\n\t// new edits to trigger this.\n\tconst { isResolved, innerBlocks, isMissing, area } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedEntityRecord, hasFinishedResolution } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst { getBlocks } = select( blockEditorStore );\n\n\t\t\tconst getEntityArgs = [\n\t\t\t\t'postType',\n\t\t\t\t'wp_template_part',\n\t\t\t\ttemplatePartId,\n\t\t\t];\n\t\t\tconst entityRecord = templatePartId\n\t\t\t\t? getEditedEntityRecord( ...getEntityArgs )\n\t\t\t\t: null;\n\t\t\tconst _area = entityRecord?.area || attributes.area;\n\t\t\tconst hasResolvedEntity = templatePartId\n\t\t\t\t? hasFinishedResolution(\n\t\t\t\t\t\t'getEditedEntityRecord',\n\t\t\t\t\t\tgetEntityArgs\n\t\t\t\t )\n\t\t\t\t: false;\n\n\t\t\treturn {\n\t\t\t\tinnerBlocks: getBlocks( clientId ),\n\t\t\t\tisResolved: hasResolvedEntity,\n\t\t\t\tisMissing: hasResolvedEntity && isEmpty( entityRecord ),\n\t\t\t\tarea: _area,\n\t\t\t};\n\t\t},\n\t\t[ templatePartId, clientId ]\n\t);\n\tconst { templateParts } = useAlternativeTemplateParts(\n\t\tarea,\n\t\ttemplatePartId\n\t);\n\tconst blockPatterns = useAlternativeBlockPatterns( area, clientId );\n\tconst hasReplacements = !! templateParts.length || !! blockPatterns.length;\n\tconst areaObject = useTemplatePartArea( area );\n\tconst blockProps = useBlockProps();\n\tconst isPlaceholder = ! slug;\n\tconst isEntityAvailable = ! isPlaceholder && ! isMissing && isResolved;\n\tconst TagName = tagName || areaObject.tagName;\n\n\t// The `isSelected` check ensures the `BlockSettingsMenuControls` fill\n\t// doesn't render multiple times. The block controls has similar internal check.\n\tconst canReplace =\n\t\tisSelected &&\n\t\tisEntityAvailable &&\n\t\thasReplacements &&\n\t\t( area === 'header' || area === 'footer' );\n\n\t// We don't want to render a missing state if we have any inner blocks.\n\t// A new template part is automatically created if we have any inner blocks but no entity.\n\tif (\n\t\tinnerBlocks.length === 0 &&\n\t\t( ( slug && ! theme ) || ( slug && isMissing ) )\n\t) {\n\t\treturn (\n\t\t\t<TagName { ...blockProps }>\n\t\t\t\t<Warning>\n\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t/* translators: %s: Template part slug */\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'Template part has been deleted or is unavailable: %s'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tslug\n\t\t\t\t\t) }\n\t\t\t\t</Warning>\n\t\t\t</TagName>\n\t\t);\n\t}\n\n\tif ( isEntityAvailable && hasAlreadyRendered ) {\n\t\treturn (\n\t\t\t<TagName { ...blockProps }>\n\t\t\t\t<Warning>\n\t\t\t\t\t{ __( 'Block cannot be rendered inside itself.' ) }\n\t\t\t\t</Warning>\n\t\t\t</TagName>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<RecursionProvider uniqueId={ templatePartId }>\n\t\t\t\t<TemplatePartAdvancedControls\n\t\t\t\t\ttagName={ tagName }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tisEntityAvailable={ isEntityAvailable }\n\t\t\t\t\ttemplatePartId={ templatePartId }\n\t\t\t\t\tdefaultWrapper={ areaObject.tagName }\n\t\t\t\t\thasInnerBlocks={ innerBlocks.length > 0 }\n\t\t\t\t/>\n\t\t\t\t{ isPlaceholder && (\n\t\t\t\t\t<TagName { ...blockProps }>\n\t\t\t\t\t\t<TemplatePartPlaceholder\n\t\t\t\t\t\t\tarea={ attributes.area }\n\t\t\t\t\t\t\ttemplatePartId={ templatePartId }\n\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\t\tonOpenSelectionModal={ () =>\n\t\t\t\t\t\t\t\tsetIsTemplatePartSelectionOpen( true )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</TagName>\n\t\t\t\t) }\n\t\t\t\t{ canReplace && (\n\t\t\t\t\t<BlockSettingsMenuControls>\n\t\t\t\t\t\t{ () => (\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tsetIsTemplatePartSelectionOpen( true );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t\t__( 'Replace <BlockTitle />' ),\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tBlockTitle: (\n\t\t\t\t\t\t\t\t\t\t\t<BlockTitle\n\t\t\t\t\t\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t\t\t\t\t\t\tmaximumLength={ 25 }\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</BlockSettingsMenuControls>\n\t\t\t\t) }\n\t\t\t\t{ isEntityAvailable && (\n\t\t\t\t\t<TemplatePartInnerBlocks\n\t\t\t\t\t\ttagName={ TagName }\n\t\t\t\t\t\tblockProps={ blockProps }\n\t\t\t\t\t\tpostId={ templatePartId }\n\t\t\t\t\t\thasInnerBlocks={ innerBlocks.length > 0 }\n\t\t\t\t\t\tlayout={ layout }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ ! isPlaceholder && ! isResolved && (\n\t\t\t\t\t<TagName { ...blockProps }>\n\t\t\t\t\t\t<Spinner />\n\t\t\t\t\t</TagName>\n\t\t\t\t) }\n\t\t\t</RecursionProvider>\n\t\t\t{ isTemplatePartSelectionOpen && (\n\t\t\t\t<Modal\n\t\t\t\t\toverlayClassName=\"block-editor-template-part__selection-modal\"\n\t\t\t\t\ttitle={ sprintf(\n\t\t\t\t\t\t// Translators: %s as template part area title (\"Header\", \"Footer\", etc.).\n\t\t\t\t\t\t__( 'Choose a %s' ),\n\t\t\t\t\t\tareaObject.label.toLowerCase()\n\t\t\t\t\t) }\n\t\t\t\t\tcloseLabel={ __( 'Cancel' ) }\n\t\t\t\t\tonRequestClose={ () =>\n\t\t\t\t\t\tsetIsTemplatePartSelectionOpen( false )\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t<TemplatePartSelectionModal\n\t\t\t\t\t\ttemplatePartId={ templatePartId }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\tarea={ area }\n\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\tonClose={ () =>\n\t\t\t\t\t\t\tsetIsTemplatePartSelectionOpen( false )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</Modal>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { createBlock, parse } from '@wordpress/blocks';
|
|
5
|
+
/**
|
|
6
|
+
* Converts a widget entity record into a block.
|
|
7
|
+
*
|
|
8
|
+
* @param {Object} widget The widget entity record.
|
|
9
|
+
* @return {Object} a block (converted from the entity record).
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
export function transformWidgetToBlock(widget) {
|
|
13
|
+
if (widget.id_base === 'block') {
|
|
14
|
+
const parsedBlocks = parse(widget.instance.raw.content, {
|
|
15
|
+
__unstableSkipAutop: true
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
if (!parsedBlocks.length) {
|
|
19
|
+
return createBlock('core/paragraph', {}, []);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return parsedBlocks[0];
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
let attributes;
|
|
26
|
+
|
|
27
|
+
if (widget._embedded.about[0].is_multi) {
|
|
28
|
+
attributes = {
|
|
29
|
+
idBase: widget.id_base,
|
|
30
|
+
instance: widget.instance
|
|
31
|
+
};
|
|
32
|
+
} else {
|
|
33
|
+
attributes = {
|
|
34
|
+
id: widget.id
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return createBlock('core/legacy-widget', attributes, []);
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=transformers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/template-part/edit/utils/transformers.js"],"names":["createBlock","parse","transformWidgetToBlock","widget","id_base","parsedBlocks","instance","raw","content","__unstableSkipAutop","length","attributes","_embedded","about","is_multi","idBase","id"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAT,EAAsBC,KAAtB,QAAmC,mBAAnC;AAEA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,sBAAT,CAAiCC,MAAjC,EAA0C;AAChD,MAAKA,MAAM,CAACC,OAAP,KAAmB,OAAxB,EAAkC;AACjC,UAAMC,YAAY,GAAGJ,KAAK,CAAEE,MAAM,CAACG,QAAP,CAAgBC,GAAhB,CAAoBC,OAAtB,EAA+B;AACxDC,MAAAA,mBAAmB,EAAE;AADmC,KAA/B,CAA1B;;AAGA,QAAK,CAAEJ,YAAY,CAACK,MAApB,EAA6B;AAC5B,aAAOV,WAAW,CAAE,gBAAF,EAAoB,EAApB,EAAwB,EAAxB,CAAlB;AACA;;AAED,WAAOK,YAAY,CAAE,CAAF,CAAnB;AACA;;AAED,MAAIM,UAAJ;;AACA,MAAKR,MAAM,CAACS,SAAP,CAAiBC,KAAjB,CAAwB,CAAxB,EAA4BC,QAAjC,EAA4C;AAC3CH,IAAAA,UAAU,GAAG;AACZI,MAAAA,MAAM,EAAEZ,MAAM,CAACC,OADH;AAEZE,MAAAA,QAAQ,EAAEH,MAAM,CAACG;AAFL,KAAb;AAIA,GALD,MAKO;AACNK,IAAAA,UAAU,GAAG;AACZK,MAAAA,EAAE,EAAEb,MAAM,CAACa;AADC,KAAb;AAGA;;AAED,SAAOhB,WAAW,CAAE,oBAAF,EAAwBW,UAAxB,EAAoC,EAApC,CAAlB;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createBlock, parse } from '@wordpress/blocks';\n\n/**\n * Converts a widget entity record into a block.\n *\n * @param {Object} widget The widget entity record.\n * @return {Object} a block (converted from the entity record).\n */\nexport function transformWidgetToBlock( widget ) {\n\tif ( widget.id_base === 'block' ) {\n\t\tconst parsedBlocks = parse( widget.instance.raw.content, {\n\t\t\t__unstableSkipAutop: true,\n\t\t} );\n\t\tif ( ! parsedBlocks.length ) {\n\t\t\treturn createBlock( 'core/paragraph', {}, [] );\n\t\t}\n\n\t\treturn parsedBlocks[ 0 ];\n\t}\n\n\tlet attributes;\n\tif ( widget._embedded.about[ 0 ].is_multi ) {\n\t\tattributes = {\n\t\t\tidBase: widget.id_base,\n\t\t\tinstance: widget.instance,\n\t\t};\n\t} else {\n\t\tattributes = {\n\t\t\tid: widget.id,\n\t\t};\n\t}\n\n\treturn createBlock( 'core/legacy-widget', attributes, [] );\n}\n"]}
|
|
@@ -58,15 +58,15 @@
|
|
|
58
58
|
* @param {string} hex - the hexadecimal value to convert
|
|
59
59
|
* @return {string} comma separated rgb values
|
|
60
60
|
*/
|
|
61
|
-
/**
|
|
62
|
-
* Breakpoint mixins
|
|
63
|
-
*/
|
|
64
61
|
/**
|
|
65
62
|
* Long content fade mixin
|
|
66
63
|
*
|
|
67
64
|
* Creates a fading overlay to signify that the content is longer
|
|
68
65
|
* than the space allows.
|
|
69
66
|
*/
|
|
67
|
+
/**
|
|
68
|
+
* Breakpoint mixins
|
|
69
|
+
*/
|
|
70
70
|
/**
|
|
71
71
|
* Focus styles.
|
|
72
72
|
*/
|
|
@@ -58,15 +58,15 @@
|
|
|
58
58
|
* @param {string} hex - the hexadecimal value to convert
|
|
59
59
|
* @return {string} comma separated rgb values
|
|
60
60
|
*/
|
|
61
|
-
/**
|
|
62
|
-
* Breakpoint mixins
|
|
63
|
-
*/
|
|
64
61
|
/**
|
|
65
62
|
* Long content fade mixin
|
|
66
63
|
*
|
|
67
64
|
* Creates a fading overlay to signify that the content is longer
|
|
68
65
|
* than the space allows.
|
|
69
66
|
*/
|
|
67
|
+
/**
|
|
68
|
+
* Breakpoint mixins
|
|
69
|
+
*/
|
|
70
70
|
/**
|
|
71
71
|
* Focus styles.
|
|
72
72
|
*/
|
|
@@ -58,15 +58,15 @@
|
|
|
58
58
|
* @param {string} hex - the hexadecimal value to convert
|
|
59
59
|
* @return {string} comma separated rgb values
|
|
60
60
|
*/
|
|
61
|
-
/**
|
|
62
|
-
* Breakpoint mixins
|
|
63
|
-
*/
|
|
64
61
|
/**
|
|
65
62
|
* Long content fade mixin
|
|
66
63
|
*
|
|
67
64
|
* Creates a fading overlay to signify that the content is longer
|
|
68
65
|
* than the space allows.
|
|
69
66
|
*/
|
|
67
|
+
/**
|
|
68
|
+
* Breakpoint mixins
|
|
69
|
+
*/
|
|
70
70
|
/**
|
|
71
71
|
* Focus styles.
|
|
72
72
|
*/
|
|
@@ -58,15 +58,15 @@
|
|
|
58
58
|
* @param {string} hex - the hexadecimal value to convert
|
|
59
59
|
* @return {string} comma separated rgb values
|
|
60
60
|
*/
|
|
61
|
-
/**
|
|
62
|
-
* Breakpoint mixins
|
|
63
|
-
*/
|
|
64
61
|
/**
|
|
65
62
|
* Long content fade mixin
|
|
66
63
|
*
|
|
67
64
|
* Creates a fading overlay to signify that the content is longer
|
|
68
65
|
* than the space allows.
|
|
69
66
|
*/
|
|
67
|
+
/**
|
|
68
|
+
* Breakpoint mixins
|
|
69
|
+
*/
|
|
70
70
|
/**
|
|
71
71
|
* Focus styles.
|
|
72
72
|
*/
|
|
@@ -58,15 +58,15 @@
|
|
|
58
58
|
* @param {string} hex - the hexadecimal value to convert
|
|
59
59
|
* @return {string} comma separated rgb values
|
|
60
60
|
*/
|
|
61
|
-
/**
|
|
62
|
-
* Breakpoint mixins
|
|
63
|
-
*/
|
|
64
61
|
/**
|
|
65
62
|
* Long content fade mixin
|
|
66
63
|
*
|
|
67
64
|
* Creates a fading overlay to signify that the content is longer
|
|
68
65
|
* than the space allows.
|
|
69
66
|
*/
|
|
67
|
+
/**
|
|
68
|
+
* Breakpoint mixins
|
|
69
|
+
*/
|
|
70
70
|
/**
|
|
71
71
|
* Focus styles.
|
|
72
72
|
*/
|
|
@@ -58,15 +58,15 @@
|
|
|
58
58
|
* @param {string} hex - the hexadecimal value to convert
|
|
59
59
|
* @return {string} comma separated rgb values
|
|
60
60
|
*/
|
|
61
|
-
/**
|
|
62
|
-
* Breakpoint mixins
|
|
63
|
-
*/
|
|
64
61
|
/**
|
|
65
62
|
* Long content fade mixin
|
|
66
63
|
*
|
|
67
64
|
* Creates a fading overlay to signify that the content is longer
|
|
68
65
|
* than the space allows.
|
|
69
66
|
*/
|
|
67
|
+
/**
|
|
68
|
+
* Breakpoint mixins
|
|
69
|
+
*/
|
|
70
70
|
/**
|
|
71
71
|
* Focus styles.
|
|
72
72
|
*/
|
|
@@ -58,15 +58,15 @@
|
|
|
58
58
|
* @param {string} hex - the hexadecimal value to convert
|
|
59
59
|
* @return {string} comma separated rgb values
|
|
60
60
|
*/
|
|
61
|
-
/**
|
|
62
|
-
* Breakpoint mixins
|
|
63
|
-
*/
|
|
64
61
|
/**
|
|
65
62
|
* Long content fade mixin
|
|
66
63
|
*
|
|
67
64
|
* Creates a fading overlay to signify that the content is longer
|
|
68
65
|
* than the space allows.
|
|
69
66
|
*/
|
|
67
|
+
/**
|
|
68
|
+
* Breakpoint mixins
|
|
69
|
+
*/
|
|
70
70
|
/**
|
|
71
71
|
* Focus styles.
|
|
72
72
|
*/
|
|
@@ -58,15 +58,15 @@
|
|
|
58
58
|
* @param {string} hex - the hexadecimal value to convert
|
|
59
59
|
* @return {string} comma separated rgb values
|
|
60
60
|
*/
|
|
61
|
-
/**
|
|
62
|
-
* Breakpoint mixins
|
|
63
|
-
*/
|
|
64
61
|
/**
|
|
65
62
|
* Long content fade mixin
|
|
66
63
|
*
|
|
67
64
|
* Creates a fading overlay to signify that the content is longer
|
|
68
65
|
* than the space allows.
|
|
69
66
|
*/
|
|
67
|
+
/**
|
|
68
|
+
* Breakpoint mixins
|
|
69
|
+
*/
|
|
70
70
|
/**
|
|
71
71
|
* Focus styles.
|
|
72
72
|
*/
|
|
@@ -58,15 +58,15 @@
|
|
|
58
58
|
* @param {string} hex - the hexadecimal value to convert
|
|
59
59
|
* @return {string} comma separated rgb values
|
|
60
60
|
*/
|
|
61
|
-
/**
|
|
62
|
-
* Breakpoint mixins
|
|
63
|
-
*/
|
|
64
61
|
/**
|
|
65
62
|
* Long content fade mixin
|
|
66
63
|
*
|
|
67
64
|
* Creates a fading overlay to signify that the content is longer
|
|
68
65
|
* than the space allows.
|
|
69
66
|
*/
|
|
67
|
+
/**
|
|
68
|
+
* Breakpoint mixins
|
|
69
|
+
*/
|
|
70
70
|
/**
|
|
71
71
|
* Focus styles.
|
|
72
72
|
*/
|
|
@@ -58,15 +58,15 @@
|
|
|
58
58
|
* @param {string} hex - the hexadecimal value to convert
|
|
59
59
|
* @return {string} comma separated rgb values
|
|
60
60
|
*/
|
|
61
|
-
/**
|
|
62
|
-
* Breakpoint mixins
|
|
63
|
-
*/
|
|
64
61
|
/**
|
|
65
62
|
* Long content fade mixin
|
|
66
63
|
*
|
|
67
64
|
* Creates a fading overlay to signify that the content is longer
|
|
68
65
|
* than the space allows.
|
|
69
66
|
*/
|
|
67
|
+
/**
|
|
68
|
+
* Breakpoint mixins
|
|
69
|
+
*/
|
|
70
70
|
/**
|
|
71
71
|
* Focus styles.
|
|
72
72
|
*/
|
|
@@ -58,15 +58,15 @@
|
|
|
58
58
|
* @param {string} hex - the hexadecimal value to convert
|
|
59
59
|
* @return {string} comma separated rgb values
|
|
60
60
|
*/
|
|
61
|
-
/**
|
|
62
|
-
* Breakpoint mixins
|
|
63
|
-
*/
|
|
64
61
|
/**
|
|
65
62
|
* Long content fade mixin
|
|
66
63
|
*
|
|
67
64
|
* Creates a fading overlay to signify that the content is longer
|
|
68
65
|
* than the space allows.
|
|
69
66
|
*/
|
|
67
|
+
/**
|
|
68
|
+
* Breakpoint mixins
|
|
69
|
+
*/
|
|
70
70
|
/**
|
|
71
71
|
* Focus styles.
|
|
72
72
|
*/
|
|
@@ -58,15 +58,15 @@
|
|
|
58
58
|
* @param {string} hex - the hexadecimal value to convert
|
|
59
59
|
* @return {string} comma separated rgb values
|
|
60
60
|
*/
|
|
61
|
-
/**
|
|
62
|
-
* Breakpoint mixins
|
|
63
|
-
*/
|
|
64
61
|
/**
|
|
65
62
|
* Long content fade mixin
|
|
66
63
|
*
|
|
67
64
|
* Creates a fading overlay to signify that the content is longer
|
|
68
65
|
* than the space allows.
|
|
69
66
|
*/
|
|
67
|
+
/**
|
|
68
|
+
* Breakpoint mixins
|
|
69
|
+
*/
|
|
70
70
|
/**
|
|
71
71
|
* Focus styles.
|
|
72
72
|
*/
|
|
@@ -58,15 +58,15 @@
|
|
|
58
58
|
* @param {string} hex - the hexadecimal value to convert
|
|
59
59
|
* @return {string} comma separated rgb values
|
|
60
60
|
*/
|
|
61
|
-
/**
|
|
62
|
-
* Breakpoint mixins
|
|
63
|
-
*/
|
|
64
61
|
/**
|
|
65
62
|
* Long content fade mixin
|
|
66
63
|
*
|
|
67
64
|
* Creates a fading overlay to signify that the content is longer
|
|
68
65
|
* than the space allows.
|
|
69
66
|
*/
|
|
67
|
+
/**
|
|
68
|
+
* Breakpoint mixins
|
|
69
|
+
*/
|
|
70
70
|
/**
|
|
71
71
|
* Focus styles.
|
|
72
72
|
*/
|
|
@@ -58,15 +58,15 @@
|
|
|
58
58
|
* @param {string} hex - the hexadecimal value to convert
|
|
59
59
|
* @return {string} comma separated rgb values
|
|
60
60
|
*/
|
|
61
|
-
/**
|
|
62
|
-
* Breakpoint mixins
|
|
63
|
-
*/
|
|
64
61
|
/**
|
|
65
62
|
* Long content fade mixin
|
|
66
63
|
*
|
|
67
64
|
* Creates a fading overlay to signify that the content is longer
|
|
68
65
|
* than the space allows.
|
|
69
66
|
*/
|
|
67
|
+
/**
|
|
68
|
+
* Breakpoint mixins
|
|
69
|
+
*/
|
|
70
70
|
/**
|
|
71
71
|
* Focus styles.
|
|
72
72
|
*/
|
|
@@ -58,15 +58,15 @@
|
|
|
58
58
|
* @param {string} hex - the hexadecimal value to convert
|
|
59
59
|
* @return {string} comma separated rgb values
|
|
60
60
|
*/
|
|
61
|
-
/**
|
|
62
|
-
* Breakpoint mixins
|
|
63
|
-
*/
|
|
64
61
|
/**
|
|
65
62
|
* Long content fade mixin
|
|
66
63
|
*
|
|
67
64
|
* Creates a fading overlay to signify that the content is longer
|
|
68
65
|
* than the space allows.
|
|
69
66
|
*/
|
|
67
|
+
/**
|
|
68
|
+
* Breakpoint mixins
|
|
69
|
+
*/
|
|
70
70
|
/**
|
|
71
71
|
* Focus styles.
|
|
72
72
|
*/
|
|
@@ -58,15 +58,15 @@
|
|
|
58
58
|
* @param {string} hex - the hexadecimal value to convert
|
|
59
59
|
* @return {string} comma separated rgb values
|
|
60
60
|
*/
|
|
61
|
-
/**
|
|
62
|
-
* Breakpoint mixins
|
|
63
|
-
*/
|
|
64
61
|
/**
|
|
65
62
|
* Long content fade mixin
|
|
66
63
|
*
|
|
67
64
|
* Creates a fading overlay to signify that the content is longer
|
|
68
65
|
* than the space allows.
|
|
69
66
|
*/
|
|
67
|
+
/**
|
|
68
|
+
* Breakpoint mixins
|
|
69
|
+
*/
|
|
70
70
|
/**
|
|
71
71
|
* Focus styles.
|
|
72
72
|
*/
|
|
@@ -58,15 +58,15 @@
|
|
|
58
58
|
* @param {string} hex - the hexadecimal value to convert
|
|
59
59
|
* @return {string} comma separated rgb values
|
|
60
60
|
*/
|
|
61
|
-
/**
|
|
62
|
-
* Breakpoint mixins
|
|
63
|
-
*/
|
|
64
61
|
/**
|
|
65
62
|
* Long content fade mixin
|
|
66
63
|
*
|
|
67
64
|
* Creates a fading overlay to signify that the content is longer
|
|
68
65
|
* than the space allows.
|
|
69
66
|
*/
|
|
67
|
+
/**
|
|
68
|
+
* Breakpoint mixins
|
|
69
|
+
*/
|
|
70
70
|
/**
|
|
71
71
|
* Focus styles.
|
|
72
72
|
*/
|
|
@@ -58,15 +58,15 @@
|
|
|
58
58
|
* @param {string} hex - the hexadecimal value to convert
|
|
59
59
|
* @return {string} comma separated rgb values
|
|
60
60
|
*/
|
|
61
|
-
/**
|
|
62
|
-
* Breakpoint mixins
|
|
63
|
-
*/
|
|
64
61
|
/**
|
|
65
62
|
* Long content fade mixin
|
|
66
63
|
*
|
|
67
64
|
* Creates a fading overlay to signify that the content is longer
|
|
68
65
|
* than the space allows.
|
|
69
66
|
*/
|
|
67
|
+
/**
|
|
68
|
+
* Breakpoint mixins
|
|
69
|
+
*/
|
|
70
70
|
/**
|
|
71
71
|
* Focus styles.
|
|
72
72
|
*/
|
|
@@ -58,15 +58,15 @@
|
|
|
58
58
|
* @param {string} hex - the hexadecimal value to convert
|
|
59
59
|
* @return {string} comma separated rgb values
|
|
60
60
|
*/
|
|
61
|
-
/**
|
|
62
|
-
* Breakpoint mixins
|
|
63
|
-
*/
|
|
64
61
|
/**
|
|
65
62
|
* Long content fade mixin
|
|
66
63
|
*
|
|
67
64
|
* Creates a fading overlay to signify that the content is longer
|
|
68
65
|
* than the space allows.
|
|
69
66
|
*/
|
|
67
|
+
/**
|
|
68
|
+
* Breakpoint mixins
|
|
69
|
+
*/
|
|
70
70
|
/**
|
|
71
71
|
* Focus styles.
|
|
72
72
|
*/
|
|
@@ -58,15 +58,15 @@
|
|
|
58
58
|
* @param {string} hex - the hexadecimal value to convert
|
|
59
59
|
* @return {string} comma separated rgb values
|
|
60
60
|
*/
|
|
61
|
-
/**
|
|
62
|
-
* Breakpoint mixins
|
|
63
|
-
*/
|
|
64
61
|
/**
|
|
65
62
|
* Long content fade mixin
|
|
66
63
|
*
|
|
67
64
|
* Creates a fading overlay to signify that the content is longer
|
|
68
65
|
* than the space allows.
|
|
69
66
|
*/
|
|
67
|
+
/**
|
|
68
|
+
* Breakpoint mixins
|
|
69
|
+
*/
|
|
70
70
|
/**
|
|
71
71
|
* Focus styles.
|
|
72
72
|
*/
|
|
@@ -58,15 +58,15 @@
|
|
|
58
58
|
* @param {string} hex - the hexadecimal value to convert
|
|
59
59
|
* @return {string} comma separated rgb values
|
|
60
60
|
*/
|
|
61
|
-
/**
|
|
62
|
-
* Breakpoint mixins
|
|
63
|
-
*/
|
|
64
61
|
/**
|
|
65
62
|
* Long content fade mixin
|
|
66
63
|
*
|
|
67
64
|
* Creates a fading overlay to signify that the content is longer
|
|
68
65
|
* than the space allows.
|
|
69
66
|
*/
|
|
67
|
+
/**
|
|
68
|
+
* Breakpoint mixins
|
|
69
|
+
*/
|
|
70
70
|
/**
|
|
71
71
|
* Focus styles.
|
|
72
72
|
*/
|
|
@@ -58,15 +58,15 @@
|
|
|
58
58
|
* @param {string} hex - the hexadecimal value to convert
|
|
59
59
|
* @return {string} comma separated rgb values
|
|
60
60
|
*/
|
|
61
|
-
/**
|
|
62
|
-
* Breakpoint mixins
|
|
63
|
-
*/
|
|
64
61
|
/**
|
|
65
62
|
* Long content fade mixin
|
|
66
63
|
*
|
|
67
64
|
* Creates a fading overlay to signify that the content is longer
|
|
68
65
|
* than the space allows.
|
|
69
66
|
*/
|
|
67
|
+
/**
|
|
68
|
+
* Breakpoint mixins
|
|
69
|
+
*/
|
|
70
70
|
/**
|
|
71
71
|
* Focus styles.
|
|
72
72
|
*/
|
|
@@ -58,15 +58,15 @@
|
|
|
58
58
|
* @param {string} hex - the hexadecimal value to convert
|
|
59
59
|
* @return {string} comma separated rgb values
|
|
60
60
|
*/
|
|
61
|
-
/**
|
|
62
|
-
* Breakpoint mixins
|
|
63
|
-
*/
|
|
64
61
|
/**
|
|
65
62
|
* Long content fade mixin
|
|
66
63
|
*
|
|
67
64
|
* Creates a fading overlay to signify that the content is longer
|
|
68
65
|
* than the space allows.
|
|
69
66
|
*/
|
|
67
|
+
/**
|
|
68
|
+
* Breakpoint mixins
|
|
69
|
+
*/
|
|
70
70
|
/**
|
|
71
71
|
* Focus styles.
|
|
72
72
|
*/
|
|
@@ -58,15 +58,15 @@
|
|
|
58
58
|
* @param {string} hex - the hexadecimal value to convert
|
|
59
59
|
* @return {string} comma separated rgb values
|
|
60
60
|
*/
|
|
61
|
-
/**
|
|
62
|
-
* Breakpoint mixins
|
|
63
|
-
*/
|
|
64
61
|
/**
|
|
65
62
|
* Long content fade mixin
|
|
66
63
|
*
|
|
67
64
|
* Creates a fading overlay to signify that the content is longer
|
|
68
65
|
* than the space allows.
|
|
69
66
|
*/
|
|
67
|
+
/**
|
|
68
|
+
* Breakpoint mixins
|
|
69
|
+
*/
|
|
70
70
|
/**
|
|
71
71
|
* Focus styles.
|
|
72
72
|
*/
|
|
@@ -58,15 +58,15 @@
|
|
|
58
58
|
* @param {string} hex - the hexadecimal value to convert
|
|
59
59
|
* @return {string} comma separated rgb values
|
|
60
60
|
*/
|
|
61
|
-
/**
|
|
62
|
-
* Breakpoint mixins
|
|
63
|
-
*/
|
|
64
61
|
/**
|
|
65
62
|
* Long content fade mixin
|
|
66
63
|
*
|
|
67
64
|
* Creates a fading overlay to signify that the content is longer
|
|
68
65
|
* than the space allows.
|
|
69
66
|
*/
|
|
67
|
+
/**
|
|
68
|
+
* Breakpoint mixins
|
|
69
|
+
*/
|
|
70
70
|
/**
|
|
71
71
|
* Focus styles.
|
|
72
72
|
*/
|