@wordpress/block-library 6.0.5 → 6.0.9
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/build/archives/edit.js +5 -4
- package/build/archives/edit.js.map +1 -1
- package/build/audio/deprecated.js +4 -3
- package/build/audio/deprecated.js.map +1 -1
- package/build/audio/edit.js +15 -13
- package/build/audio/edit.js.map +1 -1
- package/build/audio/edit.native.js +26 -22
- package/build/audio/edit.native.js.map +1 -1
- package/build/audio/save.js +4 -3
- package/build/audio/save.js.map +1 -1
- package/build/audio/transforms.js +29 -25
- package/build/audio/transforms.js.map +1 -1
- package/build/block/edit-title.native.js +5 -4
- package/build/block/edit-title.native.js.map +1 -1
- package/build/block/edit.js +7 -6
- package/build/block/edit.js.map +1 -1
- package/build/block/edit.native.js +8 -7
- package/build/block/edit.native.js.map +1 -1
- package/build/button/color-background.native.js +6 -5
- package/build/button/color-background.native.js.map +1 -1
- package/build/button/deprecated.js +52 -40
- package/build/button/deprecated.js.map +1 -1
- package/build/button/edit.js +11 -8
- package/build/button/edit.js.map +1 -1
- package/build/button/edit.native.js +16 -11
- package/build/button/edit.native.js.map +1 -1
- package/build/button/index.js +8 -5
- package/build/button/index.js.map +1 -1
- package/build/button/save.js +5 -4
- package/build/button/save.js.map +1 -1
- package/build/buttons/deprecated.js +18 -13
- package/build/buttons/deprecated.js.map +1 -1
- package/build/buttons/edit.js +6 -5
- package/build/buttons/edit.js.map +1 -1
- package/build/buttons/edit.native.js +11 -10
- package/build/buttons/edit.native.js.map +1 -1
- package/build/calendar/edit.js +4 -3
- package/build/calendar/edit.js.map +1 -1
- package/build/categories/edit.js +16 -12
- package/build/categories/edit.js.map +1 -1
- package/build/code/edit.js +6 -5
- package/build/code/edit.js.map +1 -1
- package/build/code/save.js +4 -3
- package/build/code/save.js.map +1 -1
- package/build/code/transforms.js +4 -3
- package/build/code/transforms.js.map +1 -1
- package/build/column/column-preview.native.js +11 -9
- package/build/column/column-preview.native.js.map +1 -1
- package/build/column/deprecated.js +8 -6
- package/build/column/deprecated.js.map +1 -1
- package/build/column/edit.js +11 -10
- package/build/column/edit.js.map +1 -1
- package/build/column/edit.native.js +20 -17
- package/build/column/edit.native.js.map +1 -1
- package/build/column/save.js +4 -3
- package/build/column/save.js.map +1 -1
- package/build/columns/columnCalculations.native.js +6 -5
- package/build/columns/columnCalculations.native.js.map +1 -1
- package/build/columns/deprecated.js +12 -9
- package/build/columns/deprecated.js.map +1 -1
- package/build/columns/edit.js +17 -13
- package/build/columns/edit.js.map +1 -1
- package/build/columns/edit.native.js +12 -11
- package/build/columns/edit.native.js.map +1 -1
- package/build/columns/save.js +4 -3
- package/build/columns/save.js.map +1 -1
- package/build/columns/transforms.js +17 -11
- package/build/columns/transforms.js.map +1 -1
- package/build/columns/utils.js +13 -9
- package/build/columns/utils.js.map +1 -1
- package/build/comment-author-avatar/edit.js +8 -7
- package/build/comment-author-avatar/edit.js.map +1 -1
- package/build/comment-author-name/deprecated.js +4 -3
- package/build/comment-author-name/deprecated.js.map +1 -1
- package/build/comment-author-name/edit.js +12 -11
- package/build/comment-author-name/edit.js.map +1 -1
- package/build/comment-content/edit.js +10 -9
- package/build/comment-content/edit.js.map +1 -1
- package/build/comment-date/deprecated.js +4 -3
- package/build/comment-date/deprecated.js.map +1 -1
- package/build/comment-date/edit.js +19 -15
- package/build/comment-date/edit.js.map +1 -1
- package/build/comment-edit-link/edit.js +8 -7
- package/build/comment-edit-link/edit.js.map +1 -1
- package/build/comment-reply-link/edit.js +7 -6
- package/build/comment-reply-link/edit.js.map +1 -1
- package/build/comment-template/edit.js +8 -7
- package/build/comment-template/edit.js.map +1 -1
- package/build/comments-query-loop/edit.js +5 -4
- package/build/comments-query-loop/edit.js.map +1 -1
- package/build/comments-query-loop/save.js +6 -5
- package/build/comments-query-loop/save.js.map +1 -1
- package/build/comments-query-loop/toolbar.js +15 -11
- package/build/comments-query-loop/toolbar.js.map +1 -1
- package/build/cover/controls.native.js +20 -17
- package/build/cover/controls.native.js.map +1 -1
- package/build/cover/deprecated.js +28 -21
- package/build/cover/deprecated.js.map +1 -1
- package/build/cover/edit.js +45 -37
- package/build/cover/edit.js.map +1 -1
- package/build/cover/edit.native.js +67 -56
- package/build/cover/edit.native.js.map +1 -1
- package/build/cover/focal-point-settings-button.native.js +7 -6
- package/build/cover/focal-point-settings-button.native.js.map +1 -1
- package/build/cover/overlay-color-settings.native.js +8 -7
- package/build/cover/overlay-color-settings.native.js.map +1 -1
- package/build/cover/save.js +4 -3
- package/build/cover/save.js.map +1 -1
- package/build/cover/shared.js +3 -3
- package/build/cover/transforms.js +92 -75
- package/build/cover/transforms.js.map +1 -1
- package/build/embed/deprecated.js +10 -8
- package/build/embed/deprecated.js.map +1 -1
- package/build/embed/edit.native.js +2 -1
- package/build/embed/edit.native.js.map +1 -1
- package/build/embed/embed-bottom-sheet.native.js +8 -7
- package/build/embed/embed-bottom-sheet.native.js.map +1 -1
- package/build/embed/embed-controls.js +24 -21
- package/build/embed/embed-controls.js.map +1 -1
- package/build/embed/embed-no-preview.native.js +9 -8
- package/build/embed/embed-no-preview.native.js.map +1 -1
- package/build/embed/embed-placeholder.js +11 -10
- package/build/embed/embed-placeholder.js.map +1 -1
- package/build/embed/embed-placeholder.native.js +10 -9
- package/build/embed/embed-placeholder.native.js.map +1 -1
- package/build/embed/embed-preview.native.js +17 -16
- package/build/embed/embed-preview.native.js.map +1 -1
- package/build/embed/icons.js +1 -1
- package/build/embed/save.js +4 -3
- package/build/embed/save.js.map +1 -1
- package/build/embed/transforms.js +11 -7
- package/build/embed/transforms.js.map +1 -1
- package/build/embed/util.js +38 -18
- package/build/embed/util.js.map +1 -1
- package/build/embed/wp-embed-preview.js +18 -14
- package/build/embed/wp-embed-preview.js.map +1 -1
- package/build/embed/wp-embed-preview.native.js +5 -4
- package/build/embed/wp-embed-preview.native.js.map +1 -1
- package/build/file/deprecated.js +4 -3
- package/build/file/deprecated.js.map +1 -1
- package/build/file/edit.js +19 -14
- package/build/file/edit.js.map +1 -1
- package/build/file/edit.native.js +25 -20
- package/build/file/edit.native.js.map +1 -1
- package/build/file/inspector.js +13 -12
- package/build/file/inspector.js.map +1 -1
- package/build/file/save.js +4 -3
- package/build/file/save.js.map +1 -1
- package/build/file/transforms.js +15 -9
- package/build/file/transforms.js.map +1 -1
- package/build/freeform/convert-to-blocks-button.js +4 -3
- package/build/freeform/convert-to-blocks-button.js.map +1 -1
- package/build/freeform/edit.js +9 -8
- package/build/freeform/edit.js.map +1 -1
- package/build/freeform/save.js +4 -3
- package/build/freeform/save.js.map +1 -1
- package/build/gallery/constants.js +1 -1
- package/build/gallery/deprecated.js +39 -29
- package/build/gallery/deprecated.js.map +1 -1
- package/build/gallery/gallery.js +13 -11
- package/build/gallery/gallery.js.map +1 -1
- package/build/gallery/save.js +5 -3
- package/build/gallery/save.js.map +1 -1
- package/build/gallery/shared-icon.native.js +4 -3
- package/build/gallery/shared-icon.native.js.map +1 -1
- package/build/gallery/shared.js +2 -1
- package/build/gallery/shared.js.map +1 -1
- package/build/gallery/transforms.js +121 -92
- package/build/gallery/transforms.js.map +1 -1
- package/build/gallery/use-image-sizes.js +15 -9
- package/build/gallery/use-image-sizes.js.map +1 -1
- package/build/gallery/v1/constants.js +1 -1
- package/build/gallery/v1/edit.js +38 -20
- package/build/gallery/v1/edit.js.map +1 -1
- package/build/gallery/v1/gallery.js +5 -4
- package/build/gallery/v1/gallery.js.map +1 -1
- package/build/gallery/v1/save.js +4 -3
- package/build/gallery/v1/save.js.map +1 -1
- package/build/gallery/v1/shared.js +2 -1
- package/build/gallery/v1/shared.js.map +1 -1
- package/build/gallery/v1/update-gallery-modal.js +47 -43
- package/build/gallery/v1/update-gallery-modal.js.map +1 -1
- package/build/group/deprecated.js +16 -12
- package/build/group/deprecated.js.map +1 -1
- package/build/group/edit.js +6 -5
- package/build/group/edit.js.map +1 -1
- package/build/group/edit.native.js +14 -12
- package/build/group/edit.native.js.map +1 -1
- package/build/group/save.js +6 -5
- package/build/group/save.js.map +1 -1
- package/build/heading/deprecated.js +22 -15
- package/build/heading/deprecated.js.map +1 -1
- package/build/heading/edit.js +9 -8
- package/build/heading/edit.js.map +1 -1
- package/build/heading/heading-level-dropdown.js +5 -4
- package/build/heading/heading-level-dropdown.js.map +1 -1
- package/build/heading/heading-level-dropdown.native.js +6 -4
- package/build/heading/heading-level-dropdown.native.js.map +1 -1
- package/build/heading/heading-level-icon.js +5 -4
- package/build/heading/heading-level-icon.js.map +1 -1
- package/build/heading/index.js +5 -3
- package/build/heading/index.js.map +1 -1
- package/build/heading/save.js +4 -3
- package/build/heading/save.js.map +1 -1
- package/build/heading/transforms.js +25 -18
- package/build/heading/transforms.js.map +1 -1
- package/build/home-link/edit.js +7 -6
- package/build/home-link/edit.js.map +1 -1
- package/build/html/edit.js +6 -5
- package/build/html/edit.js.map +1 -1
- package/build/html/save.js +4 -3
- package/build/html/save.js.map +1 -1
- package/build/html/transforms.js +4 -3
- package/build/html/transforms.js.map +1 -1
- package/build/image/constants.js +1 -1
- package/build/image/deprecated.js +12 -9
- package/build/image/deprecated.js.map +1 -1
- package/build/image/edit.js +16 -14
- package/build/image/edit.js.map +1 -1
- package/build/image/edit.native.js +43 -32
- package/build/image/edit.native.js.map +1 -1
- package/build/image/image.js +47 -39
- package/build/image/image.js.map +1 -1
- package/build/image/index.js +5 -3
- package/build/image/index.js.map +1 -1
- package/build/image/save.js +4 -3
- package/build/image/save.js.map +1 -1
- package/build/image/transforms.js +47 -37
- package/build/image/transforms.js.map +1 -1
- package/build/image/utils.js +6 -5
- package/build/image/utils.js.map +1 -1
- package/build/index.js +13 -9
- package/build/index.js.map +1 -1
- package/build/index.native.js +5 -3
- package/build/index.native.js.map +1 -1
- package/build/latest-comments/edit.js +5 -4
- package/build/latest-comments/edit.js.map +1 -1
- package/build/latest-posts/constants.js +1 -1
- package/build/latest-posts/deprecated.js +6 -3
- package/build/latest-posts/deprecated.js.map +1 -1
- package/build/latest-posts/edit.js +20 -13
- package/build/latest-posts/edit.js.map +1 -1
- package/build/latest-posts/edit.native.js +4 -3
- package/build/latest-posts/edit.native.js.map +1 -1
- package/build/list/deprecated.js +8 -6
- package/build/list/deprecated.js.map +1 -1
- package/build/list/edit.js +100 -96
- package/build/list/edit.js.map +1 -1
- package/build/list/ordered-list-settings.js +32 -29
- package/build/list/ordered-list-settings.js.map +1 -1
- package/build/list/save.js +4 -3
- package/build/list/save.js.map +1 -1
- package/build/list/transforms.js +51 -40
- package/build/list/transforms.js.map +1 -1
- package/build/loginout/edit.js +5 -4
- package/build/loginout/edit.js.map +1 -1
- package/build/media-text/deprecated.js +12 -9
- package/build/media-text/deprecated.js.map +1 -1
- package/build/media-text/edit.js +29 -21
- package/build/media-text/edit.js.map +1 -1
- package/build/media-text/edit.native.js +8 -6
- package/build/media-text/edit.native.js.map +1 -1
- package/build/media-text/media-container.js +22 -18
- package/build/media-text/media-container.js.map +1 -1
- package/build/media-text/media-container.native.js +6 -5
- package/build/media-text/media-container.native.js.map +1 -1
- package/build/media-text/save.js +4 -3
- package/build/media-text/save.js.map +1 -1
- package/build/media-text/transforms.js +51 -41
- package/build/media-text/transforms.js.map +1 -1
- package/build/missing/edit.js +10 -8
- package/build/missing/edit.js.map +1 -1
- package/build/missing/edit.native.js +4 -3
- package/build/missing/edit.native.js.map +1 -1
- package/build/missing/index.js +5 -3
- package/build/missing/index.js.map +1 -1
- package/build/missing/save.js +4 -3
- package/build/missing/save.js.map +1 -1
- package/build/more/edit.js +15 -11
- package/build/more/edit.js.map +1 -1
- package/build/more/index.js +5 -3
- package/build/more/index.js.map +1 -1
- package/build/more/save.js +7 -6
- package/build/more/save.js.map +1 -1
- package/build/navigation/deprecated.js +11 -7
- package/build/navigation/deprecated.js.map +1 -1
- package/build/navigation/edit/index.js +83 -52
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/inner-blocks.js +14 -10
- package/build/navigation/edit/inner-blocks.js.map +1 -1
- package/build/navigation/edit/navigation-menu-delete-control.js +4 -3
- package/build/navigation/edit/navigation-menu-delete-control.js.map +1 -1
- package/build/navigation/edit/navigation-menu-name-modal.js +8 -7
- package/build/navigation/edit/navigation-menu-name-modal.js.map +1 -1
- package/build/navigation/edit/navigation-menu-selector.js +21 -11
- package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build/navigation/edit/placeholder/index.js +56 -46
- package/build/navigation/edit/placeholder/index.js.map +1 -1
- package/build/navigation/edit/placeholder/placeholder-preview.js +4 -3
- package/build/navigation/edit/placeholder/placeholder-preview.js.map +1 -1
- package/build/navigation/edit/responsive-wrapper.js +14 -9
- package/build/navigation/edit/responsive-wrapper.js.map +1 -1
- package/build/navigation/edit/unsaved-inner-blocks.js +9 -8
- package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build/navigation/edit/use-list-view-modal.js +5 -4
- package/build/navigation/edit/use-list-view-modal.js.map +1 -1
- package/build/navigation/menu-items-to-blocks.js +19 -15
- package/build/navigation/menu-items-to-blocks.js.map +1 -1
- package/build/navigation/save.js +5 -3
- package/build/navigation/save.js.map +1 -1
- package/build/navigation-area/edit.js +35 -23
- package/build/navigation-area/edit.js.map +1 -1
- package/build/navigation-area/inner-blocks.js +4 -3
- package/build/navigation-area/inner-blocks.js.map +1 -1
- package/build/navigation-link/edit.js +21 -16
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-link/index.js +15 -10
- package/build/navigation-link/index.js.map +1 -1
- package/build/navigation-submenu/edit.js +14 -10
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/navigation-submenu/index.js +6 -3
- package/build/navigation-submenu/index.js.map +1 -1
- package/build/nextpage/edit.native.js +7 -6
- package/build/nextpage/edit.native.js.map +1 -1
- package/build/page-list/convert-to-links-modal.js +71 -66
- package/build/page-list/convert-to-links-modal.js.map +1 -1
- package/build/page-list/edit.js +56 -55
- package/build/page-list/edit.js.map +1 -1
- package/build/paragraph/deprecated.js +20 -15
- package/build/paragraph/deprecated.js.map +1 -1
- package/build/paragraph/edit.js +14 -12
- package/build/paragraph/edit.js.map +1 -1
- package/build/paragraph/edit.native.js +9 -8
- package/build/paragraph/edit.native.js.map +1 -1
- package/build/paragraph/index.js +5 -3
- package/build/paragraph/index.js.map +1 -1
- package/build/paragraph/save.js +4 -3
- package/build/paragraph/save.js.map +1 -1
- package/build/paragraph/transforms.js +12 -9
- package/build/paragraph/transforms.js.map +1 -1
- package/build/pattern/edit.js +5 -4
- package/build/pattern/edit.js.map +1 -1
- package/build/post-author/edit.js +16 -14
- package/build/post-author/edit.js.map +1 -1
- package/build/post-comment/edit.js +7 -6
- package/build/post-comment/edit.js.map +1 -1
- package/build/post-comments/edit.js +10 -8
- package/build/post-comments/edit.js.map +1 -1
- package/build/post-comments-count/edit.js +6 -5
- package/build/post-comments-count/edit.js.map +1 -1
- package/build/post-comments-form/edit.js +6 -5
- package/build/post-comments-form/edit.js.map +1 -1
- package/build/post-comments-link/edit.js +6 -5
- package/build/post-comments-link/edit.js.map +1 -1
- package/build/post-content/edit.js +16 -13
- package/build/post-content/edit.js.map +1 -1
- package/build/post-date/deprecated.js +4 -3
- package/build/post-date/deprecated.js.map +1 -1
- package/build/post-date/edit.js +28 -22
- package/build/post-date/edit.js.map +1 -1
- package/build/post-excerpt/edit.js +15 -14
- package/build/post-excerpt/edit.js.map +1 -1
- package/build/post-featured-image/dimension-controls.js +9 -8
- package/build/post-featured-image/dimension-controls.js.map +1 -1
- package/build/post-featured-image/edit.js +64 -32
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/post-navigation-link/edit.js +11 -10
- package/build/post-navigation-link/edit.js.map +1 -1
- package/build/post-template/edit.js +28 -27
- package/build/post-template/edit.js.map +1 -1
- package/build/post-terms/edit.js +6 -5
- package/build/post-terms/edit.js.map +1 -1
- package/build/post-terms/use-post-terms.js +6 -5
- package/build/post-terms/use-post-terms.js.map +1 -1
- package/build/post-title/deprecated.js +4 -3
- package/build/post-title/deprecated.js.map +1 -1
- package/build/post-title/edit.js +16 -15
- package/build/post-title/edit.js.map +1 -1
- package/build/preformatted/edit.js +8 -7
- package/build/preformatted/edit.js.map +1 -1
- package/build/preformatted/save.js +4 -3
- package/build/preformatted/save.js.map +1 -1
- package/build/preformatted/transforms.js +20 -14
- package/build/preformatted/transforms.js.map +1 -1
- package/build/pullquote/deprecated.js +45 -37
- package/build/pullquote/deprecated.js.map +1 -1
- package/build/pullquote/edit.js +7 -6
- package/build/pullquote/edit.js.map +1 -1
- package/build/pullquote/edit.native.js +12 -10
- package/build/pullquote/edit.native.js.map +1 -1
- package/build/pullquote/figure.native.js +6 -5
- package/build/pullquote/figure.native.js.map +1 -1
- package/build/pullquote/save.js +4 -3
- package/build/pullquote/save.js.map +1 -1
- package/build/pullquote/transforms.js +25 -18
- package/build/pullquote/transforms.js.map +1 -1
- package/build/query/constants.js +1 -1
- package/build/query/edit/index.js +5 -4
- package/build/query/edit/index.js.map +1 -1
- package/build/query/edit/query-inspector-controls.js +9 -8
- package/build/query/edit/query-inspector-controls.js.map +1 -1
- package/build/query/edit/query-placeholder.js +10 -7
- package/build/query/edit/query-placeholder.js.map +1 -1
- package/build/query/edit/query-toolbar.js +19 -15
- package/build/query/edit/query-toolbar.js.map +1 -1
- package/build/query/hooks.js +7 -6
- package/build/query/hooks.js.map +1 -1
- package/build/query/icons.js +1 -1
- package/build/query/save.js +7 -5
- package/build/query/save.js.map +1 -1
- package/build/query/utils.js +18 -12
- package/build/query/utils.js.map +1 -1
- package/build/query-pagination/edit.js +10 -9
- package/build/query-pagination/edit.js.map +1 -1
- package/build/query-pagination/query-pagination-arrow-controls.js +5 -4
- package/build/query-pagination/query-pagination-arrow-controls.js.map +1 -1
- package/build/query-pagination-next/edit.js +10 -9
- package/build/query-pagination-next/edit.js.map +1 -1
- package/build/query-pagination-numbers/edit.js +7 -3
- package/build/query-pagination-numbers/edit.js.map +1 -1
- package/build/query-pagination-previous/edit.js +10 -9
- package/build/query-pagination-previous/edit.js.map +1 -1
- package/build/query-title/deprecated.js +4 -3
- package/build/query-title/deprecated.js.map +1 -1
- package/build/query-title/edit.js +9 -8
- package/build/query-title/edit.js.map +1 -1
- package/build/quote/deprecated.js +12 -9
- package/build/quote/deprecated.js.map +1 -1
- package/build/quote/edit.js +11 -10
- package/build/quote/edit.js.map +1 -1
- package/build/quote/index.js +6 -4
- package/build/quote/index.js.map +1 -1
- package/build/quote/save.js +4 -3
- package/build/quote/save.js.map +1 -1
- package/build/quote/transforms.js +58 -44
- package/build/quote/transforms.js.map +1 -1
- package/build/rss/edit.js +5 -4
- package/build/rss/edit.js.map +1 -1
- package/build/search/edit.js +9 -8
- package/build/search/edit.js.map +1 -1
- package/build/search/edit.native.js +14 -12
- package/build/search/edit.native.js.map +1 -1
- package/build/search/icons.js +1 -1
- package/build/search/utils.js +1 -1
- package/build/separator/edit.js +6 -5
- package/build/separator/edit.js.map +1 -1
- package/build/separator/save.js +4 -3
- package/build/separator/save.js.map +1 -1
- package/build/separator/separator-settings.js +15 -12
- package/build/separator/separator-settings.js.map +1 -1
- package/build/shortcode/edit.js +5 -4
- package/build/shortcode/edit.js.map +1 -1
- package/build/shortcode/save.js +4 -3
- package/build/shortcode/save.js.map +1 -1
- package/build/shortcode/transforms.js +4 -3
- package/build/shortcode/transforms.js.map +1 -1
- package/build/site-logo/edit.js +29 -26
- package/build/site-logo/edit.js.map +1 -1
- package/build/site-tagline/deprecated.js +4 -3
- package/build/site-tagline/deprecated.js.map +1 -1
- package/build/site-tagline/edit.js +5 -4
- package/build/site-tagline/edit.js.map +1 -1
- package/build/site-title/deprecated.js +4 -3
- package/build/site-title/deprecated.js.map +1 -1
- package/build/site-title/edit/index.js +6 -5
- package/build/site-title/edit/index.js.map +1 -1
- package/build/site-title/edit/level-icon.js +5 -4
- package/build/site-title/edit/level-icon.js.map +1 -1
- package/build/site-title/edit/level-toolbar.js +5 -4
- package/build/site-title/edit/level-toolbar.js.map +1 -1
- package/build/social-link/edit.js +38 -34
- package/build/social-link/edit.js.map +1 -1
- package/build/social-link/edit.native.js +12 -10
- package/build/social-link/edit.native.js.map +1 -1
- package/build/social-links/deprecated.js +6 -3
- package/build/social-links/deprecated.js.map +1 -1
- package/build/social-links/edit.js +19 -16
- package/build/social-links/edit.js.map +1 -1
- package/build/social-links/edit.native.js +20 -17
- package/build/social-links/edit.native.js.map +1 -1
- package/build/spacer/edit.js +11 -10
- package/build/spacer/edit.js.map +1 -1
- package/build/spacer/save.js +4 -3
- package/build/spacer/save.js.map +1 -1
- package/build/table/deprecated.js +66 -50
- package/build/table/deprecated.js.map +1 -1
- package/build/table/edit.js +49 -39
- package/build/table/edit.js.map +1 -1
- package/build/table/save.js +36 -29
- package/build/table/save.js.map +1 -1
- package/build/table/state.js +32 -27
- package/build/table/state.js.map +1 -1
- package/build/table/transforms.js +19 -16
- package/build/table/transforms.js.map +1 -1
- package/build/table-of-contents/edit.js +8 -7
- package/build/table-of-contents/edit.js.map +1 -1
- package/build/table-of-contents/list.js +4 -3
- package/build/table-of-contents/list.js.map +1 -1
- package/build/table-of-contents/utils.js +3 -2
- package/build/table-of-contents/utils.js.map +1 -1
- package/build/tag-cloud/edit.js +6 -5
- package/build/tag-cloud/edit.js.map +1 -1
- package/build/template-part/edit/advanced-controls.js +18 -14
- package/build/template-part/edit/advanced-controls.js.map +1 -1
- package/build/template-part/edit/index.js +33 -23
- package/build/template-part/edit/index.js.map +1 -1
- package/build/template-part/edit/inner-blocks.js +9 -8
- package/build/template-part/edit/inner-blocks.js.map +1 -1
- package/build/template-part/edit/placeholder/index.js +36 -27
- package/build/template-part/edit/placeholder/index.js.map +1 -1
- package/build/template-part/edit/placeholder/patterns-setup.js +15 -13
- package/build/template-part/edit/placeholder/patterns-setup.js.map +1 -1
- package/build/template-part/edit/selection/index.js +7 -6
- package/build/template-part/edit/selection/index.js.map +1 -1
- package/build/template-part/edit/selection/template-part-previews.js +49 -41
- package/build/template-part/edit/selection/template-part-previews.js.map +1 -1
- package/build/template-part/index.js +6 -4
- package/build/template-part/index.js.map +1 -1
- package/build/term-description/edit.js +6 -5
- package/build/term-description/edit.js.map +1 -1
- package/build/text-columns/edit.js +5 -4
- package/build/text-columns/edit.js.map +1 -1
- package/build/text-columns/save.js +4 -3
- package/build/text-columns/save.js.map +1 -1
- package/build/text-columns/transforms.js +20 -14
- package/build/text-columns/transforms.js.map +1 -1
- package/build/transformationCategories.native.js +5 -2
- package/build/transformationCategories.native.js.map +1 -1
- package/build/utils/hooks.js +1 -1
- package/build/verse/deprecated.js +12 -9
- package/build/verse/deprecated.js.map +1 -1
- package/build/verse/edit.js +8 -7
- package/build/verse/edit.js.map +1 -1
- package/build/verse/save.js +4 -3
- package/build/verse/save.js.map +1 -1
- package/build/video/edit-common-settings.js +5 -4
- package/build/video/edit-common-settings.js.map +1 -1
- package/build/video/edit.js +26 -21
- package/build/video/edit.js.map +1 -1
- package/build/video/edit.native.js +24 -18
- package/build/video/edit.native.js.map +1 -1
- package/build/video/save.js +4 -3
- package/build/video/save.js.map +1 -1
- package/build/video/tracks-editor.js +55 -41
- package/build/video/tracks-editor.js.map +1 -1
- package/build/video/tracks.js +4 -3
- package/build/video/tracks.js.map +1 -1
- package/build/video/transforms.js +35 -30
- package/build/video/transforms.js.map +1 -1
- package/build-module/archives/edit.js +5 -4
- package/build-module/archives/edit.js.map +1 -1
- package/build-module/audio/deprecated.js +4 -3
- package/build-module/audio/deprecated.js.map +1 -1
- package/build-module/audio/edit.js +15 -13
- package/build-module/audio/edit.js.map +1 -1
- package/build-module/audio/edit.native.js +26 -22
- package/build-module/audio/edit.native.js.map +1 -1
- package/build-module/audio/save.js +4 -3
- package/build-module/audio/save.js.map +1 -1
- package/build-module/audio/transforms.js +29 -25
- package/build-module/audio/transforms.js.map +1 -1
- package/build-module/block/edit-title.native.js +5 -4
- package/build-module/block/edit-title.native.js.map +1 -1
- package/build-module/block/edit.js +7 -6
- package/build-module/block/edit.js.map +1 -1
- package/build-module/block/edit.native.js +8 -7
- package/build-module/block/edit.native.js.map +1 -1
- package/build-module/button/color-background.native.js +6 -5
- package/build-module/button/color-background.native.js.map +1 -1
- package/build-module/button/deprecated.js +52 -40
- package/build-module/button/deprecated.js.map +1 -1
- package/build-module/button/edit.js +11 -8
- package/build-module/button/edit.js.map +1 -1
- package/build-module/button/edit.native.js +16 -11
- package/build-module/button/edit.native.js.map +1 -1
- package/build-module/button/index.js +8 -5
- package/build-module/button/index.js.map +1 -1
- package/build-module/button/save.js +5 -4
- package/build-module/button/save.js.map +1 -1
- package/build-module/buttons/deprecated.js +18 -13
- package/build-module/buttons/deprecated.js.map +1 -1
- package/build-module/buttons/edit.js +6 -5
- package/build-module/buttons/edit.js.map +1 -1
- package/build-module/buttons/edit.native.js +11 -10
- package/build-module/buttons/edit.native.js.map +1 -1
- package/build-module/calendar/edit.js +4 -3
- package/build-module/calendar/edit.js.map +1 -1
- package/build-module/categories/edit.js +16 -12
- package/build-module/categories/edit.js.map +1 -1
- package/build-module/code/edit.js +6 -5
- package/build-module/code/edit.js.map +1 -1
- package/build-module/code/save.js +4 -3
- package/build-module/code/save.js.map +1 -1
- package/build-module/code/transforms.js +4 -3
- package/build-module/code/transforms.js.map +1 -1
- package/build-module/column/column-preview.native.js +11 -9
- package/build-module/column/column-preview.native.js.map +1 -1
- package/build-module/column/deprecated.js +8 -6
- package/build-module/column/deprecated.js.map +1 -1
- package/build-module/column/edit.js +11 -10
- package/build-module/column/edit.js.map +1 -1
- package/build-module/column/edit.native.js +20 -17
- package/build-module/column/edit.native.js.map +1 -1
- package/build-module/column/save.js +4 -3
- package/build-module/column/save.js.map +1 -1
- package/build-module/columns/columnCalculations.native.js +5 -4
- package/build-module/columns/columnCalculations.native.js.map +1 -1
- package/build-module/columns/deprecated.js +12 -9
- package/build-module/columns/deprecated.js.map +1 -1
- package/build-module/columns/edit.js +17 -13
- package/build-module/columns/edit.js.map +1 -1
- package/build-module/columns/edit.native.js +12 -11
- package/build-module/columns/edit.native.js.map +1 -1
- package/build-module/columns/save.js +4 -3
- package/build-module/columns/save.js.map +1 -1
- package/build-module/columns/transforms.js +17 -11
- package/build-module/columns/transforms.js.map +1 -1
- package/build-module/columns/utils.js +8 -4
- package/build-module/columns/utils.js.map +1 -1
- package/build-module/comment-author-avatar/edit.js +8 -7
- package/build-module/comment-author-avatar/edit.js.map +1 -1
- package/build-module/comment-author-name/deprecated.js +4 -3
- package/build-module/comment-author-name/deprecated.js.map +1 -1
- package/build-module/comment-author-name/edit.js +12 -11
- package/build-module/comment-author-name/edit.js.map +1 -1
- package/build-module/comment-content/edit.js +10 -9
- package/build-module/comment-content/edit.js.map +1 -1
- package/build-module/comment-date/deprecated.js +4 -3
- package/build-module/comment-date/deprecated.js.map +1 -1
- package/build-module/comment-date/edit.js +19 -15
- package/build-module/comment-date/edit.js.map +1 -1
- package/build-module/comment-edit-link/edit.js +8 -7
- package/build-module/comment-edit-link/edit.js.map +1 -1
- package/build-module/comment-reply-link/edit.js +7 -6
- package/build-module/comment-reply-link/edit.js.map +1 -1
- package/build-module/comment-template/edit.js +8 -7
- package/build-module/comment-template/edit.js.map +1 -1
- package/build-module/comments-query-loop/edit.js +5 -4
- package/build-module/comments-query-loop/edit.js.map +1 -1
- package/build-module/comments-query-loop/save.js +6 -5
- package/build-module/comments-query-loop/save.js.map +1 -1
- package/build-module/comments-query-loop/toolbar.js +15 -11
- package/build-module/comments-query-loop/toolbar.js.map +1 -1
- package/build-module/cover/controls.native.js +20 -17
- package/build-module/cover/controls.native.js.map +1 -1
- package/build-module/cover/deprecated.js +28 -21
- package/build-module/cover/deprecated.js.map +1 -1
- package/build-module/cover/edit.js +45 -37
- package/build-module/cover/edit.js.map +1 -1
- package/build-module/cover/edit.native.js +67 -56
- package/build-module/cover/edit.native.js.map +1 -1
- package/build-module/cover/focal-point-settings-button.native.js +7 -6
- package/build-module/cover/focal-point-settings-button.native.js.map +1 -1
- package/build-module/cover/overlay-color-settings.native.js +8 -7
- package/build-module/cover/overlay-color-settings.native.js.map +1 -1
- package/build-module/cover/save.js +4 -3
- package/build-module/cover/save.js.map +1 -1
- package/build-module/cover/transforms.js +92 -75
- package/build-module/cover/transforms.js.map +1 -1
- package/build-module/embed/deprecated.js +10 -8
- package/build-module/embed/deprecated.js.map +1 -1
- package/build-module/embed/edit.native.js +2 -1
- package/build-module/embed/edit.native.js.map +1 -1
- package/build-module/embed/embed-bottom-sheet.native.js +8 -7
- package/build-module/embed/embed-bottom-sheet.native.js.map +1 -1
- package/build-module/embed/embed-controls.js +24 -21
- package/build-module/embed/embed-controls.js.map +1 -1
- package/build-module/embed/embed-no-preview.native.js +9 -8
- package/build-module/embed/embed-no-preview.native.js.map +1 -1
- package/build-module/embed/embed-placeholder.js +11 -10
- package/build-module/embed/embed-placeholder.js.map +1 -1
- package/build-module/embed/embed-placeholder.native.js +10 -9
- package/build-module/embed/embed-placeholder.native.js.map +1 -1
- package/build-module/embed/embed-preview.native.js +17 -16
- package/build-module/embed/embed-preview.native.js.map +1 -1
- package/build-module/embed/save.js +4 -3
- package/build-module/embed/save.js.map +1 -1
- package/build-module/embed/transforms.js +11 -7
- package/build-module/embed/transforms.js.map +1 -1
- package/build-module/embed/util.js +34 -16
- package/build-module/embed/util.js.map +1 -1
- package/build-module/embed/wp-embed-preview.js +18 -14
- package/build-module/embed/wp-embed-preview.js.map +1 -1
- package/build-module/embed/wp-embed-preview.native.js +5 -4
- package/build-module/embed/wp-embed-preview.native.js.map +1 -1
- package/build-module/file/deprecated.js +4 -3
- package/build-module/file/deprecated.js.map +1 -1
- package/build-module/file/edit.js +18 -13
- package/build-module/file/edit.js.map +1 -1
- package/build-module/file/edit.native.js +25 -20
- package/build-module/file/edit.native.js.map +1 -1
- package/build-module/file/inspector.js +13 -12
- package/build-module/file/inspector.js.map +1 -1
- package/build-module/file/save.js +4 -3
- package/build-module/file/save.js.map +1 -1
- package/build-module/file/transforms.js +15 -9
- package/build-module/file/transforms.js.map +1 -1
- package/build-module/freeform/convert-to-blocks-button.js +4 -3
- package/build-module/freeform/convert-to-blocks-button.js.map +1 -1
- package/build-module/freeform/edit.js +9 -8
- package/build-module/freeform/edit.js.map +1 -1
- package/build-module/freeform/save.js +4 -3
- package/build-module/freeform/save.js.map +1 -1
- package/build-module/gallery/deprecated.js +38 -28
- package/build-module/gallery/deprecated.js.map +1 -1
- package/build-module/gallery/gallery.js +13 -11
- package/build-module/gallery/gallery.js.map +1 -1
- package/build-module/gallery/save.js +5 -3
- package/build-module/gallery/save.js.map +1 -1
- package/build-module/gallery/shared-icon.native.js +4 -3
- package/build-module/gallery/shared-icon.native.js.map +1 -1
- package/build-module/gallery/shared.js +2 -1
- package/build-module/gallery/shared.js.map +1 -1
- package/build-module/gallery/transforms.js +121 -92
- package/build-module/gallery/transforms.js.map +1 -1
- package/build-module/gallery/use-image-sizes.js +15 -9
- package/build-module/gallery/use-image-sizes.js.map +1 -1
- package/build-module/gallery/v1/edit.js +38 -20
- package/build-module/gallery/v1/edit.js.map +1 -1
- package/build-module/gallery/v1/gallery.js +5 -4
- package/build-module/gallery/v1/gallery.js.map +1 -1
- package/build-module/gallery/v1/save.js +4 -3
- package/build-module/gallery/v1/save.js.map +1 -1
- package/build-module/gallery/v1/shared.js +2 -1
- package/build-module/gallery/v1/shared.js.map +1 -1
- package/build-module/gallery/v1/update-gallery-modal.js +45 -41
- package/build-module/gallery/v1/update-gallery-modal.js.map +1 -1
- package/build-module/group/deprecated.js +16 -12
- package/build-module/group/deprecated.js.map +1 -1
- package/build-module/group/edit.js +6 -5
- package/build-module/group/edit.js.map +1 -1
- package/build-module/group/edit.native.js +14 -12
- package/build-module/group/edit.native.js.map +1 -1
- package/build-module/group/save.js +6 -5
- package/build-module/group/save.js.map +1 -1
- package/build-module/heading/deprecated.js +22 -15
- package/build-module/heading/deprecated.js.map +1 -1
- package/build-module/heading/edit.js +9 -8
- package/build-module/heading/edit.js.map +1 -1
- package/build-module/heading/heading-level-dropdown.js +5 -4
- package/build-module/heading/heading-level-dropdown.js.map +1 -1
- package/build-module/heading/heading-level-dropdown.native.js +6 -4
- package/build-module/heading/heading-level-dropdown.native.js.map +1 -1
- package/build-module/heading/heading-level-icon.js +5 -4
- package/build-module/heading/heading-level-icon.js.map +1 -1
- package/build-module/heading/index.js +5 -3
- package/build-module/heading/index.js.map +1 -1
- package/build-module/heading/save.js +4 -3
- package/build-module/heading/save.js.map +1 -1
- package/build-module/heading/transforms.js +25 -18
- package/build-module/heading/transforms.js.map +1 -1
- package/build-module/home-link/edit.js +7 -6
- package/build-module/home-link/edit.js.map +1 -1
- package/build-module/html/edit.js +6 -5
- package/build-module/html/edit.js.map +1 -1
- package/build-module/html/save.js +4 -3
- package/build-module/html/save.js.map +1 -1
- package/build-module/html/transforms.js +4 -3
- package/build-module/html/transforms.js.map +1 -1
- package/build-module/image/deprecated.js +12 -9
- package/build-module/image/deprecated.js.map +1 -1
- package/build-module/image/edit.js +15 -13
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/edit.native.js +43 -32
- package/build-module/image/edit.native.js.map +1 -1
- package/build-module/image/image.js +47 -39
- package/build-module/image/image.js.map +1 -1
- package/build-module/image/index.js +5 -3
- package/build-module/image/index.js.map +1 -1
- package/build-module/image/save.js +4 -3
- package/build-module/image/save.js.map +1 -1
- package/build-module/image/transforms.js +46 -36
- package/build-module/image/transforms.js.map +1 -1
- package/build-module/image/utils.js +4 -3
- package/build-module/image/utils.js.map +1 -1
- package/build-module/index.js +8 -6
- package/build-module/index.js.map +1 -1
- package/build-module/latest-comments/edit.js +5 -4
- package/build-module/latest-comments/edit.js.map +1 -1
- package/build-module/latest-posts/deprecated.js +6 -3
- package/build-module/latest-posts/deprecated.js.map +1 -1
- package/build-module/latest-posts/edit.js +20 -13
- package/build-module/latest-posts/edit.js.map +1 -1
- package/build-module/latest-posts/edit.native.js +4 -3
- package/build-module/latest-posts/edit.native.js.map +1 -1
- package/build-module/list/deprecated.js +8 -6
- package/build-module/list/deprecated.js.map +1 -1
- package/build-module/list/edit.js +98 -94
- package/build-module/list/edit.js.map +1 -1
- package/build-module/list/ordered-list-settings.js +32 -29
- package/build-module/list/ordered-list-settings.js.map +1 -1
- package/build-module/list/save.js +4 -3
- package/build-module/list/save.js.map +1 -1
- package/build-module/list/transforms.js +51 -40
- package/build-module/list/transforms.js.map +1 -1
- package/build-module/loginout/edit.js +5 -4
- package/build-module/loginout/edit.js.map +1 -1
- package/build-module/media-text/deprecated.js +12 -9
- package/build-module/media-text/deprecated.js.map +1 -1
- package/build-module/media-text/edit.js +29 -21
- package/build-module/media-text/edit.js.map +1 -1
- package/build-module/media-text/edit.native.js +8 -6
- package/build-module/media-text/edit.native.js.map +1 -1
- package/build-module/media-text/media-container.js +21 -17
- package/build-module/media-text/media-container.js.map +1 -1
- package/build-module/media-text/media-container.native.js +5 -4
- package/build-module/media-text/media-container.native.js.map +1 -1
- package/build-module/media-text/save.js +4 -3
- package/build-module/media-text/save.js.map +1 -1
- package/build-module/media-text/transforms.js +51 -41
- package/build-module/media-text/transforms.js.map +1 -1
- package/build-module/missing/edit.js +10 -8
- package/build-module/missing/edit.js.map +1 -1
- package/build-module/missing/edit.native.js +4 -3
- package/build-module/missing/edit.native.js.map +1 -1
- package/build-module/missing/index.js +5 -3
- package/build-module/missing/index.js.map +1 -1
- package/build-module/missing/save.js +4 -3
- package/build-module/missing/save.js.map +1 -1
- package/build-module/more/edit.js +15 -11
- package/build-module/more/edit.js.map +1 -1
- package/build-module/more/index.js +5 -3
- package/build-module/more/index.js.map +1 -1
- package/build-module/more/save.js +7 -6
- package/build-module/more/save.js.map +1 -1
- package/build-module/navigation/deprecated.js +11 -7
- package/build-module/navigation/deprecated.js.map +1 -1
- package/build-module/navigation/edit/index.js +83 -52
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/inner-blocks.js +14 -10
- package/build-module/navigation/edit/inner-blocks.js.map +1 -1
- package/build-module/navigation/edit/navigation-menu-delete-control.js +4 -3
- package/build-module/navigation/edit/navigation-menu-delete-control.js.map +1 -1
- package/build-module/navigation/edit/navigation-menu-name-modal.js +8 -7
- package/build-module/navigation/edit/navigation-menu-name-modal.js.map +1 -1
- package/build-module/navigation/edit/navigation-menu-selector.js +21 -12
- package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build-module/navigation/edit/placeholder/index.js +56 -47
- package/build-module/navigation/edit/placeholder/index.js.map +1 -1
- package/build-module/navigation/edit/placeholder/placeholder-preview.js +4 -3
- package/build-module/navigation/edit/placeholder/placeholder-preview.js.map +1 -1
- package/build-module/navigation/edit/responsive-wrapper.js +14 -9
- package/build-module/navigation/edit/responsive-wrapper.js.map +1 -1
- package/build-module/navigation/edit/unsaved-inner-blocks.js +9 -8
- package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build-module/navigation/edit/use-list-view-modal.js +5 -4
- package/build-module/navigation/edit/use-list-view-modal.js.map +1 -1
- package/build-module/navigation/menu-items-to-blocks.js +19 -15
- package/build-module/navigation/menu-items-to-blocks.js.map +1 -1
- package/build-module/navigation/save.js +5 -3
- package/build-module/navigation/save.js.map +1 -1
- package/build-module/navigation-area/edit.js +34 -23
- package/build-module/navigation-area/edit.js.map +1 -1
- package/build-module/navigation-area/inner-blocks.js +4 -3
- package/build-module/navigation-area/inner-blocks.js.map +1 -1
- package/build-module/navigation-link/edit.js +21 -16
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-link/index.js +15 -10
- package/build-module/navigation-link/index.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +14 -10
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/navigation-submenu/index.js +6 -3
- package/build-module/navigation-submenu/index.js.map +1 -1
- package/build-module/nextpage/edit.native.js +7 -6
- package/build-module/nextpage/edit.native.js.map +1 -1
- package/build-module/page-list/convert-to-links-modal.js +65 -60
- package/build-module/page-list/convert-to-links-modal.js.map +1 -1
- package/build-module/page-list/edit.js +57 -56
- package/build-module/page-list/edit.js.map +1 -1
- package/build-module/paragraph/deprecated.js +20 -15
- package/build-module/paragraph/deprecated.js.map +1 -1
- package/build-module/paragraph/edit.js +14 -12
- package/build-module/paragraph/edit.js.map +1 -1
- package/build-module/paragraph/edit.native.js +9 -8
- package/build-module/paragraph/edit.native.js.map +1 -1
- package/build-module/paragraph/index.js +5 -3
- package/build-module/paragraph/index.js.map +1 -1
- package/build-module/paragraph/save.js +4 -3
- package/build-module/paragraph/save.js.map +1 -1
- package/build-module/paragraph/transforms.js +12 -9
- package/build-module/paragraph/transforms.js.map +1 -1
- package/build-module/pattern/edit.js +5 -4
- package/build-module/pattern/edit.js.map +1 -1
- package/build-module/post-author/edit.js +16 -14
- package/build-module/post-author/edit.js.map +1 -1
- package/build-module/post-comment/edit.js +7 -6
- package/build-module/post-comment/edit.js.map +1 -1
- package/build-module/post-comments/edit.js +10 -8
- package/build-module/post-comments/edit.js.map +1 -1
- package/build-module/post-comments-count/edit.js +6 -5
- package/build-module/post-comments-count/edit.js.map +1 -1
- package/build-module/post-comments-form/edit.js +6 -5
- package/build-module/post-comments-form/edit.js.map +1 -1
- package/build-module/post-comments-link/edit.js +6 -5
- package/build-module/post-comments-link/edit.js.map +1 -1
- package/build-module/post-content/edit.js +16 -13
- package/build-module/post-content/edit.js.map +1 -1
- package/build-module/post-date/deprecated.js +4 -3
- package/build-module/post-date/deprecated.js.map +1 -1
- package/build-module/post-date/edit.js +28 -22
- package/build-module/post-date/edit.js.map +1 -1
- package/build-module/post-excerpt/edit.js +15 -14
- package/build-module/post-excerpt/edit.js.map +1 -1
- package/build-module/post-featured-image/dimension-controls.js +9 -8
- package/build-module/post-featured-image/dimension-controls.js.map +1 -1
- package/build-module/post-featured-image/edit.js +66 -35
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/post-navigation-link/edit.js +11 -10
- package/build-module/post-navigation-link/edit.js.map +1 -1
- package/build-module/post-template/edit.js +28 -27
- package/build-module/post-template/edit.js.map +1 -1
- package/build-module/post-terms/edit.js +6 -5
- package/build-module/post-terms/edit.js.map +1 -1
- package/build-module/post-terms/use-post-terms.js +6 -5
- package/build-module/post-terms/use-post-terms.js.map +1 -1
- package/build-module/post-title/deprecated.js +4 -3
- package/build-module/post-title/deprecated.js.map +1 -1
- package/build-module/post-title/edit.js +16 -15
- package/build-module/post-title/edit.js.map +1 -1
- package/build-module/preformatted/edit.js +8 -7
- package/build-module/preformatted/edit.js.map +1 -1
- package/build-module/preformatted/save.js +4 -3
- package/build-module/preformatted/save.js.map +1 -1
- package/build-module/preformatted/transforms.js +20 -14
- package/build-module/preformatted/transforms.js.map +1 -1
- package/build-module/pullquote/deprecated.js +45 -37
- package/build-module/pullquote/deprecated.js.map +1 -1
- package/build-module/pullquote/edit.js +7 -6
- package/build-module/pullquote/edit.js.map +1 -1
- package/build-module/pullquote/edit.native.js +12 -10
- package/build-module/pullquote/edit.native.js.map +1 -1
- package/build-module/pullquote/figure.native.js +6 -5
- package/build-module/pullquote/figure.native.js.map +1 -1
- package/build-module/pullquote/save.js +4 -3
- package/build-module/pullquote/save.js.map +1 -1
- package/build-module/pullquote/transforms.js +25 -18
- package/build-module/pullquote/transforms.js.map +1 -1
- package/build-module/query/edit/index.js +5 -4
- package/build-module/query/edit/index.js.map +1 -1
- package/build-module/query/edit/query-inspector-controls.js +9 -8
- package/build-module/query/edit/query-inspector-controls.js.map +1 -1
- package/build-module/query/edit/query-placeholder.js +10 -7
- package/build-module/query/edit/query-placeholder.js.map +1 -1
- package/build-module/query/edit/query-toolbar.js +19 -15
- package/build-module/query/edit/query-toolbar.js.map +1 -1
- package/build-module/query/hooks.js +7 -6
- package/build-module/query/hooks.js.map +1 -1
- package/build-module/query/save.js +6 -5
- package/build-module/query/save.js.map +1 -1
- package/build-module/query/utils.js +17 -11
- package/build-module/query/utils.js.map +1 -1
- package/build-module/query-pagination/edit.js +10 -9
- package/build-module/query-pagination/edit.js.map +1 -1
- package/build-module/query-pagination/query-pagination-arrow-controls.js +5 -4
- package/build-module/query-pagination/query-pagination-arrow-controls.js.map +1 -1
- package/build-module/query-pagination-next/edit.js +10 -9
- package/build-module/query-pagination-next/edit.js.map +1 -1
- package/build-module/query-pagination-numbers/edit.js +7 -3
- package/build-module/query-pagination-numbers/edit.js.map +1 -1
- package/build-module/query-pagination-previous/edit.js +10 -9
- package/build-module/query-pagination-previous/edit.js.map +1 -1
- package/build-module/query-title/deprecated.js +4 -3
- package/build-module/query-title/deprecated.js.map +1 -1
- package/build-module/query-title/edit.js +9 -8
- package/build-module/query-title/edit.js.map +1 -1
- package/build-module/quote/deprecated.js +12 -9
- package/build-module/quote/deprecated.js.map +1 -1
- package/build-module/quote/edit.js +11 -10
- package/build-module/quote/edit.js.map +1 -1
- package/build-module/quote/index.js +6 -4
- package/build-module/quote/index.js.map +1 -1
- package/build-module/quote/save.js +4 -3
- package/build-module/quote/save.js.map +1 -1
- package/build-module/quote/transforms.js +58 -44
- package/build-module/quote/transforms.js.map +1 -1
- package/build-module/rss/edit.js +5 -4
- package/build-module/rss/edit.js.map +1 -1
- package/build-module/search/edit.js +9 -8
- package/build-module/search/edit.js.map +1 -1
- package/build-module/search/edit.native.js +14 -12
- package/build-module/search/edit.native.js.map +1 -1
- package/build-module/separator/edit.js +6 -5
- package/build-module/separator/edit.js.map +1 -1
- package/build-module/separator/save.js +4 -3
- package/build-module/separator/save.js.map +1 -1
- package/build-module/separator/separator-settings.js +15 -12
- package/build-module/separator/separator-settings.js.map +1 -1
- package/build-module/shortcode/edit.js +5 -4
- package/build-module/shortcode/edit.js.map +1 -1
- package/build-module/shortcode/save.js +4 -3
- package/build-module/shortcode/save.js.map +1 -1
- package/build-module/shortcode/transforms.js +4 -3
- package/build-module/shortcode/transforms.js.map +1 -1
- package/build-module/site-logo/edit.js +29 -26
- package/build-module/site-logo/edit.js.map +1 -1
- package/build-module/site-tagline/deprecated.js +4 -3
- package/build-module/site-tagline/deprecated.js.map +1 -1
- package/build-module/site-tagline/edit.js +5 -4
- package/build-module/site-tagline/edit.js.map +1 -1
- package/build-module/site-title/deprecated.js +4 -3
- package/build-module/site-title/deprecated.js.map +1 -1
- package/build-module/site-title/edit/index.js +6 -5
- package/build-module/site-title/edit/index.js.map +1 -1
- package/build-module/site-title/edit/level-icon.js +5 -4
- package/build-module/site-title/edit/level-icon.js.map +1 -1
- package/build-module/site-title/edit/level-toolbar.js +5 -4
- package/build-module/site-title/edit/level-toolbar.js.map +1 -1
- package/build-module/social-link/edit.js +38 -34
- package/build-module/social-link/edit.js.map +1 -1
- package/build-module/social-link/edit.native.js +12 -10
- package/build-module/social-link/edit.native.js.map +1 -1
- package/build-module/social-links/deprecated.js +6 -3
- package/build-module/social-links/deprecated.js.map +1 -1
- package/build-module/social-links/edit.js +19 -16
- package/build-module/social-links/edit.js.map +1 -1
- package/build-module/social-links/edit.native.js +20 -17
- package/build-module/social-links/edit.native.js.map +1 -1
- package/build-module/spacer/edit.js +11 -10
- package/build-module/spacer/edit.js.map +1 -1
- package/build-module/spacer/save.js +4 -3
- package/build-module/spacer/save.js.map +1 -1
- package/build-module/table/deprecated.js +66 -50
- package/build-module/table/deprecated.js.map +1 -1
- package/build-module/table/edit.js +49 -39
- package/build-module/table/edit.js.map +1 -1
- package/build-module/table/save.js +36 -29
- package/build-module/table/save.js.map +1 -1
- package/build-module/table/state.js +24 -19
- package/build-module/table/state.js.map +1 -1
- package/build-module/table/transforms.js +19 -16
- package/build-module/table/transforms.js.map +1 -1
- package/build-module/table-of-contents/edit.js +8 -7
- package/build-module/table-of-contents/edit.js.map +1 -1
- package/build-module/table-of-contents/list.js +4 -3
- package/build-module/table-of-contents/list.js.map +1 -1
- package/build-module/table-of-contents/utils.js +2 -1
- package/build-module/table-of-contents/utils.js.map +1 -1
- package/build-module/tag-cloud/edit.js +6 -5
- package/build-module/tag-cloud/edit.js.map +1 -1
- package/build-module/template-part/edit/advanced-controls.js +18 -14
- package/build-module/template-part/edit/advanced-controls.js.map +1 -1
- package/build-module/template-part/edit/index.js +33 -23
- package/build-module/template-part/edit/index.js.map +1 -1
- package/build-module/template-part/edit/inner-blocks.js +9 -8
- package/build-module/template-part/edit/inner-blocks.js.map +1 -1
- package/build-module/template-part/edit/placeholder/index.js +36 -27
- package/build-module/template-part/edit/placeholder/index.js.map +1 -1
- package/build-module/template-part/edit/placeholder/patterns-setup.js +15 -13
- package/build-module/template-part/edit/placeholder/patterns-setup.js.map +1 -1
- package/build-module/template-part/edit/selection/index.js +7 -6
- package/build-module/template-part/edit/selection/index.js.map +1 -1
- package/build-module/template-part/edit/selection/template-part-previews.js +49 -41
- package/build-module/template-part/edit/selection/template-part-previews.js.map +1 -1
- package/build-module/template-part/index.js +6 -4
- package/build-module/template-part/index.js.map +1 -1
- package/build-module/term-description/edit.js +6 -5
- package/build-module/term-description/edit.js.map +1 -1
- package/build-module/text-columns/edit.js +5 -4
- package/build-module/text-columns/edit.js.map +1 -1
- package/build-module/text-columns/save.js +4 -3
- package/build-module/text-columns/save.js.map +1 -1
- package/build-module/text-columns/transforms.js +20 -14
- package/build-module/text-columns/transforms.js.map +1 -1
- package/build-module/transformationCategories.native.js +4 -1
- package/build-module/transformationCategories.native.js.map +1 -1
- package/build-module/verse/deprecated.js +12 -9
- package/build-module/verse/deprecated.js.map +1 -1
- package/build-module/verse/edit.js +8 -7
- package/build-module/verse/edit.js.map +1 -1
- package/build-module/verse/save.js +4 -3
- package/build-module/verse/save.js.map +1 -1
- package/build-module/video/edit-common-settings.js +5 -4
- package/build-module/video/edit-common-settings.js.map +1 -1
- package/build-module/video/edit.js +26 -21
- package/build-module/video/edit.js.map +1 -1
- package/build-module/video/edit.native.js +24 -18
- package/build-module/video/edit.native.js.map +1 -1
- package/build-module/video/save.js +4 -3
- package/build-module/video/save.js.map +1 -1
- package/build-module/video/tracks-editor.js +55 -41
- package/build-module/video/tracks-editor.js.map +1 -1
- package/build-module/video/tracks.js +4 -3
- package/build-module/video/tracks.js.map +1 -1
- package/build-module/video/transforms.js +35 -30
- package/build-module/video/transforms.js.map +1 -1
- package/build-style/code/theme-rtl.css +1 -1
- package/build-style/code/theme.css +1 -1
- package/build-style/cover/style-rtl.css +8 -2
- package/build-style/cover/style.css +8 -2
- package/build-style/editor-rtl.css +121 -85
- package/build-style/editor.css +121 -85
- package/build-style/navigation/editor-rtl.css +20 -34
- package/build-style/navigation/editor.css +20 -34
- package/build-style/navigation/style-rtl.css +54 -9
- package/build-style/navigation/style.css +54 -9
- package/build-style/post-comments-form/style-rtl.css +18 -0
- package/build-style/post-comments-form/style.css +18 -0
- package/build-style/post-featured-image/editor-rtl.css +100 -16
- package/build-style/post-featured-image/editor.css +100 -16
- package/build-style/social-links/editor-rtl.css +1 -35
- package/build-style/social-links/editor.css +1 -35
- package/build-style/style-rtl.css +80 -33
- package/build-style/style.css +80 -33
- package/build-style/theme-rtl.css +1 -1
- package/build-style/theme.css +1 -1
- package/package.json +32 -32
- package/src/calendar/index.php +40 -36
- package/src/code/theme.scss +1 -1
- package/src/cover/style.scss +9 -2
- package/src/cover/transforms.js +2 -0
- package/src/gallery/index.php +1 -1
- package/src/home-link/index.php +1 -1
- package/src/image/index.php +1 -1
- package/src/index.js +1 -1
- package/src/navigation/edit/index.js +42 -5
- package/src/navigation/edit/inner-blocks.js +2 -1
- package/src/navigation/edit/navigation-menu-selector.js +14 -5
- package/src/navigation/edit/placeholder/index.js +36 -29
- package/src/navigation/edit/responsive-wrapper.js +8 -1
- package/src/navigation/editor.scss +26 -46
- package/src/navigation/index.php +59 -7
- package/src/navigation/style.scss +72 -17
- package/src/navigation-area/edit.js +5 -0
- package/src/navigation-area/index.php +2 -1
- package/src/navigation-link/index.php +1 -1
- package/src/navigation-submenu/index.php +2 -8
- package/src/page-list/edit.js +35 -44
- package/src/page-list/index.php +5 -5
- package/src/post-comments-form/style.scss +20 -1
- package/src/post-featured-image/edit.js +61 -26
- package/src/post-featured-image/editor.scss +124 -20
- package/src/site-logo/editor.scss +1 -0
- package/src/social-links/editor.scss +1 -47
- package/src/style.scss +0 -1
- package/src/table-of-contents/index.php +1 -1
- package/build-style/navigation-submenu/style-rtl.css +0 -97
- package/build-style/navigation-submenu/style.css +0 -97
- package/src/navigation-submenu/style.scss +0 -25
|
@@ -20,18 +20,20 @@ const transforms = {
|
|
|
20
20
|
from: [{
|
|
21
21
|
type: 'block',
|
|
22
22
|
blocks: ['core/image'],
|
|
23
|
-
transform:
|
|
24
|
-
caption,
|
|
25
|
-
url,
|
|
26
|
-
alt,
|
|
27
|
-
align,
|
|
28
|
-
id,
|
|
29
|
-
anchor,
|
|
30
|
-
style
|
|
31
|
-
}) => {
|
|
23
|
+
transform: _ref => {
|
|
32
24
|
var _style$color;
|
|
33
25
|
|
|
26
|
+
let {
|
|
27
|
+
caption,
|
|
28
|
+
url,
|
|
29
|
+
alt,
|
|
30
|
+
align,
|
|
31
|
+
id,
|
|
32
|
+
anchor,
|
|
33
|
+
style
|
|
34
|
+
} = _ref;
|
|
34
35
|
return (0, _blocks.createBlock)('core/cover', {
|
|
36
|
+
dimRatio: 50,
|
|
35
37
|
url,
|
|
36
38
|
alt,
|
|
37
39
|
align,
|
|
@@ -50,32 +52,38 @@ const transforms = {
|
|
|
50
52
|
}, {
|
|
51
53
|
type: 'block',
|
|
52
54
|
blocks: ['core/video'],
|
|
53
|
-
transform:
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
55
|
+
transform: _ref2 => {
|
|
56
|
+
let {
|
|
57
|
+
caption,
|
|
58
|
+
src,
|
|
59
|
+
align,
|
|
60
|
+
id,
|
|
61
|
+
anchor
|
|
62
|
+
} = _ref2;
|
|
63
|
+
return (0, _blocks.createBlock)('core/cover', {
|
|
64
|
+
dimRatio: 50,
|
|
65
|
+
url: src,
|
|
66
|
+
align,
|
|
67
|
+
id,
|
|
68
|
+
backgroundType: _shared.VIDEO_BACKGROUND_TYPE,
|
|
69
|
+
anchor
|
|
70
|
+
}, [(0, _blocks.createBlock)('core/paragraph', {
|
|
71
|
+
content: caption,
|
|
72
|
+
fontSize: 'large'
|
|
73
|
+
})]);
|
|
74
|
+
}
|
|
69
75
|
}, {
|
|
70
76
|
type: 'block',
|
|
71
77
|
blocks: ['core/group'],
|
|
72
|
-
isMatch:
|
|
73
|
-
backgroundColor,
|
|
74
|
-
gradient,
|
|
75
|
-
style
|
|
76
|
-
}) => {
|
|
78
|
+
isMatch: _ref3 => {
|
|
77
79
|
var _style$color2, _style$color3;
|
|
78
80
|
|
|
81
|
+
let {
|
|
82
|
+
backgroundColor,
|
|
83
|
+
gradient,
|
|
84
|
+
style
|
|
85
|
+
} = _ref3;
|
|
86
|
+
|
|
79
87
|
/*
|
|
80
88
|
* Make this transformation available only if the Group has background
|
|
81
89
|
* or gradient set, because otherwise `Cover` block displays a Placeholder.
|
|
@@ -85,15 +93,16 @@ const transforms = {
|
|
|
85
93
|
*/
|
|
86
94
|
return backgroundColor || (style === null || style === void 0 ? void 0 : (_style$color2 = style.color) === null || _style$color2 === void 0 ? void 0 : _style$color2.background) || (style === null || style === void 0 ? void 0 : (_style$color3 = style.color) === null || _style$color3 === void 0 ? void 0 : _style$color3.gradient) || gradient;
|
|
87
95
|
},
|
|
88
|
-
transform: ({
|
|
89
|
-
align,
|
|
90
|
-
anchor,
|
|
91
|
-
backgroundColor,
|
|
92
|
-
gradient,
|
|
93
|
-
style
|
|
94
|
-
}, innerBlocks) => {
|
|
96
|
+
transform: (_ref4, innerBlocks) => {
|
|
95
97
|
var _style$color4, _style$color5;
|
|
96
98
|
|
|
99
|
+
let {
|
|
100
|
+
align,
|
|
101
|
+
anchor,
|
|
102
|
+
backgroundColor,
|
|
103
|
+
gradient,
|
|
104
|
+
style
|
|
105
|
+
} = _ref4;
|
|
97
106
|
return (0, _blocks.createBlock)('core/cover', {
|
|
98
107
|
align,
|
|
99
108
|
anchor,
|
|
@@ -107,14 +116,16 @@ const transforms = {
|
|
|
107
116
|
to: [{
|
|
108
117
|
type: 'block',
|
|
109
118
|
blocks: ['core/image'],
|
|
110
|
-
isMatch:
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
119
|
+
isMatch: _ref5 => {
|
|
120
|
+
let {
|
|
121
|
+
backgroundType,
|
|
122
|
+
url,
|
|
123
|
+
overlayColor,
|
|
124
|
+
customOverlayColor,
|
|
125
|
+
gradient,
|
|
126
|
+
customGradient
|
|
127
|
+
} = _ref5;
|
|
128
|
+
|
|
118
129
|
if (url) {
|
|
119
130
|
// If a url exists the transform could happen if that URL represents an image background.
|
|
120
131
|
return backgroundType === _shared.IMAGE_BACKGROUND_TYPE;
|
|
@@ -123,17 +134,18 @@ const transforms = {
|
|
|
123
134
|
|
|
124
135
|
return !overlayColor && !customOverlayColor && !gradient && !customGradient;
|
|
125
136
|
},
|
|
126
|
-
transform:
|
|
127
|
-
title,
|
|
128
|
-
url,
|
|
129
|
-
alt,
|
|
130
|
-
align,
|
|
131
|
-
id,
|
|
132
|
-
anchor,
|
|
133
|
-
style
|
|
134
|
-
}) => {
|
|
137
|
+
transform: _ref6 => {
|
|
135
138
|
var _style$color6;
|
|
136
139
|
|
|
140
|
+
let {
|
|
141
|
+
title,
|
|
142
|
+
url,
|
|
143
|
+
alt,
|
|
144
|
+
align,
|
|
145
|
+
id,
|
|
146
|
+
anchor,
|
|
147
|
+
style
|
|
148
|
+
} = _ref6;
|
|
137
149
|
return (0, _blocks.createBlock)('core/image', {
|
|
138
150
|
caption: title,
|
|
139
151
|
url,
|
|
@@ -151,14 +163,16 @@ const transforms = {
|
|
|
151
163
|
}, {
|
|
152
164
|
type: 'block',
|
|
153
165
|
blocks: ['core/video'],
|
|
154
|
-
isMatch:
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
166
|
+
isMatch: _ref7 => {
|
|
167
|
+
let {
|
|
168
|
+
backgroundType,
|
|
169
|
+
url,
|
|
170
|
+
overlayColor,
|
|
171
|
+
customOverlayColor,
|
|
172
|
+
gradient,
|
|
173
|
+
customGradient
|
|
174
|
+
} = _ref7;
|
|
175
|
+
|
|
162
176
|
if (url) {
|
|
163
177
|
// If a url exists the transform could happen if that URL represents a video background.
|
|
164
178
|
return backgroundType === _shared.VIDEO_BACKGROUND_TYPE;
|
|
@@ -167,19 +181,22 @@ const transforms = {
|
|
|
167
181
|
|
|
168
182
|
return !overlayColor && !customOverlayColor && !gradient && !customGradient;
|
|
169
183
|
},
|
|
170
|
-
transform:
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
184
|
+
transform: _ref8 => {
|
|
185
|
+
let {
|
|
186
|
+
title,
|
|
187
|
+
url,
|
|
188
|
+
align,
|
|
189
|
+
id,
|
|
190
|
+
anchor
|
|
191
|
+
} = _ref8;
|
|
192
|
+
return (0, _blocks.createBlock)('core/video', {
|
|
193
|
+
caption: title,
|
|
194
|
+
src: url,
|
|
195
|
+
id,
|
|
196
|
+
align,
|
|
197
|
+
anchor
|
|
198
|
+
});
|
|
199
|
+
}
|
|
183
200
|
}]
|
|
184
201
|
};
|
|
185
202
|
var _default = transforms;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/cover/transforms.js"],"names":["transforms","from","type","blocks","transform","caption","url","alt","align","id","anchor","style","color","duotone","content","fontSize","src","backgroundType","VIDEO_BACKGROUND_TYPE","isMatch","backgroundColor","gradient","background","innerBlocks","overlayColor","customOverlayColor","customGradient","to","IMAGE_BACKGROUND_TYPE","title"],"mappings":";;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAGA,MAAMA,UAAU,GAAG;AAClBC,EAAAA,IAAI,EAAE,CACL;AACCC,IAAAA,IAAI,EAAE,OADP;AAECC,IAAAA,MAAM,EAAE,CAAE,YAAF,CAFT;AAGCC,IAAAA,SAAS,EAAE,
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/cover/transforms.js"],"names":["transforms","from","type","blocks","transform","caption","url","alt","align","id","anchor","style","dimRatio","color","duotone","content","fontSize","src","backgroundType","VIDEO_BACKGROUND_TYPE","isMatch","backgroundColor","gradient","background","innerBlocks","overlayColor","customOverlayColor","customGradient","to","IMAGE_BACKGROUND_TYPE","title"],"mappings":";;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAGA,MAAMA,UAAU,GAAG;AAClBC,EAAAA,IAAI,EAAE,CACL;AACCC,IAAAA,IAAI,EAAE,OADP;AAECC,IAAAA,MAAM,EAAE,CAAE,YAAF,CAFT;AAGCC,IAAAA,SAAS,EAAE;AAAA;;AAAA,UAAE;AAAEC,QAAAA,OAAF;AAAWC,QAAAA,GAAX;AAAgBC,QAAAA,GAAhB;AAAqBC,QAAAA,KAArB;AAA4BC,QAAAA,EAA5B;AAAgCC,QAAAA,MAAhC;AAAwCC,QAAAA;AAAxC,OAAF;AAAA,aACV,yBACC,YADD,EAEC;AACCC,QAAAA,QAAQ,EAAE,EADX;AAECN,QAAAA,GAFD;AAGCC,QAAAA,GAHD;AAICC,QAAAA,KAJD;AAKCC,QAAAA,EALD;AAMCC,QAAAA,MAND;AAOCC,QAAAA,KAAK,EAAE;AACNE,UAAAA,KAAK,EAAE;AACNC,YAAAA,OAAO,EAAEH,KAAF,aAAEA,KAAF,uCAAEA,KAAK,CAAEE,KAAT,iDAAE,aAAcC;AADjB;AADD;AAPR,OAFD,EAeC,CACC,yBAAa,gBAAb,EAA+B;AAC9BC,QAAAA,OAAO,EAAEV,OADqB;AAE9BW,QAAAA,QAAQ,EAAE;AAFoB,OAA/B,CADD,CAfD,CADU;AAAA;AAHZ,GADK,EA4BL;AACCd,IAAAA,IAAI,EAAE,OADP;AAECC,IAAAA,MAAM,EA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KAAK,CAAEE,KAAT,kDAAE,cAAcC;AADjB;AADD;AAPmB,OAA3B,CADU;AAAA;AAvBZ,GADG,EAuCH;AACCZ,IAAAA,IAAI,EAAE,OADP;AAECC,IAAAA,MAAM,EAAE,CAAE,YAAF,CAFT;AAGCiB,IAAAA,OAAO,EAAE,SAOF;AAAA,UAPI;AACVF,QAAAA,cADU;AAEVZ,QAAAA,GAFU;AAGVmB,QAAAA,YAHU;AAIVC,QAAAA,kBAJU;AAKVJ,QAAAA,QALU;AAMVK,QAAAA;AANU,OAOJ;;AACN,UAAKrB,GAAL,EAAW;AACV;AACA,eAAOY,cAAc,KAAKC,6BAA1B;AACA,OAJK,CAKN;;;AACA,aACC,CAAEM,YAAF,IACA,CAAEC,kBADF,IAEA,CAAEJ,QAFF,IAGA,CAAEK,cAJH;AAMA,KAtBF;AAuBCvB,IAAAA,SAAS,EAAE;AAAA,UAAE;AAAE0B,QAAAA,KAAF;AAASxB,QAAAA,GAAT;AAAcE,QAAAA,KAAd;AAAqBC,QAAAA,EAArB;AAAyBC,QAAAA;AAAzB,OAAF;AAAA,aACV,yBAAa,YAAb,EAA2B;AAC1BL,QAAAA,OAAO,EAAEyB,KADiB;AAE1Bb,QAAAA,GAAG,EAAEX,GAFqB;AAG1BG,QAAAA,EAH0B;AAI1BD,QAAAA,KAJ0B;AAK1BE,QAAAA;AAL0B,OAA3B,CADU;AAAA;AAvBZ,GAvCG;AAxFc,CAAnB;eAkKeV,U","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { IMAGE_BACKGROUND_TYPE, VIDEO_BACKGROUND_TYPE } from './shared';\n\nconst transforms = {\n\tfrom: [\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/image' ],\n\t\t\ttransform: ( { caption, url, alt, align, id, anchor, style } ) =>\n\t\t\t\tcreateBlock(\n\t\t\t\t\t'core/cover',\n\t\t\t\t\t{\n\t\t\t\t\t\tdimRatio: 50,\n\t\t\t\t\t\turl,\n\t\t\t\t\t\talt,\n\t\t\t\t\t\talign,\n\t\t\t\t\t\tid,\n\t\t\t\t\t\tanchor,\n\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\tcolor: {\n\t\t\t\t\t\t\t\tduotone: style?.color?.duotone,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t[\n\t\t\t\t\t\tcreateBlock( 'core/paragraph', {\n\t\t\t\t\t\t\tcontent: caption,\n\t\t\t\t\t\t\tfontSize: 'large',\n\t\t\t\t\t\t} ),\n\t\t\t\t\t]\n\t\t\t\t),\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/video' ],\n\t\t\ttransform: ( { caption, src, align, id, anchor } ) =>\n\t\t\t\tcreateBlock(\n\t\t\t\t\t'core/cover',\n\t\t\t\t\t{\n\t\t\t\t\t\tdimRatio: 50,\n\t\t\t\t\t\turl: src,\n\t\t\t\t\t\talign,\n\t\t\t\t\t\tid,\n\t\t\t\t\t\tbackgroundType: VIDEO_BACKGROUND_TYPE,\n\t\t\t\t\t\tanchor,\n\t\t\t\t\t},\n\t\t\t\t\t[\n\t\t\t\t\t\tcreateBlock( 'core/paragraph', {\n\t\t\t\t\t\t\tcontent: caption,\n\t\t\t\t\t\t\tfontSize: 'large',\n\t\t\t\t\t\t} ),\n\t\t\t\t\t]\n\t\t\t\t),\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/group' ],\n\t\t\tisMatch: ( { backgroundColor, gradient, style } ) => {\n\t\t\t\t/*\n\t\t\t\t * Make this transformation available only if the Group has background\n\t\t\t\t * or gradient set, because otherwise `Cover` block displays a Placeholder.\n\t\t\t\t *\n\t\t\t\t * This helps avoid arbitrary decisions about the Cover block's background\n\t\t\t\t * and user confusion about the existence of previous content.\n\t\t\t\t */\n\t\t\t\treturn (\n\t\t\t\t\tbackgroundColor ||\n\t\t\t\t\tstyle?.color?.background ||\n\t\t\t\t\tstyle?.color?.gradient ||\n\t\t\t\t\tgradient\n\t\t\t\t);\n\t\t\t},\n\t\t\ttransform: (\n\t\t\t\t{ align, anchor, backgroundColor, gradient, style },\n\t\t\t\tinnerBlocks\n\t\t\t) => {\n\t\t\t\treturn createBlock(\n\t\t\t\t\t'core/cover',\n\t\t\t\t\t{\n\t\t\t\t\t\talign,\n\t\t\t\t\t\tanchor,\n\t\t\t\t\t\toverlayColor: backgroundColor,\n\t\t\t\t\t\tcustomOverlayColor: style?.color?.background,\n\t\t\t\t\t\tgradient,\n\t\t\t\t\t\tcustomGradient: style?.color?.gradient,\n\t\t\t\t\t},\n\t\t\t\t\tinnerBlocks\n\t\t\t\t);\n\t\t\t},\n\t\t},\n\t],\n\tto: [\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/image' ],\n\t\t\tisMatch: ( {\n\t\t\t\tbackgroundType,\n\t\t\t\turl,\n\t\t\t\toverlayColor,\n\t\t\t\tcustomOverlayColor,\n\t\t\t\tgradient,\n\t\t\t\tcustomGradient,\n\t\t\t} ) => {\n\t\t\t\tif ( url ) {\n\t\t\t\t\t// If a url exists the transform could happen if that URL represents an image background.\n\t\t\t\t\treturn backgroundType === IMAGE_BACKGROUND_TYPE;\n\t\t\t\t}\n\t\t\t\t// If a url is not set the transform could happen if the cover has no background color or gradient;\n\t\t\t\treturn (\n\t\t\t\t\t! overlayColor &&\n\t\t\t\t\t! customOverlayColor &&\n\t\t\t\t\t! gradient &&\n\t\t\t\t\t! customGradient\n\t\t\t\t);\n\t\t\t},\n\t\t\ttransform: ( { title, url, alt, align, id, anchor, style } ) =>\n\t\t\t\tcreateBlock( 'core/image', {\n\t\t\t\t\tcaption: title,\n\t\t\t\t\turl,\n\t\t\t\t\talt,\n\t\t\t\t\talign,\n\t\t\t\t\tid,\n\t\t\t\t\tanchor,\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\tcolor: {\n\t\t\t\t\t\t\tduotone: style?.color?.duotone,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t} ),\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/video' ],\n\t\t\tisMatch: ( {\n\t\t\t\tbackgroundType,\n\t\t\t\turl,\n\t\t\t\toverlayColor,\n\t\t\t\tcustomOverlayColor,\n\t\t\t\tgradient,\n\t\t\t\tcustomGradient,\n\t\t\t} ) => {\n\t\t\t\tif ( url ) {\n\t\t\t\t\t// If a url exists the transform could happen if that URL represents a video background.\n\t\t\t\t\treturn backgroundType === VIDEO_BACKGROUND_TYPE;\n\t\t\t\t}\n\t\t\t\t// If a url is not set the transform could happen if the cover has no background color or gradient;\n\t\t\t\treturn (\n\t\t\t\t\t! overlayColor &&\n\t\t\t\t\t! customOverlayColor &&\n\t\t\t\t\t! gradient &&\n\t\t\t\t\t! customGradient\n\t\t\t\t);\n\t\t\t},\n\t\t\ttransform: ( { title, url, align, id, anchor } ) =>\n\t\t\t\tcreateBlock( 'core/video', {\n\t\t\t\t\tcaption: title,\n\t\t\t\t\tsrc: url,\n\t\t\t\t\tid,\n\t\t\t\t\talign,\n\t\t\t\t\tanchor,\n\t\t\t\t} ),\n\t\t},\n\t],\n};\n\nexport default transforms;\n"]}
|
|
@@ -71,14 +71,16 @@ const {
|
|
|
71
71
|
const deprecated = [{
|
|
72
72
|
attributes: blockAttributes,
|
|
73
73
|
|
|
74
|
-
save({
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
74
|
+
save(_ref) {
|
|
75
|
+
let {
|
|
76
|
+
attributes: {
|
|
77
|
+
url,
|
|
78
|
+
caption,
|
|
79
|
+
type,
|
|
80
|
+
providerNameSlug
|
|
81
|
+
}
|
|
82
|
+
} = _ref;
|
|
83
|
+
|
|
82
84
|
if (!url) {
|
|
83
85
|
return null;
|
|
84
86
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/embed/deprecated.js"],"names":["attributes","blockAttributes","metadata","deprecated","save","url","caption","type","providerNameSlug","embedClassName","RichText","isEmpty"],"mappings":";;;;;;;;;;;AAGA;;AAUA;;AAbA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;AACA;AACA;;AAGA,MAAM;AAAEA,EAAAA,UAAU,EAAEC;AAAd,IAAkCC,QAAxC;AAEA,MAAMC,UAAU,GAAG,CAClB;AACCH,EAAAA,UAAU,EAAEC,eADb;;AAECG,EAAAA,IAAI,
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/embed/deprecated.js"],"names":["attributes","blockAttributes","metadata","deprecated","save","url","caption","type","providerNameSlug","embedClassName","RichText","isEmpty"],"mappings":";;;;;;;;;;;AAGA;;AAUA;;AAbA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;AACA;AACA;;AAGA,MAAM;AAAEA,EAAAA,UAAU,EAAEC;AAAd,IAAkCC,QAAxC;AAEA,MAAMC,UAAU,GAAG,CAClB;AACCH,EAAAA,UAAU,EAAEC,eADb;;AAECG,EAAAA,IAAI,OAA6D;AAAA,QAA3D;AAAEJ,MAAAA,UAAU,EAAE;AAAEK,QAAAA,GAAF;AAAOC,QAAAA,OAAP;AAAgBC,QAAAA,IAAhB;AAAsBC,QAAAA;AAAtB;AAAd,KAA2D;;AAChE,QAAK,CAAEH,GAAP,EAAa;AACZ,aAAO,IAAP;AACA;;AAED,UAAMI,cAAc,GAAG,yBAAY,gBAAZ,EAA8B;AACpD,OAAG,WAAWF,IAAM,EAApB,GAAyBA,IAD2B;AAEpD,OAAG,eAAeC,gBAAkB,EAApC,GAAyCA;AAFW,KAA9B,CAAvB;AAKA,WACC;AAAQ,MAAA,SAAS,EAAGC;AAApB,OACI,KAAKJ,GAAK;AAAI;AADlB,MAEG,CAAEK,sBAASC,OAAT,CAAkBL,OAAlB,CAAF,IACD,4BAAC,qBAAD,CAAU,OAAV;AACC,MAAA,OAAO,EAAC,YADT;AAEC,MAAA,KAAK,EAAGA;AAFT,MAHF,CADD;AAWA;;AAvBF,CADkB,CAAnB;eA4BeH,U","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * Internal dependencies\n */\nimport metadata from './block.json';\n\n/**\n * WordPress dependencies\n */\nimport { RichText } from '@wordpress/block-editor';\n\nconst { attributes: blockAttributes } = metadata;\n\nconst deprecated = [\n\t{\n\t\tattributes: blockAttributes,\n\t\tsave( { attributes: { url, caption, type, providerNameSlug } } ) {\n\t\t\tif ( ! url ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst embedClassName = classnames( 'wp-block-embed', {\n\t\t\t\t[ `is-type-${ type }` ]: type,\n\t\t\t\t[ `is-provider-${ providerNameSlug }` ]: providerNameSlug,\n\t\t\t} );\n\n\t\t\treturn (\n\t\t\t\t<figure className={ embedClassName }>\n\t\t\t\t\t{ `\\n${ url }\\n` /* URL needs to be on its own line. */ }\n\t\t\t\t\t{ ! RichText.isEmpty( caption ) && (\n\t\t\t\t\t\t<RichText.Content\n\t\t\t\t\t\t\ttagName=\"figcaption\"\n\t\t\t\t\t\t\tvalue={ caption }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</figure>\n\t\t\t);\n\t\t},\n\t},\n];\n\nexport default deprecated;\n"]}
|
|
@@ -134,7 +134,8 @@ const EmbedEdit = props => {
|
|
|
134
134
|
* @return {Object} Merged attributes.
|
|
135
135
|
*/
|
|
136
136
|
|
|
137
|
-
const getMergedAttributes = (
|
|
137
|
+
const getMergedAttributes = function () {
|
|
138
|
+
let ignorePreviousClassName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
138
139
|
const {
|
|
139
140
|
allowResponsive,
|
|
140
141
|
className
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/embed/edit.native.js"],"names":["PREVIEWABLE_PROVIDERS","NOT_PREVIEWABLE_WP_EMBED_PROVIDERS","WP_EMBED_TYPE","EmbedEdit","props","attributes","align","providerNameSlug","previewable","responsive","url","isSelected","onReplace","setAttributes","insertBlocksAfter","onFocus","clientId","defaultEmbedInfo","title","icon","embedContentIcon","embedInfoByProvider","wasBlockJustInserted","select","blockEditorStore","isEditingURL","setIsEditingURL","showEmbedBottomSheet","setShowEmbedBottomSheet","invalidateResolution","coreStore","preview","fetching","themeSupportsResponsive","cannotEmbed","getEmbedPreview","hasFinishedResolution","isPreviewEmbedFallback","getThemeSupports","embedPreview","hasResolvedEmbedPreview","previewIsFallback","badEmbedProvider","html","type","undefined","wordpressCantEmbed","code","validPreview","getMergedAttributes","ignorePreviousClassName","allowResponsive","className","toggleResponsive","newAllowResponsive","newURL","replace","upgradedBlock","blockProps","showEmbedPlaceholder","classFromPreview","isProviderPreviewable","includes","bottomSheetLabel","event","value"],"mappings":";;;;;;;;;AA0BA;;AAvBA;;AAOA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAKA;;AAEA;;AACA;;AAIA;;AACA;;AAjCA;AACA;AACA;;AAeA;AACA;AACA;;AAGA;AACA;AACA;AAWA;AACA;AACA,MAAMA,qBAAqB,GAAG,CAAE,SAAF,EAAa,SAAb,EAAwB,WAAxB,EAAqC,OAArC,CAA9B,C,CACA;AACA;;AACA,MAAMC,kCAAkC,GAAG,CAAE,WAAF,CAA3C;AAEA,MAAMC,aAAa,GAAG,UAAtB;;AAEA,MAAMC,SAAS,GAAKC,KAAF,IAAa;AAC9B,QAAM;AACLC,IAAAA,UAAU,EAAE;AAAEC,MAAAA,KAAF;AAASC,MAAAA,gBAAT;AAA2BC,MAAAA,WAA3B;AAAwCC,MAAAA,UAAxC;AAAoDC,MAAAA;AAApD,KADP;AAELL,IAAAA,UAFK;AAGLM,IAAAA,UAHK;A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AE;AAAEH,QAAAA,GAAG,EAAEuD;AAAP,OAAF,CAAb;AACAvC,MAAAA,eAAe,CAAE,KAAF,CAAf;AACA;AAXF,IAxDD,CADD;AAwEA,CAtQD;;eAwQevB,S","sourcesContent":["/**\n * Internal dependencies\n */\nimport {\n\tcreateUpgradedEmbedBlock,\n\tgetClassNames,\n\tfallback,\n\tgetAttributesFromPreview,\n\tgetEmbedInfoByProvider,\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';\nimport EmbedBottomSheet from './embed-bottom-sheet';\n\n/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { _x } from '@wordpress/i18n';\nimport { useState, useEffect } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tuseBlockProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { View } from '@wordpress/primitives';\n\n// The inline preview feature will be released progressible, for this reason\n// the embed will only be considered previewable for the following providers list.\nconst PREVIEWABLE_PROVIDERS = [ 'youtube', 'twitter', 'instagram', 'vimeo' ];\n// Some providers are rendering the inline preview as a WordPress embed and\n// are not supported yet, so we need to disallow them with a fixed providers list.\nconst NOT_PREVIEWABLE_WP_EMBED_PROVIDERS = [ 'pinterest' ];\n\nconst WP_EMBED_TYPE = 'wp-embed';\n\nconst EmbedEdit = ( props ) => {\n\tconst {\n\t\tattributes: { align, providerNameSlug, previewable, responsive, url },\n\t\tattributes,\n\t\tisSelected,\n\t\tonReplace,\n\t\tsetAttributes,\n\t\tinsertBlocksAfter,\n\t\tonFocus,\n\t\tclientId,\n\t} = props;\n\n\tconst defaultEmbedInfo = {\n\t\ttitle: _x( 'Embed', 'block title' ),\n\t\ticon: embedContentIcon,\n\t};\n\tconst embedInfoByProvider = getEmbedInfoByProvider( providerNameSlug );\n\tconst { icon, title } = embedInfoByProvider || defaultEmbedInfo;\n\n\tconst { wasBlockJustInserted } = useSelect(\n\t\t( select ) => ( {\n\t\t\twasBlockJustInserted: select(\n\t\t\t\tblockEditorStore\n\t\t\t).wasBlockJustInserted( clientId, 'inserter_menu' ),\n\t\t} ),\n\t\t[ clientId ]\n\t);\n\tconst [ isEditingURL, setIsEditingURL ] = useState(\n\t\tisSelected && wasBlockJustInserted && ! url\n\t);\n\tconst [ showEmbedBottomSheet, setShowEmbedBottomSheet ] = useState(\n\t\tisEditingURL\n\t);\n\tconst { invalidateResolution } = useDispatch( coreStore );\n\n\tconst {\n\t\tpreview,\n\t\tfetching,\n\t\tthemeSupportsResponsive,\n\t\tcannotEmbed,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetEmbedPreview,\n\t\t\t\thasFinishedResolution,\n\t\t\t\tisPreviewEmbedFallback,\n\t\t\t\tgetThemeSupports,\n\t\t\t} = select( coreStore );\n\t\t\tif ( ! url ) {\n\t\t\t\treturn { fetching: false, cannotEmbed: false };\n\t\t\t}\n\n\t\t\tconst embedPreview = getEmbedPreview( url );\n\t\t\tconst hasResolvedEmbedPreview = hasFinishedResolution(\n\t\t\t\t'getEmbedPreview',\n\t\t\t\t[ url ]\n\t\t\t);\n\t\t\tconst previewIsFallback = isPreviewEmbedFallback( url );\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 `code` set to 404, rather\n\t\t\t// than generating a fallback response as other embeds do.\n\t\t\tconst wordpressCantEmbed = embedPreview?.code === '404';\n\t\t\tconst validPreview =\n\t\t\t\t!! embedPreview && ! badEmbedProvider && ! wordpressCantEmbed;\n\n\t\t\treturn {\n\t\t\t\tpreview: validPreview ? embedPreview : undefined,\n\t\t\t\tfetching: ! hasResolvedEmbedPreview,\n\t\t\t\tthemeSupportsResponsive: getThemeSupports()[\n\t\t\t\t\t'responsive-embeds'\n\t\t\t\t],\n\t\t\t\tcannotEmbed: ! validPreview || previewIsFallback,\n\t\t\t};\n\t\t},\n\t\t[ url ]\n\t);\n\n\t/**\n\t * Returns the attributes derived from the preview, merged with the current attributes.\n\t *\n\t * @param {boolean} ignorePreviousClassName Determines if the previous className attribute should be ignored when merging.\n\t * @return {Object} Merged attributes.\n\t */\n\tconst getMergedAttributes = ( ignorePreviousClassName = false ) => {\n\t\tconst { allowResponsive, className } = attributes;\n\t\treturn {\n\t\t\t...attributes,\n\t\t\t...getAttributesFromPreview(\n\t\t\t\tpreview,\n\t\t\t\ttitle,\n\t\t\t\tignorePreviousClassName ? undefined : className,\n\t\t\t\tresponsive,\n\t\t\t\tallowResponsive\n\t\t\t),\n\t\t};\n\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 || fetching ) {\n\t\t\treturn;\n\t\t}\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 = url.replace( /\\/$/, '' );\n\t\tsetIsEditingURL( false );\n\t\tsetAttributes( { url: newURL } );\n\t}, [ preview?.html, url ] );\n\n\t// Handle incoming preview\n\tuseEffect( () => {\n\t\tif ( preview && ! isEditingURL ) {\n\t\t\t// When obtaining an incoming preview, we set the attributes derived from\n\t\t\t// the preview data. In this case when getting the merged attributes,\n\t\t\t// we ignore the previous classname because it might not match the expected\n\t\t\t// classes by the new preview.\n\t\t\tsetAttributes( getMergedAttributes( true ) );\n\n\t\t\tif ( onReplace ) {\n\t\t\t\tconst upgradedBlock = createUpgradedEmbedBlock(\n\t\t\t\t\tprops,\n\t\t\t\t\tgetMergedAttributes()\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\tuseEffect( () => setShowEmbedBottomSheet( isEditingURL ), [\n\t\tisEditingURL,\n\t] );\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\tconst showEmbedPlaceholder = ! preview || cannotEmbed;\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\ttype,\n\t\tallowResponsive,\n\t\tclassName: classFromPreview,\n\t} = getMergedAttributes();\n\tconst className = classnames( classFromPreview, props.className );\n\n\tconst isProviderPreviewable =\n\t\tPREVIEWABLE_PROVIDERS.includes( providerNameSlug ) ||\n\t\t// For WordPress embeds, we enable the inline preview for all its providers\n\t\t// except the ones that are not supported yet.\n\t\t( WP_EMBED_TYPE === type &&\n\t\t\t! NOT_PREVIEWABLE_WP_EMBED_PROVIDERS.includes( providerNameSlug ) );\n\n\tconst bottomSheetLabel = WP_EMBED_TYPE === type ? 'WordPress' : title;\n\n\treturn (\n\t\t<>\n\t\t\t{ showEmbedPlaceholder ? (\n\t\t\t\t<>\n\t\t\t\t\t<EmbedControls\n\t\t\t\t\t\tshowEditButton={ cannotEmbed }\n\t\t\t\t\t\tswitchBackToURLInput={ () => setIsEditingURL( true ) }\n\t\t\t\t\t/>\n\t\t\t\t\t<View { ...blockProps }>\n\t\t\t\t\t\t<EmbedPlaceholder\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\t\tlabel={ title }\n\t\t\t\t\t\t\tonPress={ ( event ) => {\n\t\t\t\t\t\t\t\tonFocus( event );\n\t\t\t\t\t\t\t\tsetIsEditingURL( true );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tcannotEmbed={ cannotEmbed }\n\t\t\t\t\t\t\tfallback={ () => fallback( url, onReplace ) }\n\t\t\t\t\t\t\ttryAgain={ () => {\n\t\t\t\t\t\t\t\tinvalidateResolution( 'getEmbedPreview', [\n\t\t\t\t\t\t\t\t\turl,\n\t\t\t\t\t\t\t\t] );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</View>\n\t\t\t\t</>\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<EmbedControls\n\t\t\t\t\t\tshowEditButton={ preview && ! cannotEmbed }\n\t\t\t\t\t\tthemeSupportsResponsive={ themeSupportsResponsive }\n\t\t\t\t\t\tblockSupportsResponsive={ responsive }\n\t\t\t\t\t\tallowResponsive={ allowResponsive }\n\t\t\t\t\t\ttoggleResponsive={ toggleResponsive }\n\t\t\t\t\t\tswitchBackToURLInput={ () => setIsEditingURL( true ) }\n\t\t\t\t\t/>\n\t\t\t\t\t<View { ...blockProps }>\n\t\t\t\t\t\t<EmbedPreview\n\t\t\t\t\t\t\talign={ align }\n\t\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\t\tlabel={ title }\n\t\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\t\tpreview={ preview }\n\t\t\t\t\t\t\tisProviderPreviewable={ isProviderPreviewable }\n\t\t\t\t\t\t\tpreviewable={ previewable }\n\t\t\t\t\t\t\ttype={ type }\n\t\t\t\t\t\t\turl={ url }\n\t\t\t\t\t\t\tisDefaultEmbedInfo={ ! embedInfoByProvider }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</View>\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t<EmbedBottomSheet\n\t\t\t\tvalue={ url }\n\t\t\t\tlabel={ bottomSheetLabel }\n\t\t\t\tisVisible={ showEmbedBottomSheet }\n\t\t\t\tonClose={ () => setShowEmbedBottomSheet( false ) }\n\t\t\t\tonSubmit={ ( value ) => {\n\t\t\t\t\t// The order of the following calls is important, we need to update the URL attribute before changing `isEditingURL`,\n\t\t\t\t\t// otherwise the side-effect that potentially replaces the block when updating the local state won't use the new URL\n\t\t\t\t\t// for creating the new block.\n\t\t\t\t\tsetAttributes( { url: value } );\n\t\t\t\t\tsetIsEditingURL( false );\n\t\t\t\t} }\n\t\t\t/>\n\t\t</>\n\t);\n};\n\nexport default EmbedEdit;\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/embed/edit.native.js"],"names":["PREVIEWABLE_PROVIDERS","NOT_PREVIEWABLE_WP_EMBED_PROVIDERS","WP_EMBED_TYPE","EmbedEdit","props","attributes","align","providerNameSlug","previewable","responsive","url","isSelected","onReplace","setAttributes","insertBlocksAfter","onFocus","clientId","defaultEmbedInfo","title","icon","embedContentIcon","embedInfoByProvider","wasBlockJustInserted","select","blockEditorStore","isEditingURL","setIsEditingURL","showEmbedBottomSheet","setShowEmbedBottomSheet","invalidateResolution","coreStore","preview","fetching","themeSupportsResponsive","cannotEmbed","getEmbedPreview","hasFinishedResolution","isPreviewEmbedFallback","getThemeSupports","embedPreview","hasResolvedEmbedPreview","previewIsFallback","badEmbedProvider","html","type","undefined","wordpressCantEmbed","code","validPreview","getMergedAttributes","ignorePreviousClassName","allowResponsive","className","toggleResponsive","newAllowResponsive","newURL","replace","upgradedBlock","blockProps","showEmbedPlaceholder","classFromPreview","isProviderPreviewable","includes","bottomSheetLabel","event","value"],"mappings":";;;;;;;;;AA0BA;;AAvBA;;AAOA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAKA;;AAEA;;AACA;;AAIA;;AACA;;AAjCA;AACA;AACA;;AAeA;AACA;AACA;;AAGA;AACA;AACA;AAWA;AACA;AACA,MAAMA,qBAAqB,GAAG,CAAE,SAAF,EAAa,SAAb,EAAwB,WAAxB,EAAqC,OAArC,CAA9B,C,CACA;AACA;;AACA,MAAMC,kCAAkC,GAAG,CAAE,WAAF,CAA3C;AAEA,MAAMC,aAAa,GAAG,UAAtB;;AAEA,MAAMC,SAAS,GAAKC,KAAF,IAAa;AAC9B,QAAM;AACLC,IAAAA,UAAU,EAAE;AAAEC,MAAAA,KAAF;AAASC,MAAAA,gBAAT;AAA2BC,MAAAA,WAA3B;AAAwCC,MAAAA,UAAxC;AAAoDC,MAAAA;AAApD,KADP;AAELL,IAAAA,UAFK;AAGLM,IAAAA,UAHK;AAILC,IAAAA,SAJK;AAKLC,IAAAA,aALK;AAMLC,IAAAA,iBANK;AAOLC,IAAAA,OAPK;AAQLC,IAAAA;AARK,MASFZ,KATJ;AAWA,QAAMa,gBAAgB,GAAG;AACxBC,IAAAA,KAAK,EAAE,cAAI,OAAJ,EAAa,aAAb,CADiB;AAExBC,IAAAA,IAAI,EAAEC;AAFkB,GAAzB;AAIA,QAAMC,mBAAmB,GAAG,kCAAwBd,gBAAxB,CAA5B;AACA,QAAM;AAAEY,IAAAA,IAAF;AAAQD,IAAAA;AAAR,MAAkBG,mBAAmB,IAAIJ,gBAA/C;AAEA,QAAM;AAAEK,IAAAA;AAAF,MAA2B,qBAC9BC,MAAF,KAAgB;AACfD,IAAAA,oBAAoB,EAAEC,MAAM,CAC3BC,kBAD2B,CAAN,CAEpBF,oBAFoB,CAEEN,Q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,EAAGpD,KADT;AAEC,IAAA,SAAS,EAAG8C,SAFb;AAGC,IAAA,QAAQ,EAAGpC,QAHZ;AAIC,IAAA,IAAI,EAAGG,IAJR;AAKC,IAAA,iBAAiB,EAAGL,iBALrB;AAMC,IAAA,UAAU,EAAGH,UANd;AAOC,IAAA,KAAK,EAAGO,KAPT;AAQC,IAAA,OAAO,EAAGH,OARX;AASC,IAAA,OAAO,EAAGgB,OATX;AAUC,IAAA,qBAAqB,EAAG8B,qBAVzB;AAWC,IAAA,WAAW,EAAGrD,WAXf;AAYC,IAAA,IAAI,EAAGoC,IAZR;AAaC,IAAA,GAAG,EAAGlC,GAbP;AAcC,IAAA,kBAAkB,EAAG,CAAEW;AAdxB,IADD,CATD,CA3BF,EAwDC,4BAAC,yBAAD;AACC,IAAA,KAAK,EAAGX,GADT;AAEC,IAAA,KAAK,EAAGqD,gBAFT;AAGC,IAAA,SAAS,EAAGpC,oBAHb;AAIC,IAAA,OAAO,EAAG,MAAMC,uBAAuB,CAAE,KAAF,CAJxC;AAKC,IAAA,QAAQ,EAAKqC,KAAF,IAAa;AACvB;AACA;AACA;AACApD,MAAAA,aAAa,CAAE;AAAEH,QAAAA,GAAG,EAAEuD;AAAP,OAAF,CAAb;AACAvC,MAAAA,eAAe,CAAE,KAAF,CAAf;AACA;AAXF,IAxDD,CADD;AAwEA,CAtQD;;eAwQevB,S","sourcesContent":["/**\n * Internal dependencies\n */\nimport {\n\tcreateUpgradedEmbedBlock,\n\tgetClassNames,\n\tfallback,\n\tgetAttributesFromPreview,\n\tgetEmbedInfoByProvider,\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';\nimport EmbedBottomSheet from './embed-bottom-sheet';\n\n/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { _x } from '@wordpress/i18n';\nimport { useState, useEffect } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tuseBlockProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { View } from '@wordpress/primitives';\n\n// The inline preview feature will be released progressible, for this reason\n// the embed will only be considered previewable for the following providers list.\nconst PREVIEWABLE_PROVIDERS = [ 'youtube', 'twitter', 'instagram', 'vimeo' ];\n// Some providers are rendering the inline preview as a WordPress embed and\n// are not supported yet, so we need to disallow them with a fixed providers list.\nconst NOT_PREVIEWABLE_WP_EMBED_PROVIDERS = [ 'pinterest' ];\n\nconst WP_EMBED_TYPE = 'wp-embed';\n\nconst EmbedEdit = ( props ) => {\n\tconst {\n\t\tattributes: { align, providerNameSlug, previewable, responsive, url },\n\t\tattributes,\n\t\tisSelected,\n\t\tonReplace,\n\t\tsetAttributes,\n\t\tinsertBlocksAfter,\n\t\tonFocus,\n\t\tclientId,\n\t} = props;\n\n\tconst defaultEmbedInfo = {\n\t\ttitle: _x( 'Embed', 'block title' ),\n\t\ticon: embedContentIcon,\n\t};\n\tconst embedInfoByProvider = getEmbedInfoByProvider( providerNameSlug );\n\tconst { icon, title } = embedInfoByProvider || defaultEmbedInfo;\n\n\tconst { wasBlockJustInserted } = useSelect(\n\t\t( select ) => ( {\n\t\t\twasBlockJustInserted: select(\n\t\t\t\tblockEditorStore\n\t\t\t).wasBlockJustInserted( clientId, 'inserter_menu' ),\n\t\t} ),\n\t\t[ clientId ]\n\t);\n\tconst [ isEditingURL, setIsEditingURL ] = useState(\n\t\tisSelected && wasBlockJustInserted && ! url\n\t);\n\tconst [ showEmbedBottomSheet, setShowEmbedBottomSheet ] = useState(\n\t\tisEditingURL\n\t);\n\tconst { invalidateResolution } = useDispatch( coreStore );\n\n\tconst {\n\t\tpreview,\n\t\tfetching,\n\t\tthemeSupportsResponsive,\n\t\tcannotEmbed,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetEmbedPreview,\n\t\t\t\thasFinishedResolution,\n\t\t\t\tisPreviewEmbedFallback,\n\t\t\t\tgetThemeSupports,\n\t\t\t} = select( coreStore );\n\t\t\tif ( ! url ) {\n\t\t\t\treturn { fetching: false, cannotEmbed: false };\n\t\t\t}\n\n\t\t\tconst embedPreview = getEmbedPreview( url );\n\t\t\tconst hasResolvedEmbedPreview = hasFinishedResolution(\n\t\t\t\t'getEmbedPreview',\n\t\t\t\t[ url ]\n\t\t\t);\n\t\t\tconst previewIsFallback = isPreviewEmbedFallback( url );\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 `code` set to 404, rather\n\t\t\t// than generating a fallback response as other embeds do.\n\t\t\tconst wordpressCantEmbed = embedPreview?.code === '404';\n\t\t\tconst validPreview =\n\t\t\t\t!! embedPreview && ! badEmbedProvider && ! wordpressCantEmbed;\n\n\t\t\treturn {\n\t\t\t\tpreview: validPreview ? embedPreview : undefined,\n\t\t\t\tfetching: ! hasResolvedEmbedPreview,\n\t\t\t\tthemeSupportsResponsive: getThemeSupports()[\n\t\t\t\t\t'responsive-embeds'\n\t\t\t\t],\n\t\t\t\tcannotEmbed: ! validPreview || previewIsFallback,\n\t\t\t};\n\t\t},\n\t\t[ url ]\n\t);\n\n\t/**\n\t * Returns the attributes derived from the preview, merged with the current attributes.\n\t *\n\t * @param {boolean} ignorePreviousClassName Determines if the previous className attribute should be ignored when merging.\n\t * @return {Object} Merged attributes.\n\t */\n\tconst getMergedAttributes = ( ignorePreviousClassName = false ) => {\n\t\tconst { allowResponsive, className } = attributes;\n\t\treturn {\n\t\t\t...attributes,\n\t\t\t...getAttributesFromPreview(\n\t\t\t\tpreview,\n\t\t\t\ttitle,\n\t\t\t\tignorePreviousClassName ? undefined : className,\n\t\t\t\tresponsive,\n\t\t\t\tallowResponsive\n\t\t\t),\n\t\t};\n\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 || fetching ) {\n\t\t\treturn;\n\t\t}\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 = url.replace( /\\/$/, '' );\n\t\tsetIsEditingURL( false );\n\t\tsetAttributes( { url: newURL } );\n\t}, [ preview?.html, url ] );\n\n\t// Handle incoming preview\n\tuseEffect( () => {\n\t\tif ( preview && ! isEditingURL ) {\n\t\t\t// When obtaining an incoming preview, we set the attributes derived from\n\t\t\t// the preview data. In this case when getting the merged attributes,\n\t\t\t// we ignore the previous classname because it might not match the expected\n\t\t\t// classes by the new preview.\n\t\t\tsetAttributes( getMergedAttributes( true ) );\n\n\t\t\tif ( onReplace ) {\n\t\t\t\tconst upgradedBlock = createUpgradedEmbedBlock(\n\t\t\t\t\tprops,\n\t\t\t\t\tgetMergedAttributes()\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\tuseEffect( () => setShowEmbedBottomSheet( isEditingURL ), [\n\t\tisEditingURL,\n\t] );\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\tconst showEmbedPlaceholder = ! preview || cannotEmbed;\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\ttype,\n\t\tallowResponsive,\n\t\tclassName: classFromPreview,\n\t} = getMergedAttributes();\n\tconst className = classnames( classFromPreview, props.className );\n\n\tconst isProviderPreviewable =\n\t\tPREVIEWABLE_PROVIDERS.includes( providerNameSlug ) ||\n\t\t// For WordPress embeds, we enable the inline preview for all its providers\n\t\t// except the ones that are not supported yet.\n\t\t( WP_EMBED_TYPE === type &&\n\t\t\t! NOT_PREVIEWABLE_WP_EMBED_PROVIDERS.includes( providerNameSlug ) );\n\n\tconst bottomSheetLabel = WP_EMBED_TYPE === type ? 'WordPress' : title;\n\n\treturn (\n\t\t<>\n\t\t\t{ showEmbedPlaceholder ? (\n\t\t\t\t<>\n\t\t\t\t\t<EmbedControls\n\t\t\t\t\t\tshowEditButton={ cannotEmbed }\n\t\t\t\t\t\tswitchBackToURLInput={ () => setIsEditingURL( true ) }\n\t\t\t\t\t/>\n\t\t\t\t\t<View { ...blockProps }>\n\t\t\t\t\t\t<EmbedPlaceholder\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\t\tlabel={ title }\n\t\t\t\t\t\t\tonPress={ ( event ) => {\n\t\t\t\t\t\t\t\tonFocus( event );\n\t\t\t\t\t\t\t\tsetIsEditingURL( true );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tcannotEmbed={ cannotEmbed }\n\t\t\t\t\t\t\tfallback={ () => fallback( url, onReplace ) }\n\t\t\t\t\t\t\ttryAgain={ () => {\n\t\t\t\t\t\t\t\tinvalidateResolution( 'getEmbedPreview', [\n\t\t\t\t\t\t\t\t\turl,\n\t\t\t\t\t\t\t\t] );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</View>\n\t\t\t\t</>\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<EmbedControls\n\t\t\t\t\t\tshowEditButton={ preview && ! cannotEmbed }\n\t\t\t\t\t\tthemeSupportsResponsive={ themeSupportsResponsive }\n\t\t\t\t\t\tblockSupportsResponsive={ responsive }\n\t\t\t\t\t\tallowResponsive={ allowResponsive }\n\t\t\t\t\t\ttoggleResponsive={ toggleResponsive }\n\t\t\t\t\t\tswitchBackToURLInput={ () => setIsEditingURL( true ) }\n\t\t\t\t\t/>\n\t\t\t\t\t<View { ...blockProps }>\n\t\t\t\t\t\t<EmbedPreview\n\t\t\t\t\t\t\talign={ align }\n\t\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\t\tlabel={ title }\n\t\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\t\tpreview={ preview }\n\t\t\t\t\t\t\tisProviderPreviewable={ isProviderPreviewable }\n\t\t\t\t\t\t\tpreviewable={ previewable }\n\t\t\t\t\t\t\ttype={ type }\n\t\t\t\t\t\t\turl={ url }\n\t\t\t\t\t\t\tisDefaultEmbedInfo={ ! embedInfoByProvider }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</View>\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t<EmbedBottomSheet\n\t\t\t\tvalue={ url }\n\t\t\t\tlabel={ bottomSheetLabel }\n\t\t\t\tisVisible={ showEmbedBottomSheet }\n\t\t\t\tonClose={ () => setShowEmbedBottomSheet( false ) }\n\t\t\t\tonSubmit={ ( value ) => {\n\t\t\t\t\t// The order of the following calls is important, we need to update the URL attribute before changing `isEditingURL`,\n\t\t\t\t\t// otherwise the side-effect that potentially replaces the block when updating the local state won't use the new URL\n\t\t\t\t\t// for creating the new block.\n\t\t\t\t\tsetAttributes( { url: value } );\n\t\t\t\t\tsetIsEditingURL( false );\n\t\t\t\t} }\n\t\t\t/>\n\t\t</>\n\t);\n};\n\nexport default EmbedEdit;\n"]}
|
|
@@ -20,13 +20,14 @@ var _notices = require("@wordpress/notices");
|
|
|
20
20
|
/**
|
|
21
21
|
* WordPress dependencies
|
|
22
22
|
*/
|
|
23
|
-
const EmbedBottomSheet =
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
const EmbedBottomSheet = _ref => {
|
|
24
|
+
let {
|
|
25
|
+
value,
|
|
26
|
+
label,
|
|
27
|
+
isVisible,
|
|
28
|
+
onClose,
|
|
29
|
+
onSubmit
|
|
30
|
+
} = _ref;
|
|
30
31
|
const [url, setURL] = (0, _element.useState)(value);
|
|
31
32
|
const {
|
|
32
33
|
createErrorNotice
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/embed/embed-bottom-sheet.native.js"],"names":["EmbedBottomSheet","value","label","isVisible","onClose","onSubmit","url","setURL","createErrorNotice","noticesStore","linkSettingsOptions","placeholder","autoFocus","autoFill","footer","separatorType","onDismiss","setAttributes","attributes"],"mappings":";;;;;;;AAWA;;AARA;;AACA;;AAIA;;AACA;;AACA;;AAVA;AACA;AACA;AAWA,MAAMA,gBAAgB,GAAG,
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/embed/embed-bottom-sheet.native.js"],"names":["EmbedBottomSheet","value","label","isVisible","onClose","onSubmit","url","setURL","createErrorNotice","noticesStore","linkSettingsOptions","placeholder","autoFocus","autoFill","footer","separatorType","onDismiss","setAttributes","attributes"],"mappings":";;;;;;;AAWA;;AARA;;AACA;;AAIA;;AACA;;AACA;;AAVA;AACA;AACA;AAWA,MAAMA,gBAAgB,GAA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,CAAN;AACA;;AAED,SACC,4BAAC,kCAAD;AACC,IAAA,SAAS,EAAGH,SADb;AAEC,IAAA,GAAG,EAAGG,GAFP;AAGC,IAAA,OAAO,EAAGF,OAHX;AAIC,IAAA,SAAS,EAAGY,SAJb;AAKC,IAAA,aAAa,EAAGC,aALjB;AAMC,IAAA,OAAO,EAAGP,mBANX;AAOC,IAAA,MAAM,EAAC,sBAPR;AAQC,IAAA,eAAe,MARhB;AASC,IAAA,QAAQ;AATT,IADD;AAaA,CA9DD;;eAgEeV,gB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tLinkSettingsNavigation,\n\tFooterMessageLink,\n} from '@wordpress/components';\nimport { isURL } from '@wordpress/url';\nimport { useDispatch } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { useCallback, useState } from '@wordpress/element';\n\nconst EmbedBottomSheet = ( { value, label, isVisible, onClose, onSubmit } ) => {\n\tconst [ url, setURL ] = useState( value );\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\n\tconst linkSettingsOptions = {\n\t\turl: {\n\t\t\tlabel: sprintf(\n\t\t\t\t// translators: %s: embed block variant's label e.g: \"Twitter\".\n\t\t\t\t__( '%s link' ),\n\t\t\t\tlabel\n\t\t\t),\n\t\t\tplaceholder: __( 'Add link' ),\n\t\t\tautoFocus: true,\n\t\t\tautoFill: true,\n\t\t},\n\t\tfooter: {\n\t\t\tlabel: (\n\t\t\t\t<FooterMessageLink\n\t\t\t\t\thref={ __(\n\t\t\t\t\t\t'https://wordpress.org/support/article/embeds/'\n\t\t\t\t\t) }\n\t\t\t\t\tvalue={ __( 'Learn more about embeds' ) }\n\t\t\t\t/>\n\t\t\t),\n\t\t\tseparatorType: 'topFullWidth',\n\t\t},\n\t};\n\n\tconst onDismiss = useCallback( () => {\n\t\tif ( url !== '' ) {\n\t\t\tif ( isURL( url ) ) {\n\t\t\t\tonSubmit( url );\n\t\t\t} else {\n\t\t\t\tcreateErrorNotice(\n\t\t\t\t\t__( 'Invalid URL. Please enter a valid URL.' )\n\t\t\t\t);\n\t\t\t\t// If the URL was already defined, we submit it to stop showing the embed placeholder.\n\t\t\t\tonSubmit( value );\n\t\t\t}\n\t\t} else {\n\t\t\t// Resets the URL when new value is empty\n\t\t\tonSubmit( '' );\n\t\t}\n\t}, [ url, onSubmit, value ] );\n\n\tfunction setAttributes( attributes ) {\n\t\tsetURL( attributes.url );\n\t}\n\n\treturn (\n\t\t<LinkSettingsNavigation\n\t\t\tisVisible={ isVisible }\n\t\t\turl={ url }\n\t\t\tonClose={ onClose }\n\t\t\tonDismiss={ onDismiss }\n\t\t\tsetAttributes={ setAttributes }\n\t\t\toptions={ linkSettingsOptions }\n\t\t\ttestID=\"embed-edit-url-modal\"\n\t\t\twithBottomSheet\n\t\t\tshowIcon\n\t\t/>\n\t);\n};\n\nexport default EmbedBottomSheet;\n"]}
|
|
@@ -22,27 +22,30 @@ function getResponsiveHelp(checked) {
|
|
|
22
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.');
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
const EmbedControls =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
25
|
+
const EmbedControls = _ref => {
|
|
26
|
+
let {
|
|
27
|
+
blockSupportsResponsive,
|
|
28
|
+
showEditButton,
|
|
29
|
+
themeSupportsResponsive,
|
|
30
|
+
allowResponsive,
|
|
31
|
+
toggleResponsive,
|
|
32
|
+
switchBackToURLInput
|
|
33
|
+
} = _ref;
|
|
34
|
+
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_blockEditor.BlockControls, null, (0, _element.createElement)(_components.ToolbarGroup, null, showEditButton && (0, _element.createElement)(_components.ToolbarButton, {
|
|
35
|
+
className: "components-toolbar__control",
|
|
36
|
+
label: (0, _i18n.__)('Edit URL'),
|
|
37
|
+
icon: _icons.edit,
|
|
38
|
+
onClick: switchBackToURLInput
|
|
39
|
+
}))), themeSupportsResponsive && blockSupportsResponsive && (0, _element.createElement)(_blockEditor.InspectorControls, null, (0, _element.createElement)(_components.PanelBody, {
|
|
40
|
+
title: (0, _i18n.__)('Media settings'),
|
|
41
|
+
className: "blocks-responsive"
|
|
42
|
+
}, (0, _element.createElement)(_components.ToggleControl, {
|
|
43
|
+
label: (0, _i18n.__)('Resize for smaller devices'),
|
|
44
|
+
checked: allowResponsive,
|
|
45
|
+
help: getResponsiveHelp,
|
|
46
|
+
onChange: toggleResponsive
|
|
47
|
+
}))));
|
|
48
|
+
};
|
|
46
49
|
|
|
47
50
|
var _default = EmbedControls;
|
|
48
51
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/embed/embed-controls.js"],"names":["getResponsiveHelp","checked","EmbedControls","blockSupportsResponsive","showEditButton","themeSupportsResponsive","allowResponsive","toggleResponsive","switchBackToURLInput","edit"],"mappings":";;;;;;;;;AAGA;;AACA;;AAMA;;AACA;;AAXA;AACA;AACA;AAWA,SAASA,iBAAT,CAA4BC,OAA5B,EAAsC;AACrC,SAAOA,OAAO,GACX,cACA,wEADA,CADW,GAIX,cACA,2EADA,CAJH;AAOA;;AAED,MAAMC,aAAa,GAAG,
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/embed/embed-controls.js"],"names":["getResponsiveHelp","checked","EmbedControls","blockSupportsResponsive","showEditButton","themeSupportsResponsive","allowResponsive","toggleResponsive","switchBackToURLInput","edit"],"mappings":";;;;;;;;;AAGA;;AACA;;AAMA;;AACA;;AAXA;AACA;AACA;AAWA,SAASA,iBAAT,CAA4BC,OAA5B,EAAsC;AACrC,SAAOA,OAAO,GACX,cACA,wEADA,CADW,GAIX,cACA,2EADA,CAJH;AAOA;;AAED,MAAMC,aAAa,GAAG;AAAA,MAAE;AACvBC,IAAAA,uBADuB;AAEvBC,IAAAA,cAFuB;AAGvBC,IAAAA,uBAHuB;AAIvBC,IAAAA,eAJuB;AAKvBC,IAAAA,gBALuB;AAMvBC,IAAAA;AANuB,GAAF;AAAA,SAQrB,qDACC,4BAAC,0BAAD,QACC,4BAAC,wBAAD,QACGJ,cAAc,IACf,4BAAC,yBAAD;AACC,IAAA,SAAS,EAAC,6BADX;AAEC,IAAA,KAAK,EAAG,cAAI,UAAJ,CAFT;AAGC,IAAA,IAAI,EAAGK,WAHR;AAIC,IAAA,OAAO,EAAGD;AAJX,IAFF,CADD,CADD,EAaGH,uBAAuB,IAAIF,uBAA3B,IACD,4BAAC,8BAAD,QACC,4BAAC,qBAAD;AACC,IAAA,KAAK,EAAG,cAAI,gBAAJ,CADT;AAEC,IAAA,SAAS,EAAC;AAFX,KAIC,4BAAC,yBAAD;AACC,IAAA,KAAK,EAAG,cAAI,4BAAJ,CADT;AAEC,IAAA,OAAO,EAAGG,eAFX;AAGC,IAAA,IAAI,EAAGN,iBAHR;AAIC,IAAA,QAAQ,EAAGO;AAJZ,IAJD,CADD,CAdF,CARqB;AAAA,CAAtB;;eAuCeL,a","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tToolbarButton,\n\tPanelBody,\n\tToggleControl,\n\tToolbarGroup,\n} from '@wordpress/components';\nimport { BlockControls, InspectorControls } from '@wordpress/block-editor';\nimport { edit } from '@wordpress/icons';\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\t<>\n\t\t<BlockControls>\n\t\t\t<ToolbarGroup>\n\t\t\t\t{ showEditButton && (\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\tclassName=\"components-toolbar__control\"\n\t\t\t\t\t\tlabel={ __( 'Edit URL' ) }\n\t\t\t\t\t\ticon={ edit }\n\t\t\t\t\t\tonClick={ switchBackToURLInput }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</ToolbarGroup>\n\t\t</BlockControls>\n\t\t{ themeSupportsResponsive && blockSupportsResponsive && (\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody\n\t\t\t\t\ttitle={ __( 'Media settings' ) }\n\t\t\t\t\tclassName=\"blocks-responsive\"\n\t\t\t\t>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\tlabel={ __( 'Resize for smaller devices' ) }\n\t\t\t\t\t\tchecked={ allowResponsive }\n\t\t\t\t\t\thelp={ getResponsiveHelp }\n\t\t\t\t\t\tonChange={ toggleResponsive }\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t) }\n\t</>\n);\n\nexport default EmbedControls;\n"]}
|
|
@@ -42,14 +42,15 @@ var _styles = _interopRequireDefault(require("./styles.scss"));
|
|
|
42
42
|
/**
|
|
43
43
|
* Internal dependencies
|
|
44
44
|
*/
|
|
45
|
-
const EmbedNoPreview =
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
45
|
+
const EmbedNoPreview = _ref => {
|
|
46
|
+
let {
|
|
47
|
+
label,
|
|
48
|
+
icon,
|
|
49
|
+
isSelected,
|
|
50
|
+
onPress,
|
|
51
|
+
previewable,
|
|
52
|
+
isDefaultEmbedInfo
|
|
53
|
+
} = _ref;
|
|
53
54
|
const shouldRequestReview = (0, _element.useRef)(false);
|
|
54
55
|
const [isSheetVisible, setIsSheetVisible] = (0, _element.useState)(false);
|
|
55
56
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/embed/embed-no-preview.native.js"],"names":["EmbedNoPreview","label","icon","isSelected","onPress","previewable","isDefaultEmbedInfo","shouldRequestReview","isSheetVisible","setIsSheetVisible","postType","select","editorStore","getEditedPostAttribute","containerStyle","styles","embed__container","labelStyle","embed__label","descriptionStyle","embed__description","helpIconStyle","sheetIconStyle","sheetTitleStyle","sheetDescriptionStyle","sheetButtonStyle","previewButtonA11yHint","previewButtonText","comingSoonDescription","onOpenSheet","onCloseSheet","onDismissSheet","current","onPressContainer","onPressHelp","embedNoProviderPreview","embed__action","toUpperCase","help","fill","width"],"mappings":";;;;;;;;;AAWA;;AARA;;AAKA;;AAEA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAvBA;AACA;AACA;;AAGA;AACA;AACA;;AAaA;AACA;AACA;AAGA,MAAMA,cAAc,GAAG,CAAE;AACxBC,EAAAA,KADwB;AAExBC,EAAAA,IAFwB;AAGxBC,EAAAA,UAHwB;AAIxBC,EAAAA,OAJwB;AAKxBC,EAAAA,WALwB;AAMxBC,EAAAA;AANwB,CAAF,KAOhB;AACN,QAAMC,mBAAmB,GAAG,qBAAQ,KAAR,CAA5B;AACA,QAAM,CAAEC,cAAF,EAAkBC,iBAAlB,IAAwC,uBAAU,KAAV,CAA9C;AAEA,QAAM;AAAEC,IAAAA;AAAF,MAAe,qBAAaC,MAAF,KAAgB;AAC/CD,IAAAA,QAAQ,EAAEC,MAAM,CAAEC,aAAF,CAAN,CAAsBC,sBAAtB,CAA8C,MAA9C;AADqC,GAAhB,CAAX,CAArB;AAIA,QAAMC,cAAc,GAAG,2CACtBC,gBAAOC,gBADe,EAEtBD,gBAAQ,wBAAR,CAFsB,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AD;AAAM,IAAA,KAAK,EAAGe;AAAd,KACG,cAAI,sBAAJ,CADH,CAFD,CAJF,CADD;AAcA,CAtMD;;eAwMejB,c","sourcesContent":["/**\n * External dependencies\n */\nimport { TouchableOpacity, TouchableWithoutFeedback, Text } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { View } from '@wordpress/primitives';\n\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useRef, useState } from '@wordpress/element';\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\nimport { requestPreview } from '@wordpress/react-native-bridge';\nimport { useSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { BottomSheet, Icon, TextControl } from '@wordpress/components';\nimport { help } from '@wordpress/icons';\nimport { BlockIcon } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport styles from './styles.scss';\n\nconst EmbedNoPreview = ( {\n\tlabel,\n\ticon,\n\tisSelected,\n\tonPress,\n\tpreviewable,\n\tisDefaultEmbedInfo,\n} ) => {\n\tconst shouldRequestReview = useRef( false );\n\tconst [ isSheetVisible, setIsSheetVisible ] = useState( false );\n\n\tconst { postType } = useSelect( ( select ) => ( {\n\t\tpostType: select( editorStore ).getEditedPostAttribute( 'type' ),\n\t} ) );\n\n\tconst containerStyle = usePreferredColorSchemeStyle(\n\t\tstyles.embed__container,\n\t\tstyles[ 'embed__container--dark' ]\n\t);\n\tconst labelStyle = usePreferredColorSchemeStyle(\n\t\tstyles.embed__label,\n\t\tstyles[ 'embed__label--dark' ]\n\t);\n\tconst descriptionStyle = usePreferredColorSchemeStyle(\n\t\tstyles.embed__description,\n\t\tstyles[ 'embed__description--dark' ]\n\t);\n\tconst helpIconStyle = usePreferredColorSchemeStyle(\n\t\tstyles[ 'embed-no-preview__help-icon' ],\n\t\tstyles[ 'embed-no-preview__help-icon--dark' ]\n\t);\n\n\tconst sheetIconStyle = usePreferredColorSchemeStyle(\n\t\tstyles[ 'embed-no-preview__sheet-icon' ],\n\t\tstyles[ 'embed-no-preview__sheet-icon--dark' ]\n\t);\n\tconst sheetTitleStyle = usePreferredColorSchemeStyle(\n\t\tstyles[ 'embed-no-preview__sheet-title' ],\n\t\tstyles[ 'embed-no-preview__sheet-title--dark' ]\n\t);\n\tconst sheetDescriptionStyle = usePreferredColorSchemeStyle(\n\t\tstyles[ 'embed-no-preview__sheet-description' ],\n\t\tstyles[ 'embed-no-preview__sheet-description--dark' ]\n\t);\n\tconst sheetButtonStyle = usePreferredColorSchemeStyle(\n\t\tstyles[ 'embed-no-preview__sheet-button' ],\n\t\tstyles[ 'embed-no-preview__sheet-button--dark' ]\n\t);\n\n\tconst previewButtonA11yHint =\n\t\tpostType === 'page'\n\t\t\t? __( 'Double tap to preview page.' )\n\t\t\t: __( 'Double tap to preview post.' );\n\tconst previewButtonText =\n\t\tpostType === 'page' ? __( 'Preview page' ) : __( 'Preview post' );\n\tconst comingSoonDescription =\n\t\tpostType === 'page'\n\t\t\t? sprintf(\n\t\t\t\t\t// translators: %s: embed block variant's label e.g: \"Twitter\".\n\t\t\t\t\t__(\n\t\t\t\t\t\t'We’re working hard on adding support for %s previews. In the meantime, you can preview the embedded content on the page.'\n\t\t\t\t\t),\n\t\t\t\t\tlabel\n\t\t\t )\n\t\t\t: sprintf(\n\t\t\t\t\t// translators: %s: embed block variant's label e.g: \"Twitter\".\n\t\t\t\t\t__(\n\t\t\t\t\t\t'We’re working hard on adding support for %s previews. In the meantime, you can preview the embedded content on the post.'\n\t\t\t\t\t),\n\t\t\t\t\tlabel\n\t\t\t );\n\n\tfunction onOpenSheet() {\n\t\tsetIsSheetVisible( true );\n\t}\n\n\tfunction onCloseSheet() {\n\t\tsetIsSheetVisible( false );\n\t}\n\n\tfunction onDismissSheet() {\n\t\t// The preview request has to be done after the bottom sheet modal is dismissed,\n\t\t// otherwise the preview native modal is not displayed.\n\t\tif ( shouldRequestReview.current ) {\n\t\t\trequestPreview();\n\t\t}\n\t\tshouldRequestReview.current = false;\n\t}\n\n\tfunction onPressContainer() {\n\t\tonPress();\n\t\tonOpenSheet();\n\t}\n\n\tfunction onPressHelp() {\n\t\tonPressContainer();\n\t}\n\n\tconst embedNoProviderPreview = (\n\t\t<>\n\t\t\t<TouchableWithoutFeedback\n\t\t\t\taccessibilityRole={ 'button' }\n\t\t\t\taccessibilityHint={ previewButtonA11yHint }\n\t\t\t\tdisabled={ ! isSelected }\n\t\t\t\tonPress={ onPressContainer }\n\t\t\t>\n\t\t\t\t<View style={ containerStyle }>\n\t\t\t\t\t<BlockIcon icon={ icon } />\n\t\t\t\t\t<Text style={ labelStyle }>{ label }</Text>\n\t\t\t\t\t<Text style={ descriptionStyle }>\n\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t// translators: %s: embed block variant's label e.g: \"Twitter\".\n\t\t\t\t\t\t\t__( '%s previews not yet available' ),\n\t\t\t\t\t\t\tlabel\n\t\t\t\t\t\t) }\n\t\t\t\t\t</Text>\n\t\t\t\t\t<Text style={ styles.embed__action }>\n\t\t\t\t\t\t{ previewButtonText.toUpperCase() }\n\t\t\t\t\t</Text>\n\t\t\t\t\t<TouchableOpacity\n\t\t\t\t\t\taccessibilityHint={ __( 'Tap here to show help' ) }\n\t\t\t\t\t\taccessibilityLabel={ __( 'Help button' ) }\n\t\t\t\t\t\taccessibilityRole={ 'button' }\n\t\t\t\t\t\tdisabled={ ! isSelected }\n\t\t\t\t\t\tonPress={ onPressHelp }\n\t\t\t\t\t\tstyle={ helpIconStyle }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\ticon={ help }\n\t\t\t\t\t\t\tfill={ helpIconStyle.fill }\n\t\t\t\t\t\t\tsize={ helpIconStyle.width }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</TouchableOpacity>\n\t\t\t\t</View>\n\t\t\t</TouchableWithoutFeedback>\n\t\t\t<BottomSheet\n\t\t\t\tisVisible={ isSheetVisible }\n\t\t\t\thideHeader\n\t\t\t\tonDismiss={ onDismissSheet }\n\t\t\t\tonClose={ onCloseSheet }\n\t\t\t\ttestID=\"embed-no-preview-modal\"\n\t\t\t>\n\t\t\t\t<View style={ styles[ 'embed-no-preview__container' ] }>\n\t\t\t\t\t<View style={ sheetIconStyle }>\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\ticon={ help }\n\t\t\t\t\t\t\tfill={ sheetIconStyle.fill }\n\t\t\t\t\t\t\tsize={ sheetIconStyle.width }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</View>\n\t\t\t\t\t<Text style={ sheetTitleStyle }>\n\t\t\t\t\t\t{ isDefaultEmbedInfo\n\t\t\t\t\t\t\t? __( 'Embed block previews are coming soon' )\n\t\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t\t// translators: %s: embed block variant's label e.g: \"Twitter\".\n\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t'%s embed block previews are coming soon'\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tlabel\n\t\t\t\t\t\t\t ) }\n\t\t\t\t\t</Text>\n\t\t\t\t\t<Text style={ sheetDescriptionStyle }>\n\t\t\t\t\t\t{ comingSoonDescription }\n\t\t\t\t\t</Text>\n\t\t\t\t</View>\n\t\t\t\t<TextControl\n\t\t\t\t\tlabel={ previewButtonText }\n\t\t\t\t\tseparatorType=\"topFullWidth\"\n\t\t\t\t\tonPress={ () => {\n\t\t\t\t\t\tshouldRequestReview.current = true;\n\t\t\t\t\t\tonCloseSheet();\n\t\t\t\t\t} }\n\t\t\t\t\tlabelStyle={ sheetButtonStyle }\n\t\t\t\t/>\n\t\t\t\t<TextControl\n\t\t\t\t\tlabel={ __( 'Dismiss' ) }\n\t\t\t\t\tseparatorType=\"topFullWidth\"\n\t\t\t\t\tonPress={ onCloseSheet }\n\t\t\t\t\tlabelStyle={ sheetButtonStyle }\n\t\t\t\t/>\n\t\t\t</BottomSheet>\n\t\t</>\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t{ previewable ? (\n\t\t\t\tembedNoProviderPreview\n\t\t\t) : (\n\t\t\t\t<View style={ containerStyle }>\n\t\t\t\t\t<BlockIcon icon={ icon } />\n\t\t\t\t\t<Text style={ labelStyle }>\n\t\t\t\t\t\t{ __( 'No preview available' ) }\n\t\t\t\t\t</Text>\n\t\t\t\t</View>\n\t\t\t) }\n\t\t</>\n\t);\n};\n\nexport default EmbedNoPreview;\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/embed/embed-no-preview.native.js"],"names":["EmbedNoPreview","label","icon","isSelected","onPress","previewable","isDefaultEmbedInfo","shouldRequestReview","isSheetVisible","setIsSheetVisible","postType","select","editorStore","getEditedPostAttribute","containerStyle","styles","embed__container","labelStyle","embed__label","descriptionStyle","embed__description","helpIconStyle","sheetIconStyle","sheetTitleStyle","sheetDescriptionStyle","sheetButtonStyle","previewButtonA11yHint","previewButtonText","comingSoonDescription","onOpenSheet","onCloseSheet","onDismissSheet","current","onPressContainer","onPressHelp","embedNoProviderPreview","embed__action","toUpperCase","help","fill","width"],"mappings":";;;;;;;;;AAWA;;AARA;;AAKA;;AAEA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAvBA;AACA;AACA;;AAGA;AACA;AACA;;AAaA;AACA;AACA;AAGA,MAAMA,cAAc,GAAG,QAOhB;AAAA,MAPkB;AACxBC,IAAAA,KADwB;AAExBC,IAAAA,IAFwB;AAGxBC,IAAAA,UAHwB;AAIxBC,IAAAA,OAJwB;AAKxBC,IAAAA,WALwB;AAMxBC,IAAAA;AANwB,GAOlB;AACN,QAAMC,mBAAmB,GAAG,qBAAQ,KAAR,CAA5B;AACA,QAAM,CAAEC,cAAF,EAAkBC,iBAAlB,IAAwC,uBAAU,KAAV,CAA9C;AAEA,QAAM;AAAEC,IAAAA;AAAF,MAAe,qBAAaC,MAAF,KAAgB;AAC/CD,IAAAA,QAAQ,EAAEC,MAAM,CAAEC,aAAF,CAAN,CAAsBC,sBAAtB,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AAC,gBAAD;AAAM,IAAA,KAAK,EAAGrB;AAAd,KACC,4BAAC,sBAAD;AAAW,IAAA,IAAI,EAAGZ;AAAlB,IADD,EAEC,4BAAC,iBAAD;AAAM,IAAA,KAAK,EAAGe;AAAd,KACG,cAAI,sBAAJ,CADH,CAFD,CAJF,CADD;AAcA,CAtMD;;eAwMejB,c","sourcesContent":["/**\n * External dependencies\n */\nimport { TouchableOpacity, TouchableWithoutFeedback, Text } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { View } from '@wordpress/primitives';\n\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useRef, useState } from '@wordpress/element';\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\nimport { requestPreview } from '@wordpress/react-native-bridge';\nimport { useSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { BottomSheet, Icon, TextControl } from '@wordpress/components';\nimport { help } from '@wordpress/icons';\nimport { BlockIcon } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport styles from './styles.scss';\n\nconst EmbedNoPreview = ( {\n\tlabel,\n\ticon,\n\tisSelected,\n\tonPress,\n\tpreviewable,\n\tisDefaultEmbedInfo,\n} ) => {\n\tconst shouldRequestReview = useRef( false );\n\tconst [ isSheetVisible, setIsSheetVisible ] = useState( false );\n\n\tconst { postType } = useSelect( ( select ) => ( {\n\t\tpostType: select( editorStore ).getEditedPostAttribute( 'type' ),\n\t} ) );\n\n\tconst containerStyle = usePreferredColorSchemeStyle(\n\t\tstyles.embed__container,\n\t\tstyles[ 'embed__container--dark' ]\n\t);\n\tconst labelStyle = usePreferredColorSchemeStyle(\n\t\tstyles.embed__label,\n\t\tstyles[ 'embed__label--dark' ]\n\t);\n\tconst descriptionStyle = usePreferredColorSchemeStyle(\n\t\tstyles.embed__description,\n\t\tstyles[ 'embed__description--dark' ]\n\t);\n\tconst helpIconStyle = usePreferredColorSchemeStyle(\n\t\tstyles[ 'embed-no-preview__help-icon' ],\n\t\tstyles[ 'embed-no-preview__help-icon--dark' ]\n\t);\n\n\tconst sheetIconStyle = usePreferredColorSchemeStyle(\n\t\tstyles[ 'embed-no-preview__sheet-icon' ],\n\t\tstyles[ 'embed-no-preview__sheet-icon--dark' ]\n\t);\n\tconst sheetTitleStyle = usePreferredColorSchemeStyle(\n\t\tstyles[ 'embed-no-preview__sheet-title' ],\n\t\tstyles[ 'embed-no-preview__sheet-title--dark' ]\n\t);\n\tconst sheetDescriptionStyle = usePreferredColorSchemeStyle(\n\t\tstyles[ 'embed-no-preview__sheet-description' ],\n\t\tstyles[ 'embed-no-preview__sheet-description--dark' ]\n\t);\n\tconst sheetButtonStyle = usePreferredColorSchemeStyle(\n\t\tstyles[ 'embed-no-preview__sheet-button' ],\n\t\tstyles[ 'embed-no-preview__sheet-button--dark' ]\n\t);\n\n\tconst previewButtonA11yHint =\n\t\tpostType === 'page'\n\t\t\t? __( 'Double tap to preview page.' )\n\t\t\t: __( 'Double tap to preview post.' );\n\tconst previewButtonText =\n\t\tpostType === 'page' ? __( 'Preview page' ) : __( 'Preview post' );\n\tconst comingSoonDescription =\n\t\tpostType === 'page'\n\t\t\t? sprintf(\n\t\t\t\t\t// translators: %s: embed block variant's label e.g: \"Twitter\".\n\t\t\t\t\t__(\n\t\t\t\t\t\t'We’re working hard on adding support for %s previews. In the meantime, you can preview the embedded content on the page.'\n\t\t\t\t\t),\n\t\t\t\t\tlabel\n\t\t\t )\n\t\t\t: sprintf(\n\t\t\t\t\t// translators: %s: embed block variant's label e.g: \"Twitter\".\n\t\t\t\t\t__(\n\t\t\t\t\t\t'We’re working hard on adding support for %s previews. In the meantime, you can preview the embedded content on the post.'\n\t\t\t\t\t),\n\t\t\t\t\tlabel\n\t\t\t );\n\n\tfunction onOpenSheet() {\n\t\tsetIsSheetVisible( true );\n\t}\n\n\tfunction onCloseSheet() {\n\t\tsetIsSheetVisible( false );\n\t}\n\n\tfunction onDismissSheet() {\n\t\t// The preview request has to be done after the bottom sheet modal is dismissed,\n\t\t// otherwise the preview native modal is not displayed.\n\t\tif ( shouldRequestReview.current ) {\n\t\t\trequestPreview();\n\t\t}\n\t\tshouldRequestReview.current = false;\n\t}\n\n\tfunction onPressContainer() {\n\t\tonPress();\n\t\tonOpenSheet();\n\t}\n\n\tfunction onPressHelp() {\n\t\tonPressContainer();\n\t}\n\n\tconst embedNoProviderPreview = (\n\t\t<>\n\t\t\t<TouchableWithoutFeedback\n\t\t\t\taccessibilityRole={ 'button' }\n\t\t\t\taccessibilityHint={ previewButtonA11yHint }\n\t\t\t\tdisabled={ ! isSelected }\n\t\t\t\tonPress={ onPressContainer }\n\t\t\t>\n\t\t\t\t<View style={ containerStyle }>\n\t\t\t\t\t<BlockIcon icon={ icon } />\n\t\t\t\t\t<Text style={ labelStyle }>{ label }</Text>\n\t\t\t\t\t<Text style={ descriptionStyle }>\n\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t// translators: %s: embed block variant's label e.g: \"Twitter\".\n\t\t\t\t\t\t\t__( '%s previews not yet available' ),\n\t\t\t\t\t\t\tlabel\n\t\t\t\t\t\t) }\n\t\t\t\t\t</Text>\n\t\t\t\t\t<Text style={ styles.embed__action }>\n\t\t\t\t\t\t{ previewButtonText.toUpperCase() }\n\t\t\t\t\t</Text>\n\t\t\t\t\t<TouchableOpacity\n\t\t\t\t\t\taccessibilityHint={ __( 'Tap here to show help' ) }\n\t\t\t\t\t\taccessibilityLabel={ __( 'Help button' ) }\n\t\t\t\t\t\taccessibilityRole={ 'button' }\n\t\t\t\t\t\tdisabled={ ! isSelected }\n\t\t\t\t\t\tonPress={ onPressHelp }\n\t\t\t\t\t\tstyle={ helpIconStyle }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\ticon={ help }\n\t\t\t\t\t\t\tfill={ helpIconStyle.fill }\n\t\t\t\t\t\t\tsize={ helpIconStyle.width }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</TouchableOpacity>\n\t\t\t\t</View>\n\t\t\t</TouchableWithoutFeedback>\n\t\t\t<BottomSheet\n\t\t\t\tisVisible={ isSheetVisible }\n\t\t\t\thideHeader\n\t\t\t\tonDismiss={ onDismissSheet }\n\t\t\t\tonClose={ onCloseSheet }\n\t\t\t\ttestID=\"embed-no-preview-modal\"\n\t\t\t>\n\t\t\t\t<View style={ styles[ 'embed-no-preview__container' ] }>\n\t\t\t\t\t<View style={ sheetIconStyle }>\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\ticon={ help }\n\t\t\t\t\t\t\tfill={ sheetIconStyle.fill }\n\t\t\t\t\t\t\tsize={ sheetIconStyle.width }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</View>\n\t\t\t\t\t<Text style={ sheetTitleStyle }>\n\t\t\t\t\t\t{ isDefaultEmbedInfo\n\t\t\t\t\t\t\t? __( 'Embed block previews are coming soon' )\n\t\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t\t// translators: %s: embed block variant's label e.g: \"Twitter\".\n\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t'%s embed block previews are coming soon'\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tlabel\n\t\t\t\t\t\t\t ) }\n\t\t\t\t\t</Text>\n\t\t\t\t\t<Text style={ sheetDescriptionStyle }>\n\t\t\t\t\t\t{ comingSoonDescription }\n\t\t\t\t\t</Text>\n\t\t\t\t</View>\n\t\t\t\t<TextControl\n\t\t\t\t\tlabel={ previewButtonText }\n\t\t\t\t\tseparatorType=\"topFullWidth\"\n\t\t\t\t\tonPress={ () => {\n\t\t\t\t\t\tshouldRequestReview.current = true;\n\t\t\t\t\t\tonCloseSheet();\n\t\t\t\t\t} }\n\t\t\t\t\tlabelStyle={ sheetButtonStyle }\n\t\t\t\t/>\n\t\t\t\t<TextControl\n\t\t\t\t\tlabel={ __( 'Dismiss' ) }\n\t\t\t\t\tseparatorType=\"topFullWidth\"\n\t\t\t\t\tonPress={ onCloseSheet }\n\t\t\t\t\tlabelStyle={ sheetButtonStyle }\n\t\t\t\t/>\n\t\t\t</BottomSheet>\n\t\t</>\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t{ previewable ? (\n\t\t\t\tembedNoProviderPreview\n\t\t\t) : (\n\t\t\t\t<View style={ containerStyle }>\n\t\t\t\t\t<BlockIcon icon={ icon } />\n\t\t\t\t\t<Text style={ labelStyle }>\n\t\t\t\t\t\t{ __( 'No preview available' ) }\n\t\t\t\t\t</Text>\n\t\t\t\t</View>\n\t\t\t) }\n\t\t</>\n\t);\n};\n\nexport default EmbedNoPreview;\n"]}
|