@wordpress/block-library 9.23.0 → 9.25.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 +4 -0
- package/build/button/edit.js +29 -17
- package/build/button/edit.js.map +1 -1
- package/build/code/index.js +2 -1
- package/build/code/index.js.map +1 -1
- package/build/columns/edit.js +18 -22
- package/build/columns/edit.js.map +1 -1
- package/build/comment-author-name/edit.js +41 -12
- package/build/comment-author-name/edit.js.map +1 -1
- package/build/comment-date/edit.js +41 -12
- package/build/comment-date/edit.js.map +1 -1
- package/build/comment-edit-link/edit.js +27 -7
- package/build/comment-edit-link/edit.js.map +1 -1
- package/build/comments/edit/comments-inspector-controls.js +1 -3
- package/build/comments/edit/comments-inspector-controls.js.map +1 -1
- package/build/comments-pagination/edit.js +23 -9
- package/build/comments-pagination/edit.js.map +1 -1
- package/build/comments-title/edit.js +41 -12
- package/build/comments-title/edit.js.map +1 -1
- package/build/details/edit.js +27 -3
- package/build/details/edit.js.map +1 -1
- package/build/details/index.js +2 -1
- package/build/details/index.js.map +1 -1
- package/build/embed/edit.js +2 -4
- package/build/embed/edit.js.map +1 -1
- package/build/embed/embed-controls.js +41 -22
- package/build/embed/embed-controls.js.map +1 -1
- package/build/file/inspector.js +73 -30
- package/build/file/inspector.js.map +1 -1
- package/build/form/edit.js +67 -37
- package/build/form/edit.js.map +1 -1
- package/build/form-input/edit.js +47 -18
- package/build/form-input/edit.js.map +1 -1
- package/build/html/index.js +2 -1
- package/build/html/index.js.map +1 -1
- package/build/image/constants.js +2 -1
- package/build/image/constants.js.map +1 -1
- package/build/image/edit.js +1 -1
- package/build/image/edit.js.map +1 -1
- package/build/image/image.js +1 -4
- package/build/image/image.js.map +1 -1
- package/build/latest-posts/edit.js +154 -82
- package/build/latest-posts/edit.js.map +1 -1
- package/build/list/ordered-list-settings.js +131 -52
- package/build/list/ordered-list-settings.js.map +1 -1
- package/build/more/index.js +2 -1
- package/build/more/index.js.map +1 -1
- package/build/navigation/edit/index.js +93 -51
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/overlay-menu-preview.js +43 -27
- package/build/navigation/edit/overlay-menu-preview.js.map +1 -1
- package/build/navigation-link/index.js +3 -0
- package/build/navigation-link/index.js.map +1 -1
- package/build/navigation-link/transforms.js +2 -0
- package/build/navigation-link/transforms.js.map +1 -1
- package/build/navigation-link/update-attributes.js +1 -0
- package/build/navigation-link/update-attributes.js.map +1 -1
- package/build/navigation-submenu/index.js +3 -0
- package/build/navigation-submenu/index.js.map +1 -1
- package/build/post-comments-count/index.js +3 -1
- package/build/post-comments-count/index.js.map +1 -1
- package/build/post-comments-count/transforms.js +26 -0
- package/build/post-comments-count/transforms.js.map +1 -0
- package/build/post-comments-link/index.js +3 -1
- package/build/post-comments-link/index.js.map +1 -1
- package/build/post-comments-link/transforms.js +26 -0
- package/build/post-comments-link/transforms.js.map +1 -0
- package/build/post-excerpt/edit.js +3 -1
- package/build/post-excerpt/edit.js.map +1 -1
- package/build/post-excerpt/index.js +2 -1
- package/build/post-excerpt/index.js.map +1 -1
- package/build/post-navigation-link/edit.js +3 -1
- package/build/post-navigation-link/edit.js.map +1 -1
- package/build/post-navigation-link/index.js +2 -1
- package/build/post-navigation-link/index.js.map +1 -1
- package/build/post-navigation-link/variations.js +13 -13
- package/build/post-navigation-link/variations.js.map +1 -1
- package/build/post-template/edit.js +5 -3
- 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/index.js +4 -2
- package/build/post-terms/index.js.map +1 -1
- package/build/post-title/edit.js +56 -18
- package/build/post-title/edit.js.map +1 -1
- package/build/preformatted/transforms.js +5 -1
- package/build/preformatted/transforms.js.map +1 -1
- package/build/query/edit/enhanced-pagination-modal.js +1 -1
- package/build/query/edit/enhanced-pagination-modal.js.map +1 -1
- package/build/query/edit/inspector-controls/enhanced-pagination-control.js +3 -6
- package/build/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
- package/build/read-more/index.js +2 -1
- package/build/read-more/index.js.map +1 -1
- package/build/rss/edit.js +120 -46
- package/build/rss/edit.js.map +1 -1
- package/build/rss/index.js +2 -1
- package/build/rss/index.js.map +1 -1
- package/build/search/edit.js +76 -86
- package/build/search/edit.js.map +1 -1
- package/build/separator/edit.js +52 -20
- package/build/separator/edit.js.map +1 -1
- package/build/shortcode/index.js +2 -1
- package/build/shortcode/index.js.map +1 -1
- package/build/social-link/variations.js +53 -48
- package/build/social-link/variations.js.map +1 -1
- package/build/social-links/edit.js +35 -45
- package/build/social-links/edit.js.map +1 -1
- package/build/table/edit.js +3 -2
- package/build/table/edit.js.map +1 -1
- package/build/table/index.js +8 -4
- package/build/table/index.js.map +1 -1
- package/build/video/tracks-editor.js +40 -12
- package/build/video/tracks-editor.js.map +1 -1
- package/build-module/button/edit.js +30 -18
- package/build-module/button/edit.js.map +1 -1
- package/build-module/code/index.js +2 -1
- package/build-module/code/index.js.map +1 -1
- package/build-module/columns/edit.js +18 -22
- package/build-module/columns/edit.js.map +1 -1
- package/build-module/comment-author-name/edit.js +42 -13
- package/build-module/comment-author-name/edit.js.map +1 -1
- package/build-module/comment-date/edit.js +42 -13
- package/build-module/comment-date/edit.js.map +1 -1
- package/build-module/comment-edit-link/edit.js +28 -8
- package/build-module/comment-edit-link/edit.js.map +1 -1
- package/build-module/comments/edit/comments-inspector-controls.js +1 -3
- package/build-module/comments/edit/comments-inspector-controls.js.map +1 -1
- package/build-module/comments-pagination/edit.js +24 -10
- package/build-module/comments-pagination/edit.js.map +1 -1
- package/build-module/comments-title/edit.js +42 -13
- package/build-module/comments-title/edit.js.map +1 -1
- package/build-module/details/edit.js +29 -5
- package/build-module/details/edit.js.map +1 -1
- package/build-module/details/index.js +2 -1
- package/build-module/details/index.js.map +1 -1
- package/build-module/embed/edit.js +2 -4
- package/build-module/embed/edit.js.map +1 -1
- package/build-module/embed/embed-controls.js +42 -23
- package/build-module/embed/embed-controls.js.map +1 -1
- package/build-module/file/inspector.js +74 -31
- package/build-module/file/inspector.js.map +1 -1
- package/build-module/form/edit.js +68 -38
- package/build-module/form/edit.js.map +1 -1
- package/build-module/form-input/edit.js +48 -19
- package/build-module/form-input/edit.js.map +1 -1
- package/build-module/html/index.js +2 -1
- package/build-module/html/index.js.map +1 -1
- package/build-module/image/constants.js +1 -0
- package/build-module/image/constants.js.map +1 -1
- package/build-module/image/edit.js +2 -2
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/image.js +2 -5
- package/build-module/image/image.js.map +1 -1
- package/build-module/latest-posts/edit.js +155 -83
- package/build-module/latest-posts/edit.js.map +1 -1
- package/build-module/list/ordered-list-settings.js +132 -53
- package/build-module/list/ordered-list-settings.js.map +1 -1
- package/build-module/more/index.js +2 -1
- package/build-module/more/index.js.map +1 -1
- package/build-module/navigation/edit/index.js +94 -52
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/overlay-menu-preview.js +44 -28
- package/build-module/navigation/edit/overlay-menu-preview.js.map +1 -1
- package/build-module/navigation-link/index.js +3 -0
- package/build-module/navigation-link/index.js.map +1 -1
- package/build-module/navigation-link/transforms.js +2 -0
- package/build-module/navigation-link/transforms.js.map +1 -1
- package/build-module/navigation-link/update-attributes.js +1 -0
- package/build-module/navigation-link/update-attributes.js.map +1 -1
- package/build-module/navigation-submenu/index.js +3 -0
- package/build-module/navigation-submenu/index.js.map +1 -1
- package/build-module/post-comments-count/index.js +3 -1
- package/build-module/post-comments-count/index.js.map +1 -1
- package/build-module/post-comments-count/transforms.js +19 -0
- package/build-module/post-comments-count/transforms.js.map +1 -0
- package/build-module/post-comments-link/index.js +3 -1
- package/build-module/post-comments-link/index.js.map +1 -1
- package/build-module/post-comments-link/transforms.js +19 -0
- package/build-module/post-comments-link/transforms.js.map +1 -0
- package/build-module/post-excerpt/edit.js +4 -2
- package/build-module/post-excerpt/edit.js.map +1 -1
- package/build-module/post-excerpt/index.js +2 -1
- package/build-module/post-excerpt/index.js.map +1 -1
- package/build-module/post-navigation-link/edit.js +4 -2
- package/build-module/post-navigation-link/edit.js.map +1 -1
- package/build-module/post-navigation-link/index.js +2 -1
- package/build-module/post-navigation-link/index.js.map +1 -1
- package/build-module/post-navigation-link/variations.js +13 -13
- package/build-module/post-navigation-link/variations.js.map +1 -1
- package/build-module/post-template/edit.js +5 -3
- 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/index.js +4 -2
- package/build-module/post-terms/index.js.map +1 -1
- package/build-module/post-title/edit.js +57 -19
- package/build-module/post-title/edit.js.map +1 -1
- package/build-module/preformatted/transforms.js +5 -1
- package/build-module/preformatted/transforms.js.map +1 -1
- package/build-module/query/edit/enhanced-pagination-modal.js +1 -1
- package/build-module/query/edit/enhanced-pagination-modal.js.map +1 -1
- package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js +3 -6
- package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
- package/build-module/read-more/index.js +2 -1
- package/build-module/read-more/index.js.map +1 -1
- package/build-module/rss/edit.js +121 -47
- package/build-module/rss/edit.js.map +1 -1
- package/build-module/rss/index.js +2 -1
- package/build-module/rss/index.js.map +1 -1
- package/build-module/search/edit.js +78 -88
- package/build-module/search/edit.js.map +1 -1
- package/build-module/separator/edit.js +54 -22
- package/build-module/separator/edit.js.map +1 -1
- package/build-module/shortcode/index.js +2 -1
- package/build-module/shortcode/index.js.map +1 -1
- package/build-module/social-link/variations.js +53 -48
- package/build-module/social-link/variations.js.map +1 -1
- package/build-module/social-links/edit.js +37 -47
- package/build-module/social-links/edit.js.map +1 -1
- package/build-module/table/edit.js +4 -3
- package/build-module/table/edit.js.map +1 -1
- package/build-module/table/index.js +8 -4
- package/build-module/table/index.js.map +1 -1
- package/build-module/video/tracks-editor.js +41 -13
- package/build-module/video/tracks-editor.js.map +1 -1
- package/build-style/archives/editor-rtl.css +47 -11
- package/build-style/archives/editor.css +47 -11
- package/build-style/archives/style-rtl.css +47 -11
- package/build-style/archives/style.css +47 -11
- package/build-style/audio/editor-rtl.css +47 -11
- package/build-style/audio/editor.css +47 -11
- package/build-style/audio/style-rtl.css +47 -11
- package/build-style/audio/style.css +47 -11
- package/build-style/audio/theme-rtl.css +47 -11
- package/build-style/audio/theme.css +47 -11
- package/build-style/avatar/editor-rtl.css +47 -11
- package/build-style/avatar/editor.css +47 -11
- package/build-style/avatar/style-rtl.css +47 -11
- package/build-style/avatar/style.css +47 -11
- package/build-style/button/editor-rtl.css +47 -11
- package/build-style/button/editor.css +47 -11
- package/build-style/button/style-rtl.css +47 -12
- package/build-style/button/style.css +47 -12
- package/build-style/buttons/editor-rtl.css +47 -11
- package/build-style/buttons/editor.css +47 -11
- package/build-style/buttons/style-rtl.css +50 -11
- package/build-style/buttons/style.css +50 -11
- package/build-style/calendar/style-rtl.css +47 -11
- package/build-style/calendar/style.css +47 -11
- package/build-style/categories/editor-rtl.css +47 -11
- package/build-style/categories/editor.css +47 -11
- package/build-style/categories/style-rtl.css +47 -11
- package/build-style/categories/style.css +47 -11
- package/build-style/classic-rtl.css +47 -11
- package/build-style/classic.css +47 -11
- package/build-style/code/editor-rtl.css +47 -11
- package/build-style/code/editor.css +47 -11
- package/build-style/code/style-rtl.css +47 -11
- package/build-style/code/style.css +47 -11
- package/build-style/code/theme-rtl.css +47 -11
- package/build-style/code/theme.css +47 -11
- package/build-style/columns/editor-rtl.css +47 -11
- package/build-style/columns/editor.css +47 -11
- package/build-style/columns/style-rtl.css +47 -11
- package/build-style/columns/style.css +47 -11
- package/build-style/comment-author-avatar/editor-rtl.css +47 -11
- package/build-style/comment-author-avatar/editor.css +47 -11
- package/build-style/comment-author-name/style-rtl.css +47 -11
- package/build-style/comment-author-name/style.css +47 -11
- package/build-style/comment-content/style-rtl.css +47 -11
- package/build-style/comment-content/style.css +47 -11
- package/build-style/comment-date/style-rtl.css +47 -11
- package/build-style/comment-date/style.css +47 -11
- package/build-style/comment-edit-link/style-rtl.css +47 -11
- package/build-style/comment-edit-link/style.css +47 -11
- package/build-style/comment-reply-link/style-rtl.css +47 -11
- package/build-style/comment-reply-link/style.css +47 -11
- package/build-style/comment-template/style-rtl.css +47 -11
- package/build-style/comment-template/style.css +47 -11
- package/build-style/comments/editor-rtl.css +47 -11
- package/build-style/comments/editor.css +47 -11
- package/build-style/comments/style-rtl.css +47 -11
- package/build-style/comments/style.css +47 -11
- package/build-style/comments-pagination/editor-rtl.css +47 -11
- package/build-style/comments-pagination/editor.css +47 -11
- package/build-style/comments-pagination/style-rtl.css +47 -11
- package/build-style/comments-pagination/style.css +47 -11
- package/build-style/comments-pagination-numbers/editor-rtl.css +47 -11
- package/build-style/comments-pagination-numbers/editor.css +47 -11
- package/build-style/comments-title/editor-rtl.css +47 -11
- package/build-style/comments-title/editor.css +47 -11
- package/build-style/common-rtl.css +130 -9
- package/build-style/common.css +130 -9
- package/build-style/cover/editor-rtl.css +47 -11
- package/build-style/cover/editor.css +47 -11
- package/build-style/cover/style-rtl.css +47 -11
- package/build-style/cover/style.css +47 -11
- package/build-style/details/editor-rtl.css +47 -11
- package/build-style/details/editor.css +47 -11
- package/build-style/details/style-rtl.css +47 -11
- package/build-style/details/style.css +47 -11
- package/build-style/editor-elements-rtl.css +47 -11
- package/build-style/editor-elements.css +47 -11
- package/build-style/editor-rtl.css +57 -15
- package/build-style/editor.css +57 -15
- package/build-style/elements-rtl.css +47 -11
- package/build-style/elements.css +47 -11
- package/build-style/embed/editor-rtl.css +47 -11
- package/build-style/embed/editor.css +47 -11
- package/build-style/embed/style-rtl.css +47 -11
- package/build-style/embed/style.css +47 -11
- package/build-style/embed/theme-rtl.css +47 -11
- package/build-style/embed/theme.css +47 -11
- package/build-style/file/editor-rtl.css +47 -11
- package/build-style/file/editor.css +47 -11
- package/build-style/file/style-rtl.css +47 -11
- package/build-style/file/style.css +47 -11
- package/build-style/footnotes/style-rtl.css +47 -11
- package/build-style/footnotes/style.css +47 -11
- package/build-style/form-input/editor-rtl.css +47 -11
- package/build-style/form-input/editor.css +47 -11
- package/build-style/form-input/style-rtl.css +47 -11
- package/build-style/form-input/style.css +47 -11
- package/build-style/form-submission-notification/editor-rtl.css +47 -11
- package/build-style/form-submission-notification/editor.css +47 -11
- package/build-style/form-submit-button/style-rtl.css +47 -11
- package/build-style/form-submit-button/style.css +47 -11
- package/build-style/freeform/editor-rtl.css +47 -11
- package/build-style/freeform/editor.css +47 -11
- package/build-style/gallery/editor-rtl.css +47 -11
- package/build-style/gallery/editor.css +47 -11
- package/build-style/gallery/style-rtl.css +48 -11
- package/build-style/gallery/style.css +48 -11
- package/build-style/gallery/theme-rtl.css +47 -11
- package/build-style/gallery/theme.css +47 -11
- package/build-style/group/editor-rtl.css +47 -11
- package/build-style/group/editor.css +47 -11
- package/build-style/group/style-rtl.css +47 -11
- package/build-style/group/style.css +47 -11
- package/build-style/group/theme-rtl.css +47 -11
- package/build-style/group/theme.css +47 -11
- package/build-style/heading/style-rtl.css +47 -11
- package/build-style/heading/style.css +47 -11
- package/build-style/html/editor-rtl.css +48 -11
- package/build-style/html/editor.css +48 -11
- package/build-style/image/editor-rtl.css +47 -11
- package/build-style/image/editor.css +47 -11
- package/build-style/image/style-rtl.css +47 -11
- package/build-style/image/style.css +47 -11
- package/build-style/image/theme-rtl.css +47 -11
- package/build-style/image/theme.css +47 -11
- package/build-style/latest-comments/style-rtl.css +47 -11
- package/build-style/latest-comments/style.css +47 -11
- package/build-style/latest-posts/editor-rtl.css +47 -11
- package/build-style/latest-posts/editor.css +47 -11
- package/build-style/latest-posts/style-rtl.css +47 -11
- package/build-style/latest-posts/style.css +47 -11
- package/build-style/list/style-rtl.css +47 -11
- package/build-style/list/style.css +47 -11
- package/build-style/loginout/style-rtl.css +47 -11
- package/build-style/loginout/style.css +47 -11
- package/build-style/media-text/editor-rtl.css +47 -11
- package/build-style/media-text/editor.css +47 -11
- package/build-style/media-text/style-rtl.css +47 -11
- package/build-style/media-text/style.css +47 -11
- package/build-style/more/editor-rtl.css +47 -11
- package/build-style/more/editor.css +47 -11
- package/build-style/navigation/editor-rtl.css +55 -14
- package/build-style/navigation/editor.css +55 -14
- package/build-style/navigation/style-rtl.css +47 -11
- package/build-style/navigation/style.css +47 -11
- package/build-style/navigation-link/editor-rtl.css +47 -11
- package/build-style/navigation-link/editor.css +47 -11
- package/build-style/navigation-link/style-rtl.css +47 -11
- package/build-style/navigation-link/style.css +47 -11
- package/build-style/navigation-submenu/editor-rtl.css +47 -11
- package/build-style/navigation-submenu/editor.css +47 -11
- package/build-style/nextpage/editor-rtl.css +47 -11
- package/build-style/nextpage/editor.css +47 -11
- package/build-style/page-list/editor-rtl.css +47 -11
- package/build-style/page-list/editor.css +47 -11
- package/build-style/page-list/style-rtl.css +47 -11
- package/build-style/page-list/style.css +47 -11
- package/build-style/paragraph/editor-rtl.css +47 -11
- package/build-style/paragraph/editor.css +47 -11
- package/build-style/paragraph/style-rtl.css +47 -11
- package/build-style/paragraph/style.css +47 -11
- package/build-style/post-author/editor-rtl.css +47 -11
- package/build-style/post-author/editor.css +47 -11
- package/build-style/post-author/style-rtl.css +47 -11
- package/build-style/post-author/style.css +47 -11
- package/build-style/post-author-biography/style-rtl.css +47 -11
- package/build-style/post-author-biography/style.css +47 -11
- package/build-style/post-author-name/style-rtl.css +47 -11
- package/build-style/post-author-name/style.css +47 -11
- package/build-style/post-comments-count/style-rtl.css +47 -11
- package/build-style/post-comments-count/style.css +47 -11
- package/build-style/post-comments-form/editor-rtl.css +47 -11
- package/build-style/post-comments-form/editor.css +47 -11
- package/build-style/post-comments-form/style-rtl.css +47 -14
- package/build-style/post-comments-form/style.css +47 -14
- package/build-style/post-comments-link/style-rtl.css +47 -11
- package/build-style/post-comments-link/style.css +47 -11
- package/build-style/post-content/style-rtl.css +47 -11
- package/build-style/post-content/style.css +47 -11
- package/build-style/post-date/style-rtl.css +47 -11
- package/build-style/post-date/style.css +47 -11
- package/build-style/post-excerpt/editor-rtl.css +47 -11
- package/build-style/post-excerpt/editor.css +47 -11
- package/build-style/post-excerpt/style-rtl.css +47 -11
- package/build-style/post-excerpt/style.css +47 -11
- package/build-style/post-featured-image/editor-rtl.css +47 -11
- package/build-style/post-featured-image/editor.css +47 -11
- package/build-style/post-featured-image/style-rtl.css +47 -11
- package/build-style/post-featured-image/style.css +47 -11
- package/build-style/post-navigation-link/style-rtl.css +47 -11
- package/build-style/post-navigation-link/style.css +47 -11
- package/build-style/post-template/style-rtl.css +47 -11
- package/build-style/post-template/style.css +47 -11
- package/build-style/post-terms/style-rtl.css +47 -11
- package/build-style/post-terms/style.css +47 -11
- package/build-style/post-time-to-read/style-rtl.css +47 -11
- package/build-style/post-time-to-read/style.css +47 -11
- package/build-style/post-title/style-rtl.css +47 -11
- package/build-style/post-title/style.css +47 -11
- package/build-style/preformatted/style-rtl.css +47 -11
- package/build-style/preformatted/style.css +47 -11
- package/build-style/pullquote/editor-rtl.css +48 -12
- package/build-style/pullquote/editor.css +48 -12
- package/build-style/pullquote/style-rtl.css +49 -14
- package/build-style/pullquote/style.css +49 -14
- package/build-style/pullquote/theme-rtl.css +49 -13
- package/build-style/pullquote/theme.css +49 -13
- package/build-style/query/editor-rtl.css +47 -11
- package/build-style/query/editor.css +47 -11
- package/build-style/query-pagination/editor-rtl.css +47 -11
- package/build-style/query-pagination/editor.css +47 -11
- package/build-style/query-pagination/style-rtl.css +47 -11
- package/build-style/query-pagination/style.css +47 -11
- package/build-style/query-pagination-numbers/editor-rtl.css +47 -11
- package/build-style/query-pagination-numbers/editor.css +47 -11
- package/build-style/query-title/style-rtl.css +47 -11
- package/build-style/query-title/style.css +47 -11
- package/build-style/query-total/style-rtl.css +47 -11
- package/build-style/query-total/style.css +47 -11
- package/build-style/quote/style-rtl.css +47 -11
- package/build-style/quote/style.css +47 -11
- package/build-style/quote/theme-rtl.css +47 -11
- package/build-style/quote/theme.css +47 -11
- package/build-style/read-more/style-rtl.css +47 -11
- package/build-style/read-more/style.css +47 -11
- package/build-style/reset-rtl.css +47 -11
- package/build-style/reset.css +47 -11
- package/build-style/rss/editor-rtl.css +47 -11
- package/build-style/rss/editor.css +47 -11
- package/build-style/rss/style-rtl.css +47 -11
- package/build-style/rss/style.css +47 -11
- package/build-style/search/editor-rtl.css +47 -11
- package/build-style/search/editor.css +47 -11
- package/build-style/search/style-rtl.css +47 -11
- package/build-style/search/style.css +47 -11
- package/build-style/search/theme-rtl.css +47 -11
- package/build-style/search/theme.css +47 -11
- package/build-style/separator/editor-rtl.css +47 -11
- package/build-style/separator/editor.css +47 -11
- package/build-style/separator/style-rtl.css +47 -11
- package/build-style/separator/style.css +47 -11
- package/build-style/separator/theme-rtl.css +47 -11
- package/build-style/separator/theme.css +47 -11
- package/build-style/shortcode/editor-rtl.css +47 -11
- package/build-style/shortcode/editor.css +47 -11
- package/build-style/site-logo/editor-rtl.css +47 -11
- package/build-style/site-logo/editor.css +47 -11
- package/build-style/site-logo/style-rtl.css +47 -11
- package/build-style/site-logo/style.css +47 -11
- package/build-style/site-tagline/editor-rtl.css +47 -11
- package/build-style/site-tagline/editor.css +47 -11
- package/build-style/site-tagline/style-rtl.css +47 -11
- package/build-style/site-tagline/style.css +47 -11
- package/build-style/site-title/editor-rtl.css +47 -11
- package/build-style/site-title/editor.css +47 -11
- package/build-style/site-title/style-rtl.css +47 -11
- package/build-style/site-title/style.css +47 -11
- package/build-style/social-link/editor-rtl.css +47 -11
- package/build-style/social-link/editor.css +47 -11
- package/build-style/social-links/editor-rtl.css +47 -11
- package/build-style/social-links/editor.css +47 -11
- package/build-style/social-links/style-rtl.css +47 -11
- package/build-style/social-links/style.css +47 -11
- package/build-style/spacer/editor-rtl.css +47 -11
- package/build-style/spacer/editor.css +47 -11
- package/build-style/spacer/style-rtl.css +47 -11
- package/build-style/spacer/style.css +47 -11
- package/build-style/style-rtl.css +53 -18
- package/build-style/style.css +53 -18
- package/build-style/table/editor-rtl.css +47 -11
- package/build-style/table/editor.css +47 -11
- package/build-style/table/style-rtl.css +47 -11
- package/build-style/table/style.css +47 -11
- package/build-style/table/theme-rtl.css +47 -11
- package/build-style/table/theme.css +47 -11
- package/build-style/table-of-contents/style-rtl.css +47 -11
- package/build-style/table-of-contents/style.css +47 -11
- package/build-style/tag-cloud/editor-rtl.css +47 -11
- package/build-style/tag-cloud/editor.css +47 -11
- package/build-style/tag-cloud/style-rtl.css +47 -11
- package/build-style/tag-cloud/style.css +47 -11
- package/build-style/template-part/editor-rtl.css +47 -11
- package/build-style/template-part/editor.css +47 -11
- package/build-style/template-part/theme-rtl.css +47 -11
- package/build-style/template-part/theme.css +47 -11
- package/build-style/term-description/style-rtl.css +47 -11
- package/build-style/term-description/style.css +47 -11
- package/build-style/text-columns/editor-rtl.css +47 -11
- package/build-style/text-columns/editor.css +47 -11
- package/build-style/text-columns/style-rtl.css +47 -11
- package/build-style/text-columns/style.css +47 -11
- package/build-style/theme-rtl.css +49 -13
- package/build-style/theme.css +49 -13
- package/build-style/verse/style-rtl.css +47 -11
- package/build-style/verse/style.css +47 -11
- package/build-style/video/editor-rtl.css +47 -11
- package/build-style/video/editor.css +47 -11
- package/build-style/video/style-rtl.css +47 -11
- package/build-style/video/style.css +47 -11
- package/build-style/video/theme-rtl.css +47 -11
- package/build-style/video/theme.css +47 -11
- package/package.json +35 -35
- package/src/button/edit.js +44 -29
- package/src/button/style.scss +0 -1
- package/src/buttons/style.scss +5 -0
- package/src/code/block.json +2 -1
- package/src/columns/edit.js +20 -31
- package/src/comment-author-name/edit.js +54 -13
- package/src/comment-date/edit.js +50 -15
- package/src/comment-edit-link/edit.js +39 -11
- package/src/comments/edit/comments-inspector-controls.js +0 -2
- package/src/comments-pagination/edit.js +29 -9
- package/src/comments-title/edit.js +53 -15
- package/src/details/block.json +2 -1
- package/src/details/edit.js +36 -4
- package/src/embed/edit.js +3 -5
- package/src/embed/embed-controls.js +55 -33
- package/src/file/inspector.js +99 -45
- package/src/form/edit.js +91 -46
- package/src/form-input/edit.js +56 -18
- package/src/gallery/style.scss +1 -0
- package/src/html/block.json +2 -1
- package/src/html/editor.scss +1 -0
- package/src/image/constants.js +1 -0
- package/src/image/edit.js +2 -1
- package/src/image/image.js +7 -5
- package/src/latest-posts/edit.js +206 -98
- package/src/list/ordered-list-settings.js +172 -62
- package/src/more/block.json +2 -1
- package/src/navigation/edit/index.js +127 -64
- package/src/navigation/edit/overlay-menu-preview.js +43 -26
- package/src/navigation/editor.scss +8 -4
- package/src/navigation-link/block.json +3 -0
- package/src/navigation-link/index.php +4 -0
- package/src/navigation-link/transforms.js +2 -1
- package/src/navigation-link/update-attributes.js +1 -0
- package/src/navigation-submenu/block.json +3 -0
- package/src/navigation-submenu/index.php +4 -0
- package/src/post-comments-count/index.js +2 -0
- package/src/post-comments-count/transforms.js +20 -0
- package/src/post-comments-form/style.scss +0 -5
- package/src/post-comments-link/index.js +2 -0
- package/src/post-comments-link/transforms.js +20 -0
- package/src/post-excerpt/block.json +2 -1
- package/src/post-excerpt/edit.js +13 -8
- package/src/post-navigation-link/block.json +2 -1
- package/src/post-navigation-link/edit.js +13 -8
- package/src/post-navigation-link/variations.js +13 -13
- package/src/post-template/edit.js +4 -3
- package/src/post-terms/block.json +4 -2
- package/src/post-terms/edit.js +13 -8
- package/src/post-title/edit.js +76 -24
- package/src/preformatted/test/__snapshots__/transforms.native.js.snap +6 -0
- package/src/preformatted/test/transforms.native.js +6 -1
- package/src/preformatted/transforms.js +7 -1
- package/src/pullquote/editor.scss +1 -1
- package/src/pullquote/style.scss +2 -3
- package/src/pullquote/theme.scss +2 -2
- package/src/query/edit/enhanced-pagination-modal.js +1 -5
- package/src/query/edit/inspector-controls/enhanced-pagination-control.js +3 -13
- package/src/read-more/block.json +2 -1
- package/src/rss/block.json +2 -1
- package/src/rss/edit.js +141 -55
- package/src/search/edit.js +84 -99
- package/src/separator/edit.js +66 -21
- package/src/shortcode/block.json +2 -1
- package/src/site-title/index.php +1 -1
- package/src/social-link/index.php +49 -49
- package/src/social-link/variations.js +53 -48
- package/src/social-links/edit.js +39 -60
- package/src/table/block.json +8 -4
- package/src/table/edit.js +6 -2
- package/src/verse/test/__snapshots__/transforms.native.js.snap +6 -0
- package/src/verse/test/transforms.native.js +5 -1
- package/src/video/tracks-editor.js +57 -16
- package/build/search/icons.js +0 -121
- package/build/search/icons.js.map +0 -1
- package/build-module/search/icons.js +0 -114
- package/build-module/search/icons.js.map +0 -1
- package/src/search/icons.js +0 -89
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_icons","require","_i18n","_initBlock","_interopRequireDefault","_edit","_save","_transforms","metadata","exports","$schema","apiVersion","name","title","category","description","keywords","textdomain","attributes","showContent","type","summary","source","selector","attribute","allowedBlocks","placeholder","supports","__experimentalOnEnter","align","anchor","color","gradients","link","__experimentalDefaultControls","background","text","__experimentalBorder","width","style","html","spacing","margin","padding","blockGap","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","layout","allowEditing","interactivity","clientNavigation","editorStyle","settings","icon","example","__","innerBlocks","content","__experimentalLabel","context","customName","hasSummary","trim","length","sprintf","save","edit","transforms","init","initBlock"],"sources":["@wordpress/block-library/src/details/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { details as icon } from '@wordpress/icons';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport save from './save';\nimport transforms from './transforms';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tsummary: __( 'La Mancha' ),\n\t\t\tshowContent: true,\n\t\t},\n\t\tinnerBlocks: [\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcontent: __(\n\t\t\t\t\t\t'In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing.'\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n\t__experimentalLabel( attributes, { context } ) {\n\t\tconst { summary } = attributes;\n\n\t\tconst customName = attributes?.metadata?.name;\n\t\tconst hasSummary = summary?.trim().length > 0;\n\n\t\t// In the list view, use the block's summary as the label.\n\t\t// If the summary is empty, fall back to the default label.\n\t\tif ( context === 'list-view' && ( customName || hasSummary ) ) {\n\t\t\treturn customName || summary;\n\t\t}\n\n\t\tif ( context === 'accessibility' ) {\n\t\t\treturn ! hasSummary\n\t\t\t\t? __( 'Details. Empty.' )\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t/* translators: accessibility text; summary title. */\n\t\t\t\t\t\t__( 'Details. %s' ),\n\t\t\t\t\t\tsummary\n\t\t\t\t );\n\t\t}\n\t},\n\tsave,\n\tedit,\n\ttransforms,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,UAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,IAAAI,KAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,KAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,WAAA,GAAAH,sBAAA,CAAAH,OAAA;AAbA;AACA;AACA;AAIA;AACA;AACA;AAFA,MAAAO,QAAA,GAAAC,OAAA,CAAAD,QAAA;EAAAE,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,WAAA;EAAAC,QAAA;EAAAC,UAAA;EAAAC,UAAA;IAAAC,WAAA;MAAAC,IAAA;MAAA;IAAA;IAAAC,OAAA;MAAAD,IAAA;MAAAE,MAAA;MAAAC,QAAA;IAAA;
|
|
1
|
+
{"version":3,"names":["_icons","require","_i18n","_initBlock","_interopRequireDefault","_edit","_save","_transforms","metadata","exports","$schema","apiVersion","name","title","category","description","keywords","textdomain","attributes","showContent","type","summary","source","selector","role","attribute","allowedBlocks","placeholder","supports","__experimentalOnEnter","align","anchor","color","gradients","link","__experimentalDefaultControls","background","text","__experimentalBorder","width","style","html","spacing","margin","padding","blockGap","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","layout","allowEditing","interactivity","clientNavigation","editorStyle","settings","icon","example","__","innerBlocks","content","__experimentalLabel","context","customName","hasSummary","trim","length","sprintf","save","edit","transforms","init","initBlock"],"sources":["@wordpress/block-library/src/details/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { details as icon } from '@wordpress/icons';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport save from './save';\nimport transforms from './transforms';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tsummary: __( 'La Mancha' ),\n\t\t\tshowContent: true,\n\t\t},\n\t\tinnerBlocks: [\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcontent: __(\n\t\t\t\t\t\t'In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing.'\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n\t__experimentalLabel( attributes, { context } ) {\n\t\tconst { summary } = attributes;\n\n\t\tconst customName = attributes?.metadata?.name;\n\t\tconst hasSummary = summary?.trim().length > 0;\n\n\t\t// In the list view, use the block's summary as the label.\n\t\t// If the summary is empty, fall back to the default label.\n\t\tif ( context === 'list-view' && ( customName || hasSummary ) ) {\n\t\t\treturn customName || summary;\n\t\t}\n\n\t\tif ( context === 'accessibility' ) {\n\t\t\treturn ! hasSummary\n\t\t\t\t? __( 'Details. Empty.' )\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t/* translators: accessibility text; summary title. */\n\t\t\t\t\t\t__( 'Details. %s' ),\n\t\t\t\t\t\tsummary\n\t\t\t\t );\n\t\t}\n\t},\n\tsave,\n\tedit,\n\ttransforms,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,UAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,IAAAI,KAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,KAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,WAAA,GAAAH,sBAAA,CAAAH,OAAA;AAbA;AACA;AACA;AAIA;AACA;AACA;AAFA,MAAAO,QAAA,GAAAC,OAAA,CAAAD,QAAA;EAAAE,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,WAAA;EAAAC,QAAA;EAAAC,UAAA;EAAAC,UAAA;IAAAC,WAAA;MAAAC,IAAA;MAAA;IAAA;IAAAC,OAAA;MAAAD,IAAA;MAAAE,MAAA;MAAAC,QAAA;MAAAC,IAAA;IAAA;IAAAZ,IAAA;MAAAQ,IAAA;MAAAE,MAAA;MAAAG,SAAA;MAAAF,QAAA;IAAA;IAAAG,aAAA;MAAAN,IAAA;IAAA;IAAAO,WAAA;MAAAP,IAAA;IAAA;EAAA;EAAAQ,QAAA;IAAAC,qBAAA;IAAAC,KAAA;IAAAC,MAAA;IAAAC,KAAA;MAAAC,SAAA;MAAAC,IAAA;MAAAC,6BAAA;QAAAC,UAAA;QAAAC,IAAA;MAAA;IAAA;IAAAC,oBAAA;MAAAN,KAAA;MAAAO,KAAA;MAAAC,KAAA;IAAA;IAAAC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AK,eAAe,EAAG;MAClC,OAAO,CAAEE,UAAU,GAChB,IAAAN,QAAE,EAAE,iBAAkB,CAAC,GACvB,IAAAS,aAAO,EACP;MACA,IAAAT,QAAE,EAAE,aAAc,CAAC,EACnB1C,OACA,CAAC;IACL;EACD,CAAC;EACDoD,IAAI,EAAJA,aAAI;EACJC,IAAI,EAAJA,aAAI;EACJC,UAAU,EAAVA;AACD,CAAC;AAEM,MAAMC,IAAI,GAAGA,CAAA,KAAM,IAAAC,kBAAS,EAAE;EAAEjE,IAAI;EAAEJ,QAAQ;EAAEoD;AAAS,CAAE,CAAC;AAACnD,OAAA,CAAAmE,IAAA,GAAAA,IAAA","ignoreList":[]}
|
package/build/embed/edit.js
CHANGED
|
@@ -107,20 +107,18 @@ const EmbedEdit = props => {
|
|
|
107
107
|
* @return {Object} Merged attributes.
|
|
108
108
|
*/
|
|
109
109
|
const getMergedAttributes = () => (0, _util.getMergedAttributesWithPreview)(attributes, preview, title, responsive);
|
|
110
|
-
|
|
110
|
+
function toggleResponsive(newAllowResponsive) {
|
|
111
111
|
const {
|
|
112
|
-
allowResponsive,
|
|
113
112
|
className
|
|
114
113
|
} = attributes;
|
|
115
114
|
const {
|
|
116
115
|
html
|
|
117
116
|
} = preview;
|
|
118
|
-
const newAllowResponsive = !allowResponsive;
|
|
119
117
|
setAttributes({
|
|
120
118
|
allowResponsive: newAllowResponsive,
|
|
121
119
|
className: (0, _util.getClassNames)(html, className, responsive && newAllowResponsive)
|
|
122
120
|
});
|
|
123
|
-
}
|
|
121
|
+
}
|
|
124
122
|
(0, _element.useEffect)(() => {
|
|
125
123
|
if (preview?.html || !cannotEmbed || !hasResolved) {
|
|
126
124
|
return;
|
package/build/embed/edit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_util","require","_embedControls","_interopRequireDefault","_icons","_embedLoading","_embedPlaceholder","_embedPreview","_clsx","_i18n","_element","_data","_blockEditor","_coreData","_primitives","_url","_caption","_jsxRuntime","EmbedEdit","props","attributes","providerNameSlug","previewable","responsive","url","attributesUrl","isSelected","onReplace","setAttributes","insertBlocksAfter","onFocus","defaultEmbedInfo","title","_x","icon","embedContentIcon","getEmbedInfoByProvider","setURL","useState","isEditingURL","setIsEditingURL","invalidateResolution","useDispatch","coreStore","preview","fetching","themeSupportsResponsive","cannotEmbed","hasResolved","useSelect","select","getEmbedPreview","isPreviewEmbedFallback","isRequestingEmbedPreview","getThemeSupports","hasFinishedResolution","embedPreview","previewIsFallback","badEmbedProvider","html","type","undefined","wordpressCantEmbed","data","status","validPreview","getMergedAttributes","getMergedAttributesWithPreview","toggleResponsive","allowResponsive","className","newAllowResponsive","getClassNames","useEffect","newURL","replace","getAuthority","URL","host","toString","mergedAttributes","hasChanges","Object","keys","some","key","upgradedBlock","createUpgradedEmbedBlock","blockProps","useBlockProps","jsx","View","children","default","label","sprintf","__","showEmbedPlaceholder","onSubmit","event","preventDefault","blockClass","removeAspectRatioClasses","value","onChange","fallback","tryAgain","caption","classFromPreview","clsx","jsxs","Fragment","showEditButton","blockSupportsResponsive","switchBackToURLInput","onCaptionChange","Caption","showToolbarButton","_default","exports"],"sources":["@wordpress/block-library/src/embed/edit.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport {\n\tcreateUpgradedEmbedBlock,\n\tgetClassNames,\n\tremoveAspectRatioClasses,\n\tfallback,\n\tgetEmbedInfoByProvider,\n\tgetMergedAttributesWithPreview,\n} from './util';\nimport EmbedControls from './embed-controls';\nimport { embedContentIcon } from './icons';\nimport EmbedLoading from './embed-loading';\nimport EmbedPlaceholder from './embed-placeholder';\nimport EmbedPreview from './embed-preview';\n\n/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { useState, useEffect } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useBlockProps } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { View } from '@wordpress/primitives';\nimport { getAuthority } from '@wordpress/url';\nimport { Caption } from '../utils/caption';\n\nconst EmbedEdit = ( props ) => {\n\tconst {\n\t\tattributes: {\n\t\t\tproviderNameSlug,\n\t\t\tpreviewable,\n\t\t\tresponsive,\n\t\t\turl: attributesUrl,\n\t\t},\n\t\tattributes,\n\t\tisSelected,\n\t\tonReplace,\n\t\tsetAttributes,\n\t\tinsertBlocksAfter,\n\t\tonFocus,\n\t} = props;\n\n\tconst defaultEmbedInfo = {\n\t\ttitle: _x( 'Embed', 'block title' ),\n\t\ticon: embedContentIcon,\n\t};\n\tconst { icon, title } =\n\t\tgetEmbedInfoByProvider( providerNameSlug ) || defaultEmbedInfo;\n\n\tconst [ url, setURL ] = useState( attributesUrl );\n\tconst [ isEditingURL, setIsEditingURL ] = useState( false );\n\tconst { invalidateResolution } = useDispatch( coreStore );\n\n\tconst {\n\t\tpreview,\n\t\tfetching,\n\t\tthemeSupportsResponsive,\n\t\tcannotEmbed,\n\t\thasResolved,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetEmbedPreview,\n\t\t\t\tisPreviewEmbedFallback,\n\t\t\t\tisRequestingEmbedPreview,\n\t\t\t\tgetThemeSupports,\n\t\t\t\thasFinishedResolution,\n\t\t\t} = select( coreStore );\n\t\t\tif ( ! attributesUrl ) {\n\t\t\t\treturn { fetching: false, cannotEmbed: false };\n\t\t\t}\n\n\t\t\tconst embedPreview = getEmbedPreview( attributesUrl );\n\t\t\tconst previewIsFallback = isPreviewEmbedFallback( attributesUrl );\n\n\t\t\t// The external oEmbed provider does not exist. We got no type info and no html.\n\t\t\tconst badEmbedProvider =\n\t\t\t\tembedPreview?.html === false &&\n\t\t\t\tembedPreview?.type === undefined;\n\t\t\t// Some WordPress URLs that can't be embedded will cause the API to return\n\t\t\t// a valid JSON response with no HTML and `data.status` set to 404, rather\n\t\t\t// than generating a fallback response as other embeds do.\n\t\t\tconst wordpressCantEmbed = embedPreview?.data?.status === 404;\n\t\t\tconst validPreview =\n\t\t\t\t!! embedPreview && ! badEmbedProvider && ! wordpressCantEmbed;\n\t\t\treturn {\n\t\t\t\tpreview: validPreview ? embedPreview : undefined,\n\t\t\t\tfetching: isRequestingEmbedPreview( attributesUrl ),\n\t\t\t\tthemeSupportsResponsive:\n\t\t\t\t\tgetThemeSupports()[ 'responsive-embeds' ],\n\t\t\t\tcannotEmbed: ! validPreview || previewIsFallback,\n\t\t\t\thasResolved: hasFinishedResolution( 'getEmbedPreview', [\n\t\t\t\t\tattributesUrl,\n\t\t\t\t] ),\n\t\t\t};\n\t\t},\n\t\t[ attributesUrl ]\n\t);\n\n\t/**\n\t * Returns the attributes derived from the preview, merged with the current attributes.\n\t *\n\t * @return {Object} Merged attributes.\n\t */\n\tconst getMergedAttributes = () =>\n\t\tgetMergedAttributesWithPreview(\n\t\t\tattributes,\n\t\t\tpreview,\n\t\t\ttitle,\n\t\t\tresponsive\n\t\t);\n\n\tconst toggleResponsive = () => {\n\t\tconst { allowResponsive, className } = attributes;\n\t\tconst { html } = preview;\n\t\tconst newAllowResponsive = ! allowResponsive;\n\n\t\tsetAttributes( {\n\t\t\tallowResponsive: newAllowResponsive,\n\t\t\tclassName: getClassNames(\n\t\t\t\thtml,\n\t\t\t\tclassName,\n\t\t\t\tresponsive && newAllowResponsive\n\t\t\t),\n\t\t} );\n\t};\n\n\tuseEffect( () => {\n\t\tif ( preview?.html || ! cannotEmbed || ! hasResolved ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// At this stage, we're not fetching the preview and know it can't be embedded,\n\t\t// so try removing any trailing slash, and resubmit.\n\t\tconst newURL = attributesUrl.replace( /\\/$/, '' );\n\t\tsetURL( newURL );\n\t\tsetIsEditingURL( false );\n\t\tsetAttributes( { url: newURL } );\n\t}, [\n\t\tpreview?.html,\n\t\tattributesUrl,\n\t\tcannotEmbed,\n\t\thasResolved,\n\t\tsetAttributes,\n\t] );\n\n\t// Try a different provider in case the embed url is not supported.\n\tuseEffect( () => {\n\t\tif ( ! cannotEmbed || fetching || ! url ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Until X provider is supported in WordPress, as a workaround we use Twitter provider.\n\t\tif ( getAuthority( url ) === 'x.com' ) {\n\t\t\tconst newURL = new URL( url );\n\t\t\tnewURL.host = 'twitter.com';\n\t\t\tsetAttributes( { url: newURL.toString() } );\n\t\t}\n\t}, [ url, cannotEmbed, fetching, setAttributes ] );\n\n\t// Handle incoming preview.\n\tuseEffect( () => {\n\t\tif ( preview && ! isEditingURL ) {\n\t\t\t// When obtaining an incoming preview,\n\t\t\t// we set the attributes derived from the preview data.\n\t\t\tconst mergedAttributes = getMergedAttributes();\n\t\t\tconst hasChanges = Object.keys( mergedAttributes ).some(\n\t\t\t\t( key ) => mergedAttributes[ key ] !== attributes[ key ]\n\t\t\t);\n\n\t\t\tif ( hasChanges ) {\n\t\t\t\tsetAttributes( mergedAttributes );\n\t\t\t}\n\n\t\t\tif ( onReplace ) {\n\t\t\t\tconst upgradedBlock = createUpgradedEmbedBlock(\n\t\t\t\t\tprops,\n\t\t\t\t\tmergedAttributes\n\t\t\t\t);\n\n\t\t\t\tif ( upgradedBlock ) {\n\t\t\t\t\tonReplace( upgradedBlock );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}, [ preview, isEditingURL ] );\n\n\tconst blockProps = useBlockProps();\n\n\tif ( fetching ) {\n\t\treturn (\n\t\t\t<View { ...blockProps }>\n\t\t\t\t<EmbedLoading />\n\t\t\t</View>\n\t\t);\n\t}\n\n\t// translators: %s: type of embed e.g: \"YouTube\", \"Twitter\", etc. \"Embed\" is used when no specific type exists\n\tconst label = sprintf( __( '%s URL' ), title );\n\n\t// No preview, or we can't embed the current URL, or we've clicked the edit button.\n\tconst showEmbedPlaceholder = ! preview || cannotEmbed || isEditingURL;\n\n\tif ( showEmbedPlaceholder ) {\n\t\treturn (\n\t\t\t<View { ...blockProps }>\n\t\t\t\t<EmbedPlaceholder\n\t\t\t\t\ticon={ icon }\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\tonSubmit={ ( event ) => {\n\t\t\t\t\t\tif ( event ) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// If the embed URL was changed, we need to reset the aspect ratio class.\n\t\t\t\t\t\t// To do this we have to remove the existing ratio class so it can be recalculated.\n\t\t\t\t\t\tconst blockClass = removeAspectRatioClasses(\n\t\t\t\t\t\t\tattributes.className\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tsetIsEditingURL( false );\n\t\t\t\t\t\tsetAttributes( { url, className: blockClass } );\n\t\t\t\t\t} }\n\t\t\t\t\tvalue={ url }\n\t\t\t\t\tcannotEmbed={ cannotEmbed }\n\t\t\t\t\tonChange={ ( value ) => setURL( value ) }\n\t\t\t\t\tfallback={ () => fallback( url, onReplace ) }\n\t\t\t\t\ttryAgain={ () => {\n\t\t\t\t\t\tinvalidateResolution( 'getEmbedPreview', [ url ] );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</View>\n\t\t);\n\t}\n\n\t// Even though we set attributes that get derived from the preview,\n\t// we don't access them directly because for the initial render,\n\t// the `setAttributes` call will not have taken effect. If we're\n\t// rendering responsive content, setting the responsive classes\n\t// after the preview has been rendered can result in unwanted\n\t// clipping or scrollbars. The `getAttributesFromPreview` function\n\t// that `getMergedAttributes` uses is memoized so that we're not\n\t// calculating them on every render.\n\tconst {\n\t\tcaption,\n\t\ttype,\n\t\tallowResponsive,\n\t\tclassName: classFromPreview,\n\t} = getMergedAttributes();\n\tconst className = clsx( classFromPreview, props.className );\n\n\treturn (\n\t\t<>\n\t\t\t<EmbedControls\n\t\t\t\tshowEditButton={ preview && ! cannotEmbed }\n\t\t\t\tthemeSupportsResponsive={ themeSupportsResponsive }\n\t\t\t\tblockSupportsResponsive={ responsive }\n\t\t\t\tallowResponsive={ allowResponsive }\n\t\t\t\ttoggleResponsive={ toggleResponsive }\n\t\t\t\tswitchBackToURLInput={ () => setIsEditingURL( true ) }\n\t\t\t/>\n\t\t\t<figure\n\t\t\t\t{ ...blockProps }\n\t\t\t\tclassName={ clsx( blockProps.className, className, {\n\t\t\t\t\t[ `is-type-${ type }` ]: type,\n\t\t\t\t\t[ `is-provider-${ providerNameSlug }` ]: providerNameSlug,\n\t\t\t\t\t[ `wp-block-embed-${ providerNameSlug }` ]:\n\t\t\t\t\t\tproviderNameSlug,\n\t\t\t\t} ) }\n\t\t\t>\n\t\t\t\t<EmbedPreview\n\t\t\t\t\tpreview={ preview }\n\t\t\t\t\tpreviewable={ previewable }\n\t\t\t\t\tclassName={ className }\n\t\t\t\t\turl={ url }\n\t\t\t\t\ttype={ type }\n\t\t\t\t\tcaption={ caption }\n\t\t\t\t\tonCaptionChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { caption: value } )\n\t\t\t\t\t}\n\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\ticon={ icon }\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t/>\n\t\t\t\t<Caption\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\t\tlabel={ __( 'Embed caption text' ) }\n\t\t\t\t\tshowToolbarButton={ isSelected }\n\t\t\t\t/>\n\t\t\t</figure>\n\t\t</>\n\t);\n};\n\nexport default EmbedEdit;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAQA,IAAAC,cAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,iBAAA,GAAAH,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A,CACR,CAAC;AAEL,CAAC;AAAC,IAAA4F,QAAA,GAAAC,OAAA,CAAA1B,OAAA,GAEa3E,SAAS","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_util","require","_embedControls","_interopRequireDefault","_icons","_embedLoading","_embedPlaceholder","_embedPreview","_clsx","_i18n","_element","_data","_blockEditor","_coreData","_primitives","_url","_caption","_jsxRuntime","EmbedEdit","props","attributes","providerNameSlug","previewable","responsive","url","attributesUrl","isSelected","onReplace","setAttributes","insertBlocksAfter","onFocus","defaultEmbedInfo","title","_x","icon","embedContentIcon","getEmbedInfoByProvider","setURL","useState","isEditingURL","setIsEditingURL","invalidateResolution","useDispatch","coreStore","preview","fetching","themeSupportsResponsive","cannotEmbed","hasResolved","useSelect","select","getEmbedPreview","isPreviewEmbedFallback","isRequestingEmbedPreview","getThemeSupports","hasFinishedResolution","embedPreview","previewIsFallback","badEmbedProvider","html","type","undefined","wordpressCantEmbed","data","status","validPreview","getMergedAttributes","getMergedAttributesWithPreview","toggleResponsive","newAllowResponsive","className","allowResponsive","getClassNames","useEffect","newURL","replace","getAuthority","URL","host","toString","mergedAttributes","hasChanges","Object","keys","some","key","upgradedBlock","createUpgradedEmbedBlock","blockProps","useBlockProps","jsx","View","children","default","label","sprintf","__","showEmbedPlaceholder","onSubmit","event","preventDefault","blockClass","removeAspectRatioClasses","value","onChange","fallback","tryAgain","caption","classFromPreview","clsx","jsxs","Fragment","showEditButton","blockSupportsResponsive","switchBackToURLInput","onCaptionChange","Caption","showToolbarButton","_default","exports"],"sources":["@wordpress/block-library/src/embed/edit.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport {\n\tcreateUpgradedEmbedBlock,\n\tgetClassNames,\n\tremoveAspectRatioClasses,\n\tfallback,\n\tgetEmbedInfoByProvider,\n\tgetMergedAttributesWithPreview,\n} from './util';\nimport EmbedControls from './embed-controls';\nimport { embedContentIcon } from './icons';\nimport EmbedLoading from './embed-loading';\nimport EmbedPlaceholder from './embed-placeholder';\nimport EmbedPreview from './embed-preview';\n\n/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { useState, useEffect } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useBlockProps } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { View } from '@wordpress/primitives';\nimport { getAuthority } from '@wordpress/url';\nimport { Caption } from '../utils/caption';\n\nconst EmbedEdit = ( props ) => {\n\tconst {\n\t\tattributes: {\n\t\t\tproviderNameSlug,\n\t\t\tpreviewable,\n\t\t\tresponsive,\n\t\t\turl: attributesUrl,\n\t\t},\n\t\tattributes,\n\t\tisSelected,\n\t\tonReplace,\n\t\tsetAttributes,\n\t\tinsertBlocksAfter,\n\t\tonFocus,\n\t} = props;\n\n\tconst defaultEmbedInfo = {\n\t\ttitle: _x( 'Embed', 'block title' ),\n\t\ticon: embedContentIcon,\n\t};\n\tconst { icon, title } =\n\t\tgetEmbedInfoByProvider( providerNameSlug ) || defaultEmbedInfo;\n\n\tconst [ url, setURL ] = useState( attributesUrl );\n\tconst [ isEditingURL, setIsEditingURL ] = useState( false );\n\tconst { invalidateResolution } = useDispatch( coreStore );\n\n\tconst {\n\t\tpreview,\n\t\tfetching,\n\t\tthemeSupportsResponsive,\n\t\tcannotEmbed,\n\t\thasResolved,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetEmbedPreview,\n\t\t\t\tisPreviewEmbedFallback,\n\t\t\t\tisRequestingEmbedPreview,\n\t\t\t\tgetThemeSupports,\n\t\t\t\thasFinishedResolution,\n\t\t\t} = select( coreStore );\n\t\t\tif ( ! attributesUrl ) {\n\t\t\t\treturn { fetching: false, cannotEmbed: false };\n\t\t\t}\n\n\t\t\tconst embedPreview = getEmbedPreview( attributesUrl );\n\t\t\tconst previewIsFallback = isPreviewEmbedFallback( attributesUrl );\n\n\t\t\t// The external oEmbed provider does not exist. We got no type info and no html.\n\t\t\tconst badEmbedProvider =\n\t\t\t\tembedPreview?.html === false &&\n\t\t\t\tembedPreview?.type === undefined;\n\t\t\t// Some WordPress URLs that can't be embedded will cause the API to return\n\t\t\t// a valid JSON response with no HTML and `data.status` set to 404, rather\n\t\t\t// than generating a fallback response as other embeds do.\n\t\t\tconst wordpressCantEmbed = embedPreview?.data?.status === 404;\n\t\t\tconst validPreview =\n\t\t\t\t!! embedPreview && ! badEmbedProvider && ! wordpressCantEmbed;\n\t\t\treturn {\n\t\t\t\tpreview: validPreview ? embedPreview : undefined,\n\t\t\t\tfetching: isRequestingEmbedPreview( attributesUrl ),\n\t\t\t\tthemeSupportsResponsive:\n\t\t\t\t\tgetThemeSupports()[ 'responsive-embeds' ],\n\t\t\t\tcannotEmbed: ! validPreview || previewIsFallback,\n\t\t\t\thasResolved: hasFinishedResolution( 'getEmbedPreview', [\n\t\t\t\t\tattributesUrl,\n\t\t\t\t] ),\n\t\t\t};\n\t\t},\n\t\t[ attributesUrl ]\n\t);\n\n\t/**\n\t * Returns the attributes derived from the preview, merged with the current attributes.\n\t *\n\t * @return {Object} Merged attributes.\n\t */\n\tconst getMergedAttributes = () =>\n\t\tgetMergedAttributesWithPreview(\n\t\t\tattributes,\n\t\t\tpreview,\n\t\t\ttitle,\n\t\t\tresponsive\n\t\t);\n\n\tfunction toggleResponsive( newAllowResponsive ) {\n\t\tconst { className } = attributes;\n\t\tconst { html } = preview;\n\t\tsetAttributes( {\n\t\t\tallowResponsive: newAllowResponsive,\n\t\t\tclassName: getClassNames(\n\t\t\t\thtml,\n\t\t\t\tclassName,\n\t\t\t\tresponsive && newAllowResponsive\n\t\t\t),\n\t\t} );\n\t}\n\n\tuseEffect( () => {\n\t\tif ( preview?.html || ! cannotEmbed || ! hasResolved ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// At this stage, we're not fetching the preview and know it can't be embedded,\n\t\t// so try removing any trailing slash, and resubmit.\n\t\tconst newURL = attributesUrl.replace( /\\/$/, '' );\n\t\tsetURL( newURL );\n\t\tsetIsEditingURL( false );\n\t\tsetAttributes( { url: newURL } );\n\t}, [\n\t\tpreview?.html,\n\t\tattributesUrl,\n\t\tcannotEmbed,\n\t\thasResolved,\n\t\tsetAttributes,\n\t] );\n\n\t// Try a different provider in case the embed url is not supported.\n\tuseEffect( () => {\n\t\tif ( ! cannotEmbed || fetching || ! url ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Until X provider is supported in WordPress, as a workaround we use Twitter provider.\n\t\tif ( getAuthority( url ) === 'x.com' ) {\n\t\t\tconst newURL = new URL( url );\n\t\t\tnewURL.host = 'twitter.com';\n\t\t\tsetAttributes( { url: newURL.toString() } );\n\t\t}\n\t}, [ url, cannotEmbed, fetching, setAttributes ] );\n\n\t// Handle incoming preview.\n\tuseEffect( () => {\n\t\tif ( preview && ! isEditingURL ) {\n\t\t\t// When obtaining an incoming preview,\n\t\t\t// we set the attributes derived from the preview data.\n\t\t\tconst mergedAttributes = getMergedAttributes();\n\t\t\tconst hasChanges = Object.keys( mergedAttributes ).some(\n\t\t\t\t( key ) => mergedAttributes[ key ] !== attributes[ key ]\n\t\t\t);\n\n\t\t\tif ( hasChanges ) {\n\t\t\t\tsetAttributes( mergedAttributes );\n\t\t\t}\n\n\t\t\tif ( onReplace ) {\n\t\t\t\tconst upgradedBlock = createUpgradedEmbedBlock(\n\t\t\t\t\tprops,\n\t\t\t\t\tmergedAttributes\n\t\t\t\t);\n\n\t\t\t\tif ( upgradedBlock ) {\n\t\t\t\t\tonReplace( upgradedBlock );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}, [ preview, isEditingURL ] );\n\n\tconst blockProps = useBlockProps();\n\n\tif ( fetching ) {\n\t\treturn (\n\t\t\t<View { ...blockProps }>\n\t\t\t\t<EmbedLoading />\n\t\t\t</View>\n\t\t);\n\t}\n\n\t// translators: %s: type of embed e.g: \"YouTube\", \"Twitter\", etc. \"Embed\" is used when no specific type exists\n\tconst label = sprintf( __( '%s URL' ), title );\n\n\t// No preview, or we can't embed the current URL, or we've clicked the edit button.\n\tconst showEmbedPlaceholder = ! preview || cannotEmbed || isEditingURL;\n\n\tif ( showEmbedPlaceholder ) {\n\t\treturn (\n\t\t\t<View { ...blockProps }>\n\t\t\t\t<EmbedPlaceholder\n\t\t\t\t\ticon={ icon }\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\tonSubmit={ ( event ) => {\n\t\t\t\t\t\tif ( event ) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// If the embed URL was changed, we need to reset the aspect ratio class.\n\t\t\t\t\t\t// To do this we have to remove the existing ratio class so it can be recalculated.\n\t\t\t\t\t\tconst blockClass = removeAspectRatioClasses(\n\t\t\t\t\t\t\tattributes.className\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tsetIsEditingURL( false );\n\t\t\t\t\t\tsetAttributes( { url, className: blockClass } );\n\t\t\t\t\t} }\n\t\t\t\t\tvalue={ url }\n\t\t\t\t\tcannotEmbed={ cannotEmbed }\n\t\t\t\t\tonChange={ ( value ) => setURL( value ) }\n\t\t\t\t\tfallback={ () => fallback( url, onReplace ) }\n\t\t\t\t\ttryAgain={ () => {\n\t\t\t\t\t\tinvalidateResolution( 'getEmbedPreview', [ url ] );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</View>\n\t\t);\n\t}\n\n\t// Even though we set attributes that get derived from the preview,\n\t// we don't access them directly because for the initial render,\n\t// the `setAttributes` call will not have taken effect. If we're\n\t// rendering responsive content, setting the responsive classes\n\t// after the preview has been rendered can result in unwanted\n\t// clipping or scrollbars. The `getAttributesFromPreview` function\n\t// that `getMergedAttributes` uses is memoized so that we're not\n\t// calculating them on every render.\n\tconst {\n\t\tcaption,\n\t\ttype,\n\t\tallowResponsive,\n\t\tclassName: classFromPreview,\n\t} = getMergedAttributes();\n\tconst className = clsx( classFromPreview, props.className );\n\n\treturn (\n\t\t<>\n\t\t\t<EmbedControls\n\t\t\t\tshowEditButton={ preview && ! cannotEmbed }\n\t\t\t\tthemeSupportsResponsive={ themeSupportsResponsive }\n\t\t\t\tblockSupportsResponsive={ responsive }\n\t\t\t\tallowResponsive={ allowResponsive }\n\t\t\t\ttoggleResponsive={ toggleResponsive }\n\t\t\t\tswitchBackToURLInput={ () => setIsEditingURL( true ) }\n\t\t\t/>\n\t\t\t<figure\n\t\t\t\t{ ...blockProps }\n\t\t\t\tclassName={ clsx( blockProps.className, className, {\n\t\t\t\t\t[ `is-type-${ type }` ]: type,\n\t\t\t\t\t[ `is-provider-${ providerNameSlug }` ]: providerNameSlug,\n\t\t\t\t\t[ `wp-block-embed-${ providerNameSlug }` ]:\n\t\t\t\t\t\tproviderNameSlug,\n\t\t\t\t} ) }\n\t\t\t>\n\t\t\t\t<EmbedPreview\n\t\t\t\t\tpreview={ preview }\n\t\t\t\t\tpreviewable={ previewable }\n\t\t\t\t\tclassName={ className }\n\t\t\t\t\turl={ url }\n\t\t\t\t\ttype={ type }\n\t\t\t\t\tcaption={ caption }\n\t\t\t\t\tonCaptionChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { caption: value } )\n\t\t\t\t\t}\n\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\ticon={ icon }\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t/>\n\t\t\t\t<Caption\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\t\tlabel={ __( 'Embed caption text' ) }\n\t\t\t\t\tshowToolbarButton={ isSelected }\n\t\t\t\t/>\n\t\t\t</figure>\n\t\t</>\n\t);\n};\n\nexport default Embed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;QACzBG,iBAAiB,EAAGA,iBAAmB;QACvCiE,KAAK,EAAG,IAAAE,QAAE,EAAE,oBAAqB,CAAG;QACpCqB,iBAAiB,EAAG3F;MAAY,CAChC,CAAC;IAAA,CACK,CAAC;EAAA,CACR,CAAC;AAEL,CAAC;AAAC,IAAA4F,QAAA,GAAAC,OAAA,CAAA1B,OAAA,GAEa3E,SAAS","ignoreList":[]}
|
|
@@ -8,11 +8,16 @@ var _i18n = require("@wordpress/i18n");
|
|
|
8
8
|
var _components = require("@wordpress/components");
|
|
9
9
|
var _blockEditor = require("@wordpress/block-editor");
|
|
10
10
|
var _icons = require("@wordpress/icons");
|
|
11
|
+
var _hooks = require("../utils/hooks");
|
|
11
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
13
|
/**
|
|
13
14
|
* WordPress dependencies
|
|
14
15
|
*/
|
|
15
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Internal dependencies
|
|
19
|
+
*/
|
|
20
|
+
|
|
16
21
|
function getResponsiveHelp(checked) {
|
|
17
22
|
return checked ? (0, _i18n.__)('This embed will preserve its aspect ratio when the browser is resized.') : (0, _i18n.__)('This embed may not preserve its aspect ratio when the browser is resized.');
|
|
18
23
|
}
|
|
@@ -23,29 +28,43 @@ const EmbedControls = ({
|
|
|
23
28
|
allowResponsive,
|
|
24
29
|
toggleResponsive,
|
|
25
30
|
switchBackToURLInput
|
|
26
|
-
}) =>
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
}) => {
|
|
32
|
+
const dropdownMenuProps = (0, _hooks.useToolsPanelDropdownMenuProps)();
|
|
33
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
34
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.BlockControls, {
|
|
35
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarGroup, {
|
|
36
|
+
children: showEditButton && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarButton, {
|
|
37
|
+
className: "components-toolbar__control",
|
|
38
|
+
label: (0, _i18n.__)('Edit URL'),
|
|
39
|
+
icon: _icons.edit,
|
|
40
|
+
onClick: switchBackToURLInput
|
|
41
|
+
})
|
|
34
42
|
})
|
|
35
|
-
})
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
}), themeSupportsResponsive && blockSupportsResponsive && /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.InspectorControls, {
|
|
44
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanel, {
|
|
45
|
+
label: (0, _i18n.__)('Media settings'),
|
|
46
|
+
resetAll: () => {
|
|
47
|
+
toggleResponsive(true);
|
|
48
|
+
},
|
|
49
|
+
dropdownMenuProps: dropdownMenuProps,
|
|
50
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
|
|
51
|
+
label: (0, _i18n.__)('Media settings'),
|
|
52
|
+
isShownByDefault: true,
|
|
53
|
+
hasValue: () => !allowResponsive,
|
|
54
|
+
onDeselect: () => {
|
|
55
|
+
toggleResponsive(!allowResponsive);
|
|
56
|
+
},
|
|
57
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToggleControl, {
|
|
58
|
+
__nextHasNoMarginBottom: true,
|
|
59
|
+
label: (0, _i18n.__)('Resize for smaller devices'),
|
|
60
|
+
checked: allowResponsive,
|
|
61
|
+
help: getResponsiveHelp,
|
|
62
|
+
onChange: toggleResponsive
|
|
63
|
+
})
|
|
64
|
+
})
|
|
46
65
|
})
|
|
47
|
-
})
|
|
48
|
-
})
|
|
49
|
-
}
|
|
66
|
+
})]
|
|
67
|
+
});
|
|
68
|
+
};
|
|
50
69
|
var _default = exports.default = EmbedControls;
|
|
51
70
|
//# sourceMappingURL=embed-controls.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_components","_blockEditor","_icons","_jsxRuntime","getResponsiveHelp","checked","__","EmbedControls","blockSupportsResponsive","showEditButton","themeSupportsResponsive","allowResponsive","toggleResponsive","switchBackToURLInput","jsxs","Fragment","children","jsx","BlockControls","ToolbarGroup","ToolbarButton","className","label","icon","edit","onClick","InspectorControls","
|
|
1
|
+
{"version":3,"names":["_i18n","require","_components","_blockEditor","_icons","_hooks","_jsxRuntime","getResponsiveHelp","checked","__","EmbedControls","blockSupportsResponsive","showEditButton","themeSupportsResponsive","allowResponsive","toggleResponsive","switchBackToURLInput","dropdownMenuProps","useToolsPanelDropdownMenuProps","jsxs","Fragment","children","jsx","BlockControls","ToolbarGroup","ToolbarButton","className","label","icon","edit","onClick","InspectorControls","__experimentalToolsPanel","resetAll","__experimentalToolsPanelItem","isShownByDefault","hasValue","onDeselect","ToggleControl","__nextHasNoMarginBottom","help","onChange","_default","exports","default"],"sources":["@wordpress/block-library/src/embed/embed-controls.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tToolbarButton,\n\tToggleControl,\n\tToolbarGroup,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { BlockControls, InspectorControls } from '@wordpress/block-editor';\nimport { edit } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\nfunction getResponsiveHelp( checked ) {\n\treturn checked\n\t\t? __(\n\t\t\t\t'This embed will preserve its aspect ratio when the browser is resized.'\n\t\t )\n\t\t: __(\n\t\t\t\t'This embed may not preserve its aspect ratio when the browser is resized.'\n\t\t );\n}\n\nconst EmbedControls = ( {\n\tblockSupportsResponsive,\n\tshowEditButton,\n\tthemeSupportsResponsive,\n\tallowResponsive,\n\ttoggleResponsive,\n\tswitchBackToURLInput,\n} ) => {\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls>\n\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t{ showEditButton && (\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\tclassName=\"components-toolbar__control\"\n\t\t\t\t\t\t\tlabel={ __( 'Edit URL' ) }\n\t\t\t\t\t\t\ticon={ edit }\n\t\t\t\t\t\t\tonClick={ switchBackToURLInput }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</ToolbarGroup>\n\t\t\t</BlockControls>\n\t\t\t{ themeSupportsResponsive && blockSupportsResponsive && (\n\t\t\t\t<InspectorControls>\n\t\t\t\t\t<ToolsPanel\n\t\t\t\t\t\tlabel={ __( 'Media settings' ) }\n\t\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\t\ttoggleResponsive( true );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\tlabel={ __( 'Media settings' ) }\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\thasValue={ () => ! allowResponsive }\n\t\t\t\t\t\t\tonDeselect={ () => {\n\t\t\t\t\t\t\t\ttoggleResponsive( ! allowResponsive );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Resize for smaller devices' ) }\n\t\t\t\t\t\t\t\tchecked={ allowResponsive }\n\t\t\t\t\t\t\t\thelp={ getResponsiveHelp }\n\t\t\t\t\t\t\t\tonChange={ toggleResponsive }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem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QAAA,eACjB,IAAAf,WAAA,CAAAgB,GAAA,EAACpB,WAAA,CAAA8B,wBAAU;QACVL,KAAK,EAAG,IAAAlB,QAAE,EAAE,gBAAiB,CAAG;QAChCwB,QAAQ,EAAGA,CAAA,KAAM;UAChBlB,gBAAgB,CAAE,IAAK,CAAC;QACzB,CAAG;QACHE,iBAAiB,EAAGA,iBAAmB;QAAAI,QAAA,eAEvC,IAAAf,WAAA,CAAAgB,GAAA,EAACpB,WAAA,CAAAgC,4BAAc;UACdP,KAAK,EAAG,IAAAlB,QAAE,EAAE,gBAAiB,CAAG;UAChC0B,gBAAgB;UAChBC,QAAQ,EAAGA,CAAA,KAAM,CAAEtB,eAAiB;UACpCuB,UAAU,EAAGA,CAAA,KAAM;YAClBtB,gBAAgB,CAAE,CAAED,eAAgB,CAAC;UACtC,CAAG;UAAAO,QAAA,eAEH,IAAAf,WAAA,CAAAgB,GAAA,EAACpB,WAAA,CAAAoC,aAAa;YACbC,uBAAuB;YACvBZ,KAAK,EAAG,IAAAlB,QAAE,EAAE,4BAA6B,CAAG;YAC5CD,OAAO,EAAGM,eAAiB;YAC3B0B,IAAI,EAAGjC,iBAAmB;YAC1BkC,QAAQ,EAAG1B;UAAkB,CAC7B;QAAC,CACa;MAAC,CACN;IAAC,CACK,CACnB;EAAA,CACA,CAAC;AAEL,CAAC;AAAC,IAAA2B,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEalC,aAAa","ignoreList":[]}
|
package/build/file/inspector.js
CHANGED
|
@@ -8,6 +8,7 @@ var _i18n = require("@wordpress/i18n");
|
|
|
8
8
|
var _components = require("@wordpress/components");
|
|
9
9
|
var _blockEditor = require("@wordpress/block-editor");
|
|
10
10
|
var _edit = require("./edit");
|
|
11
|
+
var _hooks = require("../utils/hooks");
|
|
11
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
13
|
/**
|
|
13
14
|
* WordPress dependencies
|
|
@@ -34,6 +35,7 @@ function FileBlockInspector({
|
|
|
34
35
|
textLinkHref,
|
|
35
36
|
attachmentPage
|
|
36
37
|
} = hrefs;
|
|
38
|
+
const dropdownMenuProps = (0, _hooks.useToolsPanelDropdownMenuProps)();
|
|
37
39
|
let linkDestinationOptions = [{
|
|
38
40
|
value: href,
|
|
39
41
|
label: (0, _i18n.__)('URL')
|
|
@@ -49,42 +51,83 @@ function FileBlockInspector({
|
|
|
49
51
|
}
|
|
50
52
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
51
53
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_blockEditor.InspectorControls, {
|
|
52
|
-
children: [href.endsWith('.pdf') && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
children: [href.endsWith('.pdf') && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalToolsPanel, {
|
|
55
|
+
label: (0, _i18n.__)('PDF settings'),
|
|
56
|
+
resetAll: () => {
|
|
57
|
+
changeDisplayPreview(true);
|
|
58
|
+
changePreviewHeight(600);
|
|
59
|
+
},
|
|
60
|
+
dropdownMenuProps: dropdownMenuProps,
|
|
61
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
|
|
56
62
|
label: (0, _i18n.__)('Show inline embed'),
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
+
isShownByDefault: true,
|
|
64
|
+
hasValue: () => !displayPreview,
|
|
65
|
+
onDeselect: () => changeDisplayPreview(true),
|
|
66
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToggleControl, {
|
|
67
|
+
__nextHasNoMarginBottom: true,
|
|
68
|
+
label: (0, _i18n.__)('Show inline embed'),
|
|
69
|
+
help: displayPreview ? (0, _i18n.__)("Note: Most phone and tablet browsers won't display embedded PDFs.") : null,
|
|
70
|
+
checked: !!displayPreview,
|
|
71
|
+
onChange: changeDisplayPreview
|
|
72
|
+
})
|
|
73
|
+
}), displayPreview && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
|
|
63
74
|
label: (0, _i18n.__)('Height in pixels'),
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
75
|
+
isShownByDefault: true,
|
|
76
|
+
hasValue: () => previewHeight !== 600,
|
|
77
|
+
onDeselect: () => changePreviewHeight(600),
|
|
78
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.RangeControl, {
|
|
79
|
+
__nextHasNoMarginBottom: true,
|
|
80
|
+
__next40pxDefaultSize: true,
|
|
81
|
+
label: (0, _i18n.__)('Height in pixels'),
|
|
82
|
+
min: _edit.MIN_PREVIEW_HEIGHT,
|
|
83
|
+
max: Math.max(_edit.MAX_PREVIEW_HEIGHT, previewHeight),
|
|
84
|
+
value: previewHeight,
|
|
85
|
+
onChange: changePreviewHeight
|
|
86
|
+
})
|
|
68
87
|
})]
|
|
69
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
88
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalToolsPanel, {
|
|
89
|
+
label: (0, _i18n.__)('Settings'),
|
|
90
|
+
resetAll: () => {
|
|
91
|
+
changeLinkDestinationOption(href);
|
|
92
|
+
changeOpenInNewWindow(false);
|
|
93
|
+
changeShowDownloadButton(true);
|
|
94
|
+
},
|
|
95
|
+
dropdownMenuProps: dropdownMenuProps,
|
|
96
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
|
|
74
97
|
label: (0, _i18n.__)('Link to'),
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
98
|
+
isShownByDefault: true,
|
|
99
|
+
hasValue: () => textLinkHref !== href,
|
|
100
|
+
onDeselect: () => changeLinkDestinationOption(href),
|
|
101
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.SelectControl, {
|
|
102
|
+
__next40pxDefaultSize: true,
|
|
103
|
+
__nextHasNoMarginBottom: true,
|
|
104
|
+
label: (0, _i18n.__)('Link to'),
|
|
105
|
+
value: textLinkHref,
|
|
106
|
+
options: linkDestinationOptions,
|
|
107
|
+
onChange: changeLinkDestinationOption
|
|
108
|
+
})
|
|
109
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
|
|
80
110
|
label: (0, _i18n.__)('Open in new tab'),
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
111
|
+
isShownByDefault: true,
|
|
112
|
+
hasValue: () => !!openInNewWindow,
|
|
113
|
+
onDeselect: () => changeOpenInNewWindow(false),
|
|
114
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToggleControl, {
|
|
115
|
+
__nextHasNoMarginBottom: true,
|
|
116
|
+
label: (0, _i18n.__)('Open in new tab'),
|
|
117
|
+
checked: openInNewWindow,
|
|
118
|
+
onChange: changeOpenInNewWindow
|
|
119
|
+
})
|
|
120
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
|
|
85
121
|
label: (0, _i18n.__)('Show download button'),
|
|
86
|
-
|
|
87
|
-
|
|
122
|
+
isShownByDefault: true,
|
|
123
|
+
hasValue: () => !showDownloadButton,
|
|
124
|
+
onDeselect: () => changeShowDownloadButton(true),
|
|
125
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToggleControl, {
|
|
126
|
+
__nextHasNoMarginBottom: true,
|
|
127
|
+
label: (0, _i18n.__)('Show download button'),
|
|
128
|
+
checked: showDownloadButton,
|
|
129
|
+
onChange: changeShowDownloadButton
|
|
130
|
+
})
|
|
88
131
|
})]
|
|
89
132
|
})]
|
|
90
133
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_components","_blockEditor","_edit","_jsxRuntime","FileBlockInspector","hrefs","openInNewWindow","showDownloadButton","changeLinkDestinationOption","changeOpenInNewWindow","changeShowDownloadButton","displayPreview","changeDisplayPreview","previewHeight","changePreviewHeight","href","textLinkHref","attachmentPage","linkDestinationOptions","value","label","__","jsx","Fragment","children","jsxs","InspectorControls","endsWith","
|
|
1
|
+
{"version":3,"names":["_i18n","require","_components","_blockEditor","_edit","_hooks","_jsxRuntime","FileBlockInspector","hrefs","openInNewWindow","showDownloadButton","changeLinkDestinationOption","changeOpenInNewWindow","changeShowDownloadButton","displayPreview","changeDisplayPreview","previewHeight","changePreviewHeight","href","textLinkHref","attachmentPage","dropdownMenuProps","useToolsPanelDropdownMenuProps","linkDestinationOptions","value","label","__","jsx","Fragment","children","jsxs","InspectorControls","endsWith","__experimentalToolsPanel","resetAll","__experimentalToolsPanelItem","isShownByDefault","hasValue","onDeselect","ToggleControl","__nextHasNoMarginBottom","help","checked","onChange","RangeControl","__next40pxDefaultSize","min","MIN_PREVIEW_HEIGHT","max","Math","MAX_PREVIEW_HEIGHT","SelectControl","options"],"sources":["@wordpress/block-library/src/file/inspector.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tRangeControl,\n\tSelectControl,\n\tToggleControl,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { InspectorControls } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { MIN_PREVIEW_HEIGHT, MAX_PREVIEW_HEIGHT } from './edit';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\nexport default function FileBlockInspector( {\n\threfs,\n\topenInNewWindow,\n\tshowDownloadButton,\n\tchangeLinkDestinationOption,\n\tchangeOpenInNewWindow,\n\tchangeShowDownloadButton,\n\tdisplayPreview,\n\tchangeDisplayPreview,\n\tpreviewHeight,\n\tchangePreviewHeight,\n} ) {\n\tconst { href, textLinkHref, attachmentPage } = hrefs;\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tlet linkDestinationOptions = [ { value: href, label: __( 'URL' ) } ];\n\tif ( attachmentPage ) {\n\t\tlinkDestinationOptions = [\n\t\t\t{ value: href, label: __( 'Media file' ) },\n\t\t\t{ value: attachmentPage, label: __( 'Attachment page' ) },\n\t\t];\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t{ href.endsWith( '.pdf' ) && (\n\t\t\t\t\t<ToolsPanel\n\t\t\t\t\t\tlabel={ __( 'PDF settings' ) }\n\t\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\t\tchangeDisplayPreview( true );\n\t\t\t\t\t\t\tchangePreviewHeight( 600 );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\tlabel={ __( 'Show inline embed' ) }\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\thasValue={ () => ! displayPreview }\n\t\t\t\t\t\t\tonDeselect={ () => changeDisplayPreview( true ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Show inline embed' ) }\n\t\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\t\tdisplayPreview\n\t\t\t\t\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t\t\t\t\t\"Note: Most phone and tablet browsers won't display embedded PDFs.\"\n\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t: null\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tchecked={ !! displayPreview }\n\t\t\t\t\t\t\t\tonChange={ changeDisplayPreview }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t{ displayPreview && (\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\tlabel={ __( 'Height in pixels' ) }\n\t\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\t\thasValue={ () => previewHeight !== 600 }\n\t\t\t\t\t\t\t\tonDeselect={ () => changePreviewHeight( 600 ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Height in pixels' ) }\n\t\t\t\t\t\t\t\t\tmin={ MIN_PREVIEW_HEIGHT }\n\t\t\t\t\t\t\t\t\tmax={ Math.max(\n\t\t\t\t\t\t\t\t\t\tMAX_PREVIEW_HEIGHT,\n\t\t\t\t\t\t\t\t\t\tpreviewHeight\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tvalue={ previewHeight }\n\t\t\t\t\t\t\t\t\tonChange={ changePreviewHeight }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</ToolsPanel>\n\t\t\t\t) }\n\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\tchangeLinkDestinationOption( href );\n\t\t\t\t\t\tchangeOpenInNewWindow( false );\n\t\t\t\t\t\tchangeShowDownloadButton( true );\n\t\t\t\t\t} }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Link to' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => textLinkHref !== href }\n\t\t\t\t\t\tonDeselect={ () => changeLinkDestinationOption( href ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Link to' ) }\n\t\t\t\t\t\t\tvalue={ textLinkHref }\n\t\t\t\t\t\t\toptions={ linkDestinationOptions }\n\t\t\t\t\t\t\tonChange={ changeLinkDestinationOption }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Open in new tab' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => !! openInNewWindow }\n\t\t\t\t\t\tonDeselect={ () => changeOpenInNewWindow( false ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Open in new tab' ) }\n\t\t\t\t\t\t\tchecked={ openInNewWindow }\n\t\t\t\t\t\t\tonChange={ changeOpenInNewWindow }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Show download button' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => ! showDownloadButton }\n\t\t\t\t\t\tonDeselect={ () => changeShowDownloadButton( true ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Show download button' ) }\n\t\t\t\t\t\t\tchecked={ showDownloadButton }\n\t\t\t\t\t\t\tonChange={ changeShowDownloadButton }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t</ToolsPanel>\n\t\t\t</InspectorControls>\n\t\t</>\n\t);\n}\n"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B,GAAA,EAACzB,WAAA,CAAAqC,aAAa;YACbC,uBAAuB;YACvBf,KAAK,EAAG,IAAAC,QAAE,EAAE,iBAAkB,CAAG;YACjCgB,OAAO,EAAGjC,eAAiB;YAC3BkC,QAAQ,EAAG/B;UAAuB,CAClC;QAAC,CACa,CAAC,eACjB,IAAAN,WAAA,CAAAqB,GAAA,EAACzB,WAAA,CAAAiC,4BAAc;UACdV,KAAK,EAAG,IAAAC,QAAE,EAAE,sBAAuB,CAAG;UACtCU,gBAAgB;UAChBC,QAAQ,EAAGA,CAAA,KAAM,CAAE3B,kBAAoB;UACvC4B,UAAU,EAAGA,CAAA,KAAMzB,wBAAwB,CAAE,IAAK,CAAG;UAAAgB,QAAA,eAErD,IAAAvB,WAAA,CAAAqB,GAAA,EAACzB,WAAA,CAAAqC,aAAa;YACbC,uBAAuB;YACvBf,KAAK,EAAG,IAAAC,QAAE,EAAE,sBAAuB,CAAG;YACtCgB,OAAO,EAAGhC,kBAAoB;YAC9BiC,QAAQ,EAAG9B;UAA0B,CACrC;QAAC,CACa,CAAC;MAAA,CACN,CAAC;IAAA,CACK;EAAC,CACnB,CAAC;AAEL","ignoreList":[]}
|
package/build/form/edit.js
CHANGED
|
@@ -8,6 +8,7 @@ var _i18n = require("@wordpress/i18n");
|
|
|
8
8
|
var _blockEditor = require("@wordpress/block-editor");
|
|
9
9
|
var _components = require("@wordpress/components");
|
|
10
10
|
var _data = require("@wordpress/data");
|
|
11
|
+
var _hooks = require("../utils/hooks");
|
|
11
12
|
var _utils = require("./utils.js");
|
|
12
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
14
|
/**
|
|
@@ -36,6 +37,15 @@ const Edit = ({
|
|
|
36
37
|
setAttributes,
|
|
37
38
|
clientId
|
|
38
39
|
}) => {
|
|
40
|
+
const dropdownMenuProps = (0, _hooks.useToolsPanelDropdownMenuProps)();
|
|
41
|
+
const resetAllSettings = () => {
|
|
42
|
+
setAttributes({
|
|
43
|
+
submissionMethod: 'email',
|
|
44
|
+
email: undefined,
|
|
45
|
+
action: undefined,
|
|
46
|
+
method: 'post'
|
|
47
|
+
});
|
|
48
|
+
};
|
|
39
49
|
const {
|
|
40
50
|
action,
|
|
41
51
|
method,
|
|
@@ -60,46 +70,66 @@ const Edit = ({
|
|
|
60
70
|
});
|
|
61
71
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
62
72
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.InspectorControls, {
|
|
63
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
73
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalToolsPanel, {
|
|
74
|
+
dropdownMenuProps: dropdownMenuProps,
|
|
75
|
+
label: (0, _i18n.__)('Settings'),
|
|
76
|
+
resetAll: resetAllSettings,
|
|
77
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
|
|
78
|
+
hasValue: () => submissionMethod !== 'email',
|
|
68
79
|
label: (0, _i18n.__)('Submissions method'),
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
{
|
|
72
|
-
label: (0, _i18n.__)('Send email'),
|
|
73
|
-
value: 'email'
|
|
74
|
-
}, {
|
|
75
|
-
label: (0, _i18n.__)('- Custom -'),
|
|
76
|
-
value: 'custom'
|
|
77
|
-
}],
|
|
78
|
-
value: submissionMethod,
|
|
79
|
-
onChange: value => setAttributes({
|
|
80
|
-
submissionMethod: value
|
|
80
|
+
onDeselect: () => setAttributes({
|
|
81
|
+
submissionMethod: 'email'
|
|
81
82
|
}),
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
83
|
+
isShownByDefault: true,
|
|
84
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.SelectControl, {
|
|
85
|
+
__nextHasNoMarginBottom: true,
|
|
86
|
+
__next40pxDefaultSize: true,
|
|
87
|
+
label: (0, _i18n.__)('Submissions method'),
|
|
88
|
+
options: [
|
|
89
|
+
// TODO: Allow plugins to add their own submission methods.
|
|
90
|
+
{
|
|
91
|
+
label: (0, _i18n.__)('Send email'),
|
|
92
|
+
value: 'email'
|
|
93
|
+
}, {
|
|
94
|
+
label: (0, _i18n.__)('- Custom -'),
|
|
95
|
+
value: 'custom'
|
|
96
|
+
}],
|
|
97
|
+
value: submissionMethod,
|
|
98
|
+
onChange: value => setAttributes({
|
|
99
|
+
submissionMethod: value
|
|
100
|
+
}),
|
|
101
|
+
help: submissionMethod === 'custom' ? (0, _i18n.__)('Select the method to use for form submissions. Additional options for the "custom" mode can be found in the "Advanced" section.') : (0, _i18n.__)('Select the method to use for form submissions.')
|
|
102
|
+
})
|
|
103
|
+
}), submissionMethod === 'email' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
|
|
104
|
+
hasValue: () => !!email,
|
|
87
105
|
label: (0, _i18n.__)('Email for form submissions'),
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
106
|
+
onDeselect: () => setAttributes({
|
|
107
|
+
email: undefined,
|
|
108
|
+
action: undefined,
|
|
109
|
+
method: 'post'
|
|
110
|
+
}),
|
|
111
|
+
isShownByDefault: true,
|
|
112
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.TextControl, {
|
|
113
|
+
__nextHasNoMarginBottom: true,
|
|
114
|
+
__next40pxDefaultSize: true,
|
|
115
|
+
autoComplete: "off",
|
|
116
|
+
label: (0, _i18n.__)('Email for form submissions'),
|
|
117
|
+
value: email || '',
|
|
118
|
+
required: true,
|
|
119
|
+
onChange: value => {
|
|
120
|
+
setAttributes({
|
|
121
|
+
email: value
|
|
122
|
+
});
|
|
123
|
+
setAttributes({
|
|
124
|
+
action: `mailto:${value}`
|
|
125
|
+
});
|
|
126
|
+
setAttributes({
|
|
127
|
+
method: 'post'
|
|
128
|
+
});
|
|
129
|
+
},
|
|
130
|
+
help: (0, _i18n.__)('The email address where form submissions will be sent. Separate multiple email addresses with a comma.'),
|
|
131
|
+
type: "email"
|
|
132
|
+
})
|
|
103
133
|
})]
|
|
104
134
|
})
|
|
105
135
|
}), submissionMethod !== 'email' && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_blockEditor.InspectorControls, {
|