@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
|
@@ -16,16 +16,17 @@ var _blockEditor = require("@wordpress/block-editor");
|
|
|
16
16
|
/**
|
|
17
17
|
* WordPress dependencies
|
|
18
18
|
*/
|
|
19
|
-
const EmbedPlaceholder =
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
19
|
+
const EmbedPlaceholder = _ref => {
|
|
20
|
+
let {
|
|
21
|
+
icon,
|
|
22
|
+
label,
|
|
23
|
+
value,
|
|
24
|
+
onSubmit,
|
|
25
|
+
onChange,
|
|
26
|
+
cannotEmbed,
|
|
27
|
+
fallback,
|
|
28
|
+
tryAgain
|
|
29
|
+
} = _ref;
|
|
29
30
|
return (0, _element.createElement)(_components.Placeholder, {
|
|
30
31
|
icon: (0, _element.createElement)(_blockEditor.BlockIcon, {
|
|
31
32
|
icon: icon,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/embed/embed-placeholder.js"],"names":["EmbedPlaceholder","icon","label","value","onSubmit","onChange","cannotEmbed","fallback","tryAgain"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AALA;AACA;AACA;AAKA,MAAMA,gBAAgB,GAAG,
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/embed/embed-placeholder.js"],"names":["EmbedPlaceholder","icon","label","value","onSubmit","onChange","cannotEmbed","fallback","tryAgain"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AALA;AACA;AACA;AAKA,MAAMA,gBAAgB,GAAG,QASlB;AAAA,MAToB;AAC1BC,IAAAA,IAD0B;AAE1BC,IAAAA,KAF0B;AAG1BC,IAAAA,KAH0B;AAI1BC,IAAAA,QAJ0B;AAK1BC,IAAAA,QAL0B;AAM1BC,IAAAA,WAN0B;AAO1BC,IAAAA,QAP0B;AAQ1BC,IAAAA;AAR0B,GASpB;AACN,SACC,4BAAC,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@wordpress/components';\nimport { BlockIcon } from '@wordpress/block-editor';\n\nconst EmbedPlaceholder = ( {\n\ticon,\n\tlabel,\n\tvalue,\n\tonSubmit,\n\tonChange,\n\tcannotEmbed,\n\tfallback,\n\ttryAgain,\n} ) => {\n\treturn (\n\t\t<Placeholder\n\t\t\ticon={ <BlockIcon icon={ icon } showColors /> }\n\t\t\tlabel={ label }\n\t\t\tclassName=\"wp-block-embed\"\n\t\t\tinstructions={ __(\n\t\t\t\t'Paste a link to the content you want to display on your site.'\n\t\t\t) }\n\t\t>\n\t\t\t<form onSubmit={ onSubmit }>\n\t\t\t\t<input\n\t\t\t\t\ttype=\"url\"\n\t\t\t\t\tvalue={ value || '' }\n\t\t\t\t\tclassName=\"components-placeholder__input\"\n\t\t\t\t\taria-label={ label }\n\t\t\t\t\tplaceholder={ __( 'Enter URL to embed here…' ) }\n\t\t\t\t\tonChange={ onChange }\n\t\t\t\t/>\n\t\t\t\t<Button variant=\"primary\" type=\"submit\">\n\t\t\t\t\t{ _x( 'Embed', 'button label' ) }\n\t\t\t\t</Button>\n\t\t\t</form>\n\t\t\t<div className=\"components-placeholder__learn-more\">\n\t\t\t\t<ExternalLink\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>\n\t\t\t\t\t{ __( 'Learn more about embeds' ) }\n\t\t\t\t</ExternalLink>\n\t\t\t</div>\n\t\t\t{ cannotEmbed && (\n\t\t\t\t<div className=\"components-placeholder__error\">\n\t\t\t\t\t<div className=\"components-placeholder__instructions\">\n\t\t\t\t\t\t{ __( 'Sorry, this content could not be embedded.' ) }\n\t\t\t\t\t</div>\n\t\t\t\t\t<Button variant=\"secondary\" onClick={ tryAgain }>\n\t\t\t\t\t\t{ _x( 'Try again', 'button label' ) }\n\t\t\t\t\t</Button>{ ' ' }\n\t\t\t\t\t<Button variant=\"secondary\" onClick={ fallback }>\n\t\t\t\t\t\t{ _x( 'Convert to link', 'button label' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</Placeholder>\n\t);\n};\n\nexport default EmbedPlaceholder;\n"]}
|
|
@@ -36,15 +36,16 @@ var _gridicons = require("../../../components/src/mobile/gridicons");
|
|
|
36
36
|
/**
|
|
37
37
|
* Internal dependencies
|
|
38
38
|
*/
|
|
39
|
-
const EmbedPlaceholder =
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
39
|
+
const EmbedPlaceholder = _ref => {
|
|
40
|
+
let {
|
|
41
|
+
icon,
|
|
42
|
+
isSelected,
|
|
43
|
+
label,
|
|
44
|
+
onPress,
|
|
45
|
+
cannotEmbed,
|
|
46
|
+
fallback,
|
|
47
|
+
tryAgain
|
|
48
|
+
} = _ref;
|
|
48
49
|
const containerStyle = (0, _compose.usePreferredColorSchemeStyle)(_styles.default.embed__container, _styles.default['embed__container--dark']);
|
|
49
50
|
const labelStyle = (0, _compose.usePreferredColorSchemeStyle)(_styles.default.embed__label, _styles.default['embed__label--dark']);
|
|
50
51
|
const descriptionStyle = _styles.default.embed__description;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/embed/embed-placeholder.native.js"],"names":["EmbedPlaceholder","icon","isSelected","label","onPress","cannotEmbed","fallback","tryAgain","containerStyle","styles","embed__container","labelStyle","embed__label","descriptionStyle","embed__description","descriptionErrorStyle","actionStyle","embed__action","embedIconErrorStyle","cannotEmbedMenuPickerRef","errorPickerOptions","retry","id","value","onSelect","convertToLink","options","onPickerSelect","selectedItem","find","item","resolveOnPressEvent","current","presentPicker","noticeOutline","fill"],"mappings":";;;;;;;;;AAaA;;AAVA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAMA;;AACA;;AAnBA;AACA;AACA;;AAIA;AACA;AACA;;AAOA;AACA;AACA;AAIA,MAAMA,gBAAgB,GAAG,
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/embed/embed-placeholder.native.js"],"names":["EmbedPlaceholder","icon","isSelected","label","onPress","cannotEmbed","fallback","tryAgain","containerStyle","styles","embed__container","labelStyle","embed__label","descriptionStyle","embed__description","descriptionErrorStyle","actionStyle","embed__action","embedIconErrorStyle","cannotEmbedMenuPickerRef","errorPickerOptions","retry","id","value","onSelect","convertToLink","options","onPickerSelect","selectedItem","find","item","resolveOnPressEvent","current","presentPicker","noticeOutline","fill"],"mappings":";;;;;;;;;AAaA;;AAVA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAMA;;AACA;;AAnBA;AACA;AACA;;AAIA;AACA;AACA;;AAOA;AACA;AACA;AAIA,MAAMA,gBAAgB,GAAG,QAQlB;AAAA,MARoB;AAC1BC,IAAAA,IAD0B;AAE1BC,IAAAA,UAF0B;AAG1BC,IAAAA,KAH0B;AAI1BC,IAAAA,OAJ0B;AAK1BC,IAAAA,WAL0B;AAM1BC,IAAAA,QAN0B;AAO1BC,IAAAA;AAP0B,GAQpB;AACN,QAAMC,cAAc,GAAG,2CACtBC,gBAAOC,gBADe,EAEtBD,gBAAQ,wBAAR,CAFsB,CAAvB;AAIA,QAAME,UAAU,GAAG,2CAClBF,gBAAOG,YADW,EAElBH,gBAAQ,oBAAR,CAFkB,CAAnB;AAIA,QAAMI,gBAAgB,GAAGJ,gBAAOK,kBAAhC;AACA,QAAMC,qBAAqB,GAAGN,gBAAQ,2BAAR,CAA9B;AACA,QAAMO,WAAW,GAAG,2CACnBP,gBAAOQ,aADY,EAEnBR,gBAAQ,qBAAR,CAFmB,CAApB;AAIA,QAAMS,mBAAmB,GAAGT,gBAAQ,oBAAR,CAA5B;AAEA,QAAMU,wBAAwB,GAAG,sBAAjC;AAEA,QAAMC,kBAAkB,GAAG;AAC1BC,IAAAA,KAAK,EAAE;AACNC,MAAAA,EAAE,EAAE,aADE;AAENnB,MAAAA,KAAK,EAAE,cAAI,OAAJ,CAFD;AAGNoB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O,EAEPE,qBAFO;AADT,KAMG,cAAI,uBAAJ,CANH,CAND,EAcC,4BAAC,iBAAD;AAAM,IAAA,KAAK,EAAGC;AAAd,KACG,cAAI,cAAJ,CADH,CAdD,EAiBC,4BAAC,kBAAD;AACC,IAAA,KAAK,EAAG,cAAI,eAAJ,CADT;AAEC,IAAA,GAAG,EAAGG,wBAFP;AAGC,IAAA,OAAO,EAAGO,OAHX;AAIC,IAAA,QAAQ,EAAGC,cAJZ;AAKC,IAAA,gBAAgB,MALjB;AAMC,IAAA,SAAS;AANV,IAjBD,CADY,GA4BZ,qDACC,4BAAC,sBAAD;AAAW,IAAA,IAAI,EAAG1B;AAAlB,IADD,EAEC,4BAAC,iBAAD;AAAM,IAAA,KAAK,EAAGU;AAAd,KAA6BR,KAA7B,CAFD,EAGC,4BAAC,iBAAD;AAAM,IAAA,KAAK,EAAGa;AAAd,KACG,cAAI,UAAJ,CADH,CAHD,CA7BF,CAVD,CADD,CADD;AAqDA,CAlHD;;eAoHehB,gB","sourcesContent":["/**\n * External dependencies\n */\nimport { View, Text, TouchableWithoutFeedback } from 'react-native';\nimport { compact } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\nimport { Icon, Picker } from '@wordpress/components';\nimport { BlockIcon } from '@wordpress/block-editor';\nimport { useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport styles from './styles.scss';\nimport { noticeOutline } from '../../../components/src/mobile/gridicons';\n\nconst EmbedPlaceholder = ( {\n\ticon,\n\tisSelected,\n\tlabel,\n\tonPress,\n\tcannotEmbed,\n\tfallback,\n\ttryAgain,\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 = styles.embed__description;\n\tconst descriptionErrorStyle = styles[ 'embed__description--error' ];\n\tconst actionStyle = usePreferredColorSchemeStyle(\n\t\tstyles.embed__action,\n\t\tstyles[ 'embed__action--dark' ]\n\t);\n\tconst embedIconErrorStyle = styles[ 'embed__icon--error' ];\n\n\tconst cannotEmbedMenuPickerRef = useRef();\n\n\tconst errorPickerOptions = {\n\t\tretry: {\n\t\t\tid: 'retryOption',\n\t\t\tlabel: __( 'Retry' ),\n\t\t\tvalue: 'retryOption',\n\t\t\tonSelect: tryAgain,\n\t\t},\n\t\tconvertToLink: {\n\t\t\tid: 'convertToLinkOption',\n\t\t\tlabel: __( 'Convert to link' ),\n\t\t\tvalue: 'convertToLinkOption',\n\t\t\tonSelect: fallback,\n\t\t},\n\t};\n\n\tconst options = compact( [\n\t\tcannotEmbed && errorPickerOptions.retry,\n\t\tcannotEmbed && errorPickerOptions.convertToLink,\n\t] );\n\n\tfunction onPickerSelect( value ) {\n\t\tconst selectedItem = options.find( ( item ) => item.value === value );\n\t\tselectedItem.onSelect();\n\t}\n\n\t// When the content cannot be embedded the onPress should trigger the Picker instead of the onPress prop.\n\tfunction resolveOnPressEvent() {\n\t\tif ( cannotEmbed ) {\n\t\t\tcannotEmbedMenuPickerRef.current?.presentPicker();\n\t\t} else {\n\t\t\tonPress();\n\t\t}\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<TouchableWithoutFeedback\n\t\t\t\taccessibilityRole={ 'button' }\n\t\t\t\taccessibilityHint={\n\t\t\t\t\tcannotEmbed\n\t\t\t\t\t\t? __( 'Double tap to view embed options.' )\n\t\t\t\t\t\t: __( 'Double tap to add a link.' )\n\t\t\t\t}\n\t\t\t\tonPress={ resolveOnPressEvent }\n\t\t\t\tdisabled={ ! isSelected }\n\t\t\t>\n\t\t\t\t<View style={ containerStyle }>\n\t\t\t\t\t{ cannotEmbed ? (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\ticon={ noticeOutline }\n\t\t\t\t\t\t\t\tfill={ embedIconErrorStyle.fill }\n\t\t\t\t\t\t\t\tstyle={ embedIconErrorStyle }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\tstyle={ [\n\t\t\t\t\t\t\t\t\tdescriptionStyle,\n\t\t\t\t\t\t\t\t\tdescriptionErrorStyle,\n\t\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Unable to embed media' ) }\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t<Text style={ actionStyle }>\n\t\t\t\t\t\t\t\t{ __( 'More options' ) }\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t<Picker\n\t\t\t\t\t\t\t\ttitle={ __( 'Embed options' ) }\n\t\t\t\t\t\t\t\tref={ cannotEmbedMenuPickerRef }\n\t\t\t\t\t\t\t\toptions={ options }\n\t\t\t\t\t\t\t\tonChange={ onPickerSelect }\n\t\t\t\t\t\t\t\thideCancelButton\n\t\t\t\t\t\t\t\tleftAlign\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\t<>\n\t\t\t\t\t\t\t<BlockIcon icon={ icon } />\n\t\t\t\t\t\t\t<Text style={ labelStyle }>{ label }</Text>\n\t\t\t\t\t\t\t<Text style={ actionStyle }>\n\t\t\t\t\t\t\t\t{ __( 'ADD LINK' ) }\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</View>\n\t\t\t</TouchableWithoutFeedback>\n\t\t</>\n\t);\n};\n\nexport default EmbedPlaceholder;\n"]}
|
|
@@ -44,22 +44,23 @@ var _styles = _interopRequireDefault(require("./styles.scss"));
|
|
|
44
44
|
/**
|
|
45
45
|
* Internal dependencies
|
|
46
46
|
*/
|
|
47
|
-
const EmbedPreview =
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
47
|
+
const EmbedPreview = _ref => {
|
|
48
|
+
let {
|
|
49
|
+
align,
|
|
50
|
+
className,
|
|
51
|
+
clientId,
|
|
52
|
+
icon,
|
|
53
|
+
insertBlocksAfter,
|
|
54
|
+
isSelected,
|
|
55
|
+
label,
|
|
56
|
+
onFocus,
|
|
57
|
+
preview,
|
|
58
|
+
previewable,
|
|
59
|
+
isProviderPreviewable,
|
|
60
|
+
type,
|
|
61
|
+
url,
|
|
62
|
+
isDefaultEmbedInfo
|
|
63
|
+
} = _ref;
|
|
63
64
|
const [isCaptionSelected, setIsCaptionSelected] = (0, _element.useState)(false);
|
|
64
65
|
const {
|
|
65
66
|
locale
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/embed/embed-preview.native.js"],"names":["EmbedPreview","align","className","clientId","icon","insertBlocksAfter","isSelected","label","onFocus","preview","previewable","isProviderPreviewable","type","url","isDefaultEmbedInfo","isCaptionSelected","setIsCaptionSelected","locale","blockEditorStore","getSettings","wrapperStyle","styles","wrapperAlignStyle","sandboxAlignStyle","accessibilityLabelCreator","caption","onEmbedPreviewPress","onFocusCaption","provider_url","providerUrl","html","parsedHost","URL","host","split","parsedHostBaseUrl","splice","length","join","iframeTitle","sandboxClassnames","PreviewContent","WpEmbedPreview","SandBox","embedWrapper"],"mappings":";;;;;;;;;AAgBA;;AAbA;;AACA;;AACA;;AAKA;;AACA;;AAIA;;AAEA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AA1BA;AACA;AACA;;AAKA;AACA;AACA;;AAWA;AACA;AACA;AAMA,MAAMA,YAAY,GAAG,
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/embed/embed-preview.native.js"],"names":["EmbedPreview","align","className","clientId","icon","insertBlocksAfter","isSelected","label","onFocus","preview","previewable","isProviderPreviewable","type","url","isDefaultEmbedInfo","isCaptionSelected","setIsCaptionSelected","locale","blockEditorStore","getSettings","wrapperStyle","styles","wrapperAlignStyle","sandboxAlignStyle","accessibilityLabelCreator","caption","onEmbedPreviewPress","onFocusCaption","provider_url","providerUrl","html","parsedHost","URL","host","split","parsedHostBaseUrl","splice","length","join","iframeTitle","sandboxClassnames","PreviewContent","WpEmbedPreview","SandBox","embedWrapper"],"mappings":";;;;;;;;;AAgBA;;AAbA;;AACA;;AACA;;AAKA;;AACA;;AAIA;;AAEA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AA1BA;AACA;AACA;;AAKA;AACA;AACA;;AAWA;AACA;AACA;AAMA,MAAMA,YAAY,GAAG,QAed;AAAA,MAfgB;AACtBC,IAAAA,KADsB;AAEtBC,IAAAA,SAFsB;AAGtBC,IAAAA,QAHsB;AAItBC,IAAAA,IAJsB;AAKtBC,IAAAA,iBALsB;AAMtBC,IAAAA,UANsB;AAOtBC,IAAAA,KAPsB;AAQtBC,IAAAA,OARsB;AAStBC,IAAAA,OATsB;AAUtBC,IAAAA,WAVsB;AAWtBC,IAAAA,qBAXsB;AAYtBC,IAAAA,IAZsB;AAatBC,IAAAA,GAbsB;AActBC,IAAAA;AAdsB,GAehB;AACN,QAAM,CAAEC,iBAAF,EAAqBC,oBAArB,IAA8C,uBAAU,KAAV,CAApD;AACA,QAAM;AAAEC,IAAAA;AAAF,MAAa,qBAAWC,kBAAX,EAA8BC,WAA9B,EAAnB;AAEA,QAAMC,YAAY,GAAGC,gBAAQ,wBAAR,CAArB;AACA,QAAMC,iBAAiB,GACtBD,gBAAS,iCAAiCpB,KAAO,EAAjD,CADD;AAEA,QAAMsB,iBAAiB,GACtBF,gBAAS,iCAAiCpB,KAAO,EAAjD,CADD;;AAGA,WAASuB,yBAAT,CAAoCC,OAApC,EAA8C;AAC7C,WAAO,qBAASA,OAAT;AACJ;AACA,kBAAI,s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AEC,IAAA,KAAK,EAAG,CAAEI,YAAF,EAAgBE,iBAAhB;AAFT,KAIC,4BAAC,cAAD;AACC,IAAA,IAAI,EAAGQ,IADR;AAEC,IAAA,IAAI,EAAGb,MAFR;AAGC,IAAA,KAAK,EAAGsB,WAHT;AAIC,IAAA,IAAI,EAAGC,iBAJR;AAKC,IAAA,WAAW,EAAGX,WALf;AAMC,IAAA,GAAG,EAAGhB,GANP;AAOC,IAAA,cAAc,EAAGU;AAPlB,IAJD,CAVD,CADD,CADD;AA6BA,SACC,4BAAC,qCAAD;AACC,IAAA,UAAU,EAAG,CAAEjB,UADhB;AAEC,IAAA,OAAO,EAAGoB,mBAFX;AAGC,IAAA,QAAQ,EAAG,CAAEpB;AAHd,KAKC,4BAAC,gBAAD,QACGK,qBAAqB,IAAID,WAAzB,GACDkC,YADC,GAGD,4BAAC,uBAAD;AACC,IAAA,KAAK,EAAGrC,KADT;AAEC,IAAA,IAAI,EAAGH,IAFR;AAGC,IAAA,UAAU,EAAGE,UAHd;AAIC,IAAA,OAAO,EAAG,MAAMU,oBAAoB,CAAE,KAAF,CAJrC;AAKC,IAAA,WAAW,EAAGN,WALf;AAMC,IAAA,kBAAkB,EAAGI;AANtB,IAJF,EAaC,4BAAC,yBAAD;AACC,IAAA,yBAAyB,EAAGU,yBAD7B;AAEC,IAAA,UAAU,MAFX;AAGC,IAAA,QAAQ,EAAGrB,QAHZ;AAIC,IAAA,iBAAiB,EAAGE,iBAJrB;AAKC,IAAA,UAAU,EAAGU,iBALd;AAMC,IAAA,OAAO,EAAGY;AANX,IAbD,CALD,CADD;AA8BA,CA9HD;;eAgIe,mBAAM3B,YAAN,C","sourcesContent":["/**\n * External dependencies\n */\nimport { TouchableWithoutFeedback } from 'react-native';\nimport { isEmpty } from 'lodash';\nimport classnames from 'classnames/dedupe';\n\n/**\n * WordPress dependencies\n */\nimport { View } from '@wordpress/primitives';\nimport {\n\tBlockCaption,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { memo, useState } from '@wordpress/element';\nimport { SandBox } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { getPhotoHtml } from './util';\nimport EmbedNoPreview from './embed-no-preview';\nimport WpEmbedPreview from './wp-embed-preview';\nimport styles from './styles.scss';\n\nconst EmbedPreview = ( {\n\talign,\n\tclassName,\n\tclientId,\n\ticon,\n\tinsertBlocksAfter,\n\tisSelected,\n\tlabel,\n\tonFocus,\n\tpreview,\n\tpreviewable,\n\tisProviderPreviewable,\n\ttype,\n\turl,\n\tisDefaultEmbedInfo,\n} ) => {\n\tconst [ isCaptionSelected, setIsCaptionSelected ] = useState( false );\n\tconst { locale } = useSelect( blockEditorStore ).getSettings();\n\n\tconst wrapperStyle = styles[ 'embed-preview__wrapper' ];\n\tconst wrapperAlignStyle =\n\t\tstyles[ `embed-preview__wrapper--align-${ align }` ];\n\tconst sandboxAlignStyle =\n\t\tstyles[ `embed-preview__sandbox--align-${ align }` ];\n\n\tfunction accessibilityLabelCreator( caption ) {\n\t\treturn isEmpty( caption )\n\t\t\t? /* translators: accessibility text. Empty Embed caption. */\n\t\t\t __( 'Embed caption. Empty' )\n\t\t\t: sprintf(\n\t\t\t\t\t/* translators: accessibility text. %s: Embed caption. */\n\t\t\t\t\t__( 'Embed caption. %s' ),\n\t\t\t\t\tcaption\n\t\t\t );\n\t}\n\n\tfunction onEmbedPreviewPress() {\n\t\tsetIsCaptionSelected( false );\n\t}\n\n\tfunction onFocusCaption() {\n\t\tif ( onFocus ) {\n\t\t\tonFocus();\n\t\t}\n\t\tif ( ! isCaptionSelected ) {\n\t\t\tsetIsCaptionSelected( true );\n\t\t}\n\t}\n\n\tconst { provider_url: providerUrl } = preview;\n\tconst html = 'photo' === type ? getPhotoHtml( preview ) : preview.html;\n\tconst parsedHost = new URL( url ).host.split( '.' );\n\tconst parsedHostBaseUrl = parsedHost\n\t\t.splice( parsedHost.length - 2, parsedHost.length - 1 )\n\t\t.join( '.' );\n\tconst iframeTitle = sprintf(\n\t\t// translators: %s: host providing embed content e.g: www.youtube.com\n\t\t__( 'Embedded content from %s' ),\n\t\tparsedHostBaseUrl\n\t);\n\tconst sandboxClassnames = classnames(\n\t\ttype,\n\t\tclassName,\n\t\t'wp-block-embed__wrapper'\n\t);\n\n\tconst PreviewContent = 'wp-embed' === type ? WpEmbedPreview : SandBox;\n\tconst embedWrapper = (\n\t\t<>\n\t\t\t<TouchableWithoutFeedback\n\t\t\t\tonPress={ () => {\n\t\t\t\t\tif ( onFocus ) {\n\t\t\t\t\t\tonFocus();\n\t\t\t\t\t}\n\t\t\t\t\tif ( isCaptionSelected ) {\n\t\t\t\t\t\tsetIsCaptionSelected( false );\n\t\t\t\t\t}\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<View\n\t\t\t\t\tpointerEvents=\"box-only\"\n\t\t\t\t\tstyle={ [ wrapperStyle, wrapperAlignStyle ] }\n\t\t\t\t>\n\t\t\t\t\t<PreviewContent\n\t\t\t\t\t\thtml={ html }\n\t\t\t\t\t\tlang={ locale }\n\t\t\t\t\t\ttitle={ iframeTitle }\n\t\t\t\t\t\ttype={ sandboxClassnames }\n\t\t\t\t\t\tproviderUrl={ providerUrl }\n\t\t\t\t\t\turl={ url }\n\t\t\t\t\t\tcontainerStyle={ sandboxAlignStyle }\n\t\t\t\t\t/>\n\t\t\t\t</View>\n\t\t\t</TouchableWithoutFeedback>\n\t\t</>\n\t);\n\treturn (\n\t\t<TouchableWithoutFeedback\n\t\t\taccessible={ ! isSelected }\n\t\t\tonPress={ onEmbedPreviewPress }\n\t\t\tdisabled={ ! isSelected }\n\t\t>\n\t\t\t<View>\n\t\t\t\t{ isProviderPreviewable && previewable ? (\n\t\t\t\t\tembedWrapper\n\t\t\t\t) : (\n\t\t\t\t\t<EmbedNoPreview\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\tonPress={ () => setIsCaptionSelected( false ) }\n\t\t\t\t\t\tpreviewable={ previewable }\n\t\t\t\t\t\tisDefaultEmbedInfo={ isDefaultEmbedInfo }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<BlockCaption\n\t\t\t\t\taccessibilityLabelCreator={ accessibilityLabelCreator }\n\t\t\t\t\taccessible\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\t\tisSelected={ isCaptionSelected }\n\t\t\t\t\tonFocus={ onFocusCaption }\n\t\t\t\t/>\n\t\t\t</View>\n\t\t</TouchableWithoutFeedback>\n\t);\n};\n\nexport default memo( EmbedPreview );\n"]}
|
package/build/embed/icons.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.embedYouTubeIcon = exports.embedWordPressIcon = exports.embedWolframIcon = exports.embedVimeoIcon = exports.embedVideoIcon = exports.embedTwitterIcon = exports.embedTumblrIcon = exports.embedSpotifyIcon = exports.embedRedditIcon = exports.embedPinterestIcon = exports.embedPhotoIcon = exports.embedInstagramIcon = exports.embedFlickrIcon = exports.embedFacebookIcon = exports.embedDailymotionIcon = exports.embedContentIcon = exports.embedAudioIcon = exports.embedAnimotoIcon = exports.embedAmazonIcon = void 0;
|
|
7
7
|
|
|
8
8
|
var _element = require("@wordpress/element");
|
|
9
9
|
|
package/build/embed/save.js
CHANGED
package/build/embed/save.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/embed/save.js"],"names":["save","attributes","url","caption","type","providerNameSlug","className","useBlockProps","RichText","isEmpty"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAGe,SAASA,IAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/embed/save.js"],"names":["save","attributes","url","caption","type","providerNameSlug","className","useBlockProps","RichText","isEmpty"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAGe,SAASA,IAAT,OAAgC;AAAA,MAAjB;AAAEC,IAAAA;AAAF,GAAiB;AAC9C,QAAM;AAAEC,IAAAA,GAAF;AAAOC,IAAAA,OAAP;AAAgBC,IAAAA,IAAhB;AAAsBC,IAAAA;AAAtB,MAA2CJ,UAAjD;;AAEA,MAAK,CAAEC,GAAP,EAAa;AACZ,WAAO,IAAP;AACA;;AAED,QAAMI,SAAS,GAAG,qBAAY,gBAAZ,EAA8B;AAC/C,KAAG,WAAWF,IAAM,EAApB,GAAyBA,IADsB;AAE/C,KAAG,eAAeC,gBAAkB,EAApC,GAAyCA,gBAFM;AAG/C,KAAG,kBAAkBA,gBAAkB,EAAvC,GAA4CA;AAHG,GAA9B,CAAlB;AAMA,SACC,sCAAaE,2BAAcP,IAAd,CAAoB;AAAEM,IAAAA;AAAF,GAApB,CAAb,EACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACI,KAAKJ,GAAK;AAAI;AADlB,GADD,EAIG,CAAEM,sBAASC,OAAT,CAAkBN,OAAlB,CAAF,IACD,4BAAC,qBAAD,CAAU,OAAV;AAAkB,IAAA,OAAO,EAAC,YAA1B;AAAuC,IAAA,KAAK,EAAGA;AAA/C,IALF,CADD;AAUA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames/dedupe';\n\n/**\n * WordPress dependencies\n */\nimport { RichText, useBlockProps } from '@wordpress/block-editor';\n\nexport default function save( { attributes } ) {\n\tconst { url, caption, type, providerNameSlug } = attributes;\n\n\tif ( ! url ) {\n\t\treturn null;\n\t}\n\n\tconst className = classnames( 'wp-block-embed', {\n\t\t[ `is-type-${ type }` ]: type,\n\t\t[ `is-provider-${ providerNameSlug }` ]: providerNameSlug,\n\t\t[ `wp-block-embed-${ providerNameSlug }` ]: providerNameSlug,\n\t} );\n\n\treturn (\n\t\t<figure { ...useBlockProps.save( { className } ) }>\n\t\t\t<div className=\"wp-block-embed__wrapper\">\n\t\t\t\t{ `\\n${ url }\\n` /* URL needs to be on its own line. */ }\n\t\t\t</div>\n\t\t\t{ ! RichText.isEmpty( caption ) && (\n\t\t\t\t<RichText.Content tagName=\"figcaption\" value={ caption } />\n\t\t\t) }\n\t\t</figure>\n\t);\n}\n"]}
|
|
@@ -79,13 +79,17 @@ const transforms = {
|
|
|
79
79
|
to: [{
|
|
80
80
|
type: 'block',
|
|
81
81
|
blocks: ['core/paragraph'],
|
|
82
|
-
isMatch:
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
url
|
|
87
|
-
|
|
88
|
-
|
|
82
|
+
isMatch: _ref => {
|
|
83
|
+
let {
|
|
84
|
+
url
|
|
85
|
+
} = _ref;
|
|
86
|
+
return !!url;
|
|
87
|
+
},
|
|
88
|
+
transform: _ref2 => {
|
|
89
|
+
let {
|
|
90
|
+
url,
|
|
91
|
+
caption
|
|
92
|
+
} = _ref2;
|
|
89
93
|
let value = `<a href="${url}">${url}</a>`;
|
|
90
94
|
|
|
91
95
|
if (caption !== null && caption !== void 0 && caption.trim()) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/embed/transforms.js"],"names":["name","EMBED_BLOCK","metadata","transforms","from","type","isMatch","node","nodeName","test","textContent","match","length","transform","url","trim","to","blocks","caption","value","content"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,MAAM;AAAEA,EAAAA,IAAI,EAAEC;AAAR,IAAwBC,QAA9B;AAEA;AACA;AACA;;AACA,MAAMC,UAAU,GAAG;AAClBC,EAAAA,IAAI,EAAE,CACL;AACCC,IAAAA,IAAI,EAAE,KADP;AAECC,IAAAA,OAAO,EAAIC,IAAF;AAAA;;AAAA,aACRA,IAAI,CAACC,QAAL,KAAkB,GAAlB,IACA,4BAA4BC,IAA5B,CAAkCF,IAAI,CAACG,WAAvC,CADA,IAEA,sBAAAH,IAAI,CAACG,WAAL,iGAAkBC,KAAlB,CAAyB,SAAzB,iFAAsCC,MAAtC,MAAiD,CAHzC;AAAA,KAFV;AAMCC,IAAAA,SAAS,EAAIN,IAAF,IAAY;AACtB,aAAO,yBAAaN,WAAb,EAA0B;AAChCa,QAAAA,GAAG,EAAEP,IAAI,CAACG,WAAL,CAAiBK,IAAjB;AAD2B,OAA1B,CAAP;AAGA;AAVF,GADK,CADY;AAelBC,EAAAA,EAAE,EAAE,CACH;AACCX,IAAAA,IAAI,EAAE,OADP;AAECY,IAAAA,MAAM,EAAE,CAAE,gBAAF,CAFT;AAGCX,IAAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/embed/transforms.js"],"names":["name","EMBED_BLOCK","metadata","transforms","from","type","isMatch","node","nodeName","test","textContent","match","length","transform","url","trim","to","blocks","caption","value","content"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,MAAM;AAAEA,EAAAA,IAAI,EAAEC;AAAR,IAAwBC,QAA9B;AAEA;AACA;AACA;;AACA,MAAMC,UAAU,GAAG;AAClBC,EAAAA,IAAI,EAAE,CACL;AACCC,IAAAA,IAAI,EAAE,KADP;AAECC,IAAAA,OAAO,EAAIC,IAAF;AAAA;;AAAA,aACRA,IAAI,CAACC,QAAL,KAAkB,GAAlB,IACA,4BAA4BC,IAA5B,CAAkCF,IAAI,CAACG,WAAvC,CADA,IAEA,sBAAAH,IAAI,CAACG,WAAL,iGAAkBC,KAAlB,CAAyB,SAAzB,iFAAsCC,MAAtC,MAAiD,CAHzC;AAAA,KAFV;AAMCC,IAAAA,SAAS,EAAIN,IAAF,IAAY;AACtB,aAAO,yBAAaN,WAAb,EAA0B;AAChCa,QAAAA,GAAG,EAAEP,IAAI,CAACG,WAAL,CAAiBK,IAAjB;AAD2B,OAA1B,CAAP;AAGA;AAVF,GADK,CADY;AAelBC,EAAAA,EAAE,EAAE,CACH;AACCX,IAAAA,IAAI,EAAE,OADP;AAECY,IAAAA,MAAM,EAAE,CAAE,gBAAF,CAFT;AAGCX,IAAAA,OAAO,EAAE;AAAA,UAAE;AAAEQ,QAAAA;AAAF,OAAF;AAAA,aAAe,CAAC,CAAEA,GAAlB;AAAA,KAHV;AAICD,IAAAA,SAAS,EAAE,SAAwB;AAAA,UAAtB;AAAEC,QAAAA,GAAF;AAAOI,QAAAA;AAAP,OAAsB;AAClC,UAAIC,KAAK,GAAI,YAAYL,GAAK,KAAKA,GAAK,MAAxC;;AACA,UAAKI,OAAL,aAAKA,OAAL,eAAKA,OAAO,CAAEH,IAAT,EAAL,EAAuB;AACtBI,QAAAA,KAAK,IAAK,SAASD,OAAS,EAA5B;AACA;;AACD,aAAO,yBAAa,gBAAb,EAA+B;AACrCE,QAAAA,OAAO,EAAED;AAD4B,OAA/B,CAAP;AAGA;AAZF,GADG;AAfc,CAAnB;eAiCehB,U","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport metadata from './block.json';\n\nconst { name: EMBED_BLOCK } = metadata;\n\n/**\n * Default transforms for generic embeds.\n */\nconst transforms = {\n\tfrom: [\n\t\t{\n\t\t\ttype: 'raw',\n\t\t\tisMatch: ( node ) =>\n\t\t\t\tnode.nodeName === 'P' &&\n\t\t\t\t/^\\s*(https?:\\/\\/\\S+)\\s*$/i.test( node.textContent ) &&\n\t\t\t\tnode.textContent?.match( /https/gi )?.length === 1,\n\t\t\ttransform: ( node ) => {\n\t\t\t\treturn createBlock( EMBED_BLOCK, {\n\t\t\t\t\turl: node.textContent.trim(),\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/paragraph' ],\n\t\t\tisMatch: ( { url } ) => !! url,\n\t\t\ttransform: ( { url, caption } ) => {\n\t\t\t\tlet value = `<a href=\"${ url }\">${ url }</a>`;\n\t\t\t\tif ( caption?.trim() ) {\n\t\t\t\t\tvalue += `<br />${ caption }`;\n\t\t\t\t}\n\t\t\t\treturn createBlock( 'core/paragraph', {\n\t\t\t\t\tcontent: value,\n\t\t\t\t} );\n\t\t\t},\n\t\t},\n\t],\n};\n\nexport default transforms;\n"]}
|
package/build/embed/util.js
CHANGED
|
@@ -5,9 +5,11 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.createUpgradedEmbedBlock = void 0;
|
|
9
9
|
exports.fallback = fallback;
|
|
10
|
-
exports.getAttributesFromPreview = exports.
|
|
10
|
+
exports.getAttributesFromPreview = exports.findMoreSuitableBlock = void 0;
|
|
11
|
+
exports.getClassNames = getClassNames;
|
|
12
|
+
exports.removeAspectRatioClasses = exports.matchesPatterns = exports.isFromWordPress = exports.getPhotoHtml = exports.getEmbedInfoByProvider = void 0;
|
|
11
13
|
|
|
12
14
|
var _element = require("@wordpress/element");
|
|
13
15
|
|
|
@@ -92,9 +94,12 @@ const {
|
|
|
92
94
|
const getEmbedInfoByProvider = provider => {
|
|
93
95
|
var _getBlockVariations;
|
|
94
96
|
|
|
95
|
-
return (_getBlockVariations = (0, _blocks.getBlockVariations)(DEFAULT_EMBED_BLOCK)) === null || _getBlockVariations === void 0 ? void 0 : _getBlockVariations.find(
|
|
96
|
-
|
|
97
|
-
|
|
97
|
+
return (_getBlockVariations = (0, _blocks.getBlockVariations)(DEFAULT_EMBED_BLOCK)) === null || _getBlockVariations === void 0 ? void 0 : _getBlockVariations.find(_ref => {
|
|
98
|
+
let {
|
|
99
|
+
name
|
|
100
|
+
} = _ref;
|
|
101
|
+
return name === provider;
|
|
102
|
+
});
|
|
98
103
|
};
|
|
99
104
|
/**
|
|
100
105
|
* Returns true if any of the regular expressions match the URL.
|
|
@@ -107,7 +112,10 @@ const getEmbedInfoByProvider = provider => {
|
|
|
107
112
|
|
|
108
113
|
exports.getEmbedInfoByProvider = getEmbedInfoByProvider;
|
|
109
114
|
|
|
110
|
-
const matchesPatterns = (url
|
|
115
|
+
const matchesPatterns = function (url) {
|
|
116
|
+
let patterns = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
117
|
+
return patterns.some(pattern => url.match(pattern));
|
|
118
|
+
};
|
|
111
119
|
/**
|
|
112
120
|
* Finds the block variation that should be used for the URL,
|
|
113
121
|
* based on the provided URL and the variation's patterns.
|
|
@@ -122,9 +130,12 @@ exports.matchesPatterns = matchesPatterns;
|
|
|
122
130
|
const findMoreSuitableBlock = url => {
|
|
123
131
|
var _getBlockVariations2;
|
|
124
132
|
|
|
125
|
-
return (_getBlockVariations2 = (0, _blocks.getBlockVariations)(DEFAULT_EMBED_BLOCK)) === null || _getBlockVariations2 === void 0 ? void 0 : _getBlockVariations2.find(
|
|
126
|
-
|
|
127
|
-
|
|
133
|
+
return (_getBlockVariations2 = (0, _blocks.getBlockVariations)(DEFAULT_EMBED_BLOCK)) === null || _getBlockVariations2 === void 0 ? void 0 : _getBlockVariations2.find(_ref2 => {
|
|
134
|
+
let {
|
|
135
|
+
patterns
|
|
136
|
+
} = _ref2;
|
|
137
|
+
return matchesPatterns(url, patterns);
|
|
138
|
+
});
|
|
128
139
|
};
|
|
129
140
|
|
|
130
141
|
exports.findMoreSuitableBlock = findMoreSuitableBlock;
|
|
@@ -162,9 +173,10 @@ const getPhotoHtml = photo => {
|
|
|
162
173
|
|
|
163
174
|
exports.getPhotoHtml = getPhotoHtml;
|
|
164
175
|
|
|
165
|
-
const createUpgradedEmbedBlock = (props
|
|
176
|
+
const createUpgradedEmbedBlock = function (props) {
|
|
166
177
|
var _getBlockVariations3;
|
|
167
178
|
|
|
179
|
+
let attributesFromPreview = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
168
180
|
const {
|
|
169
181
|
preview,
|
|
170
182
|
attributes = {}
|
|
@@ -192,9 +204,12 @@ const createUpgradedEmbedBlock = (props, attributesFromPreview = {}) => {
|
|
|
192
204
|
});
|
|
193
205
|
}
|
|
194
206
|
|
|
195
|
-
const wpVariation = (_getBlockVariations3 = (0, _blocks.getBlockVariations)(DEFAULT_EMBED_BLOCK)) === null || _getBlockVariations3 === void 0 ? void 0 : _getBlockVariations3.find(
|
|
196
|
-
|
|
197
|
-
|
|
207
|
+
const wpVariation = (_getBlockVariations3 = (0, _blocks.getBlockVariations)(DEFAULT_EMBED_BLOCK)) === null || _getBlockVariations3 === void 0 ? void 0 : _getBlockVariations3.find(_ref3 => {
|
|
208
|
+
let {
|
|
209
|
+
name
|
|
210
|
+
} = _ref3;
|
|
211
|
+
return name === 'wordpress';
|
|
212
|
+
}); // We can't match the URL for WordPress embeds, we have to check the HTML instead.
|
|
198
213
|
|
|
199
214
|
if (!wpVariation || !preview || !isFromWordPress(preview.html) || isCurrentBlockWP) {
|
|
200
215
|
return;
|
|
@@ -233,9 +248,10 @@ const removeAspectRatioClasses = existingClassNames => {
|
|
|
233
248
|
return existingClassNames;
|
|
234
249
|
}
|
|
235
250
|
|
|
236
|
-
const aspectRatioClassNames = _constants.ASPECT_RATIOS.reduce((accumulator, {
|
|
237
|
-
|
|
238
|
-
|
|
251
|
+
const aspectRatioClassNames = _constants.ASPECT_RATIOS.reduce((accumulator, _ref4) => {
|
|
252
|
+
let {
|
|
253
|
+
className
|
|
254
|
+
} = _ref4;
|
|
239
255
|
accumulator[className] = false;
|
|
240
256
|
return accumulator;
|
|
241
257
|
}, {
|
|
@@ -256,7 +272,9 @@ const removeAspectRatioClasses = existingClassNames => {
|
|
|
256
272
|
|
|
257
273
|
exports.removeAspectRatioClasses = removeAspectRatioClasses;
|
|
258
274
|
|
|
259
|
-
function getClassNames(html, existingClassNames
|
|
275
|
+
function getClassNames(html, existingClassNames) {
|
|
276
|
+
let allowResponsive = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
277
|
+
|
|
260
278
|
if (!allowResponsive) {
|
|
261
279
|
return removeAspectRatioClasses(existingClassNames);
|
|
262
280
|
}
|
|
@@ -318,7 +336,9 @@ function fallback(url, onReplace) {
|
|
|
318
336
|
*/
|
|
319
337
|
|
|
320
338
|
|
|
321
|
-
const getAttributesFromPreview = (0, _memize.default)((preview, title, currentClassNames, isResponsive
|
|
339
|
+
const getAttributesFromPreview = (0, _memize.default)(function (preview, title, currentClassNames, isResponsive) {
|
|
340
|
+
let allowResponsive = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
|
|
341
|
+
|
|
322
342
|
if (!preview) {
|
|
323
343
|
return {};
|
|
324
344
|
}
|
package/build/embed/util.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/embed/util.js"],"names":["name","DEFAULT_EMBED_BLOCK","metadata","getEmbedInfoByProvider","provider","find","matchesPatterns","url","patterns","some","pattern","match","findMoreSuitableBlock","isFromWordPress","html","includes","getPhotoHtml","photo","imageUrl","thumbnail_url","photoPreview","title","createUpgradedEmbedBlock","props","attributesFromPreview","preview","attributes","providerNameSlug","type","restAttributes","matchedBlock","isCurrentBlockWP","WP_EMBED_TYPE","shouldCreateNewBlock","wpVariation","removeAspectRatioClasses","existingClassNames","aspectRatioClassNames","ASPECT_RATIOS","reduce","accumulator","className","getClassNames","allowResponsive","previewDocument","document","implementation","createHTMLDocument","body","innerHTML","iframe","querySelector","height","width","aspectRatio","toFixed","ratioIndex","length","potentialRatio","ratio","ratioDiff","fallback","onReplace","link","content","getAttributesFromPreview","currentClassNames","isResponsive","provider_name","providerName","toLowerCase"],"mappings":";;;;;;;;;;;AAeA;;AAZA;;AAKA;;AACA;;AACA;;AAMA;;A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,IAAAA,aAAa,EAAEC;AAAvB,MAAwC5C,OAA9C;AACA,QAAME,gBAAgB,GAAG,uBACxB,CAAE0C,YAAY,IAAIhD,KAAlB,EAA0BiD,WAA1B,EADwB,CAAzB;;AAIA,MAAKzD,eAAe,CAAEC,IAAF,CAApB,EAA+B;AAC9Bc,IAAAA,IAAI,GAAGI,wBAAP;AACA;;AAED,MAAKlB,IAAI,IAAI,YAAYc,IAAzB,EAAgC;AAC/BF,IAAAA,UAAU,CAACE,IAAX,GAAkBA,IAAlB;AACAF,IAAAA,UAAU,CAACC,gBAAX,GAA8BA,gBAA9B;AACA;;AAEDD,EAAAA,UAAU,CAACe,SAAX,GAAuBC,aAAa,CACnC5B,IADmC,EAEnCoD,iBAFmC,EAGnCC,YAAY,IAAIxB,eAHmB,CAApC;AAMA,SAAOjB,UAAP;AACA,CAtCsC,CAAjC","sourcesContent":["/**\n * Internal dependencies\n */\nimport { ASPECT_RATIOS, WP_EMBED_TYPE } from './constants';\n\n/**\n * External dependencies\n */\nimport { kebabCase } from 'lodash';\nimport classnames from 'classnames/dedupe';\nimport memoize from 'memize';\n\n/**\n * WordPress dependencies\n */\nimport { renderToString } from '@wordpress/element';\nimport {\n\tcreateBlock,\n\tgetBlockType,\n\tgetBlockVariations,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport metadata from './block.json';\n\nconst { name: DEFAULT_EMBED_BLOCK } = metadata;\n\n/** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */\n\n/**\n * Returns the embed block's information by matching the provided service provider\n *\n * @param {string} provider The embed block's provider\n * @return {WPBlockVariation} The embed block's information\n */\nexport const getEmbedInfoByProvider = ( provider ) =>\n\tgetBlockVariations( DEFAULT_EMBED_BLOCK )?.find(\n\t\t( { name } ) => name === provider\n\t);\n\n/**\n * Returns true if any of the regular expressions match the URL.\n *\n * @param {string} url The URL to test.\n * @param {Array} patterns The list of regular expressions to test agains.\n * @return {boolean} True if any of the regular expressions match the URL.\n */\nexport const matchesPatterns = ( url, patterns = [] ) =>\n\tpatterns.some( ( pattern ) => url.match( pattern ) );\n\n/**\n * Finds the block variation that should be used for the URL,\n * based on the provided URL and the variation's patterns.\n *\n * @param {string} url The URL to test.\n * @return {WPBlockVariation} The block variation that should be used for this URL\n */\nexport const findMoreSuitableBlock = ( url ) =>\n\tgetBlockVariations( DEFAULT_EMBED_BLOCK )?.find( ( { patterns } ) =>\n\t\tmatchesPatterns( url, patterns )\n\t);\n\nexport const isFromWordPress = ( html ) =>\n\thtml && html.includes( 'class=\"wp-embedded-content\"' );\n\nexport const getPhotoHtml = ( photo ) => {\n\t// 100% width for the preview so it fits nicely into the document, some \"thumbnails\" are\n\t// actually the full size photo. If thumbnails not found, use full image.\n\tconst imageUrl = photo.thumbnail_url || photo.url;\n\tconst photoPreview = (\n\t\t<p>\n\t\t\t<img src={ imageUrl } alt={ photo.title } width=\"100%\" />\n\t\t</p>\n\t);\n\treturn renderToString( photoPreview );\n};\n\n/**\n * Creates a more suitable embed block based on the passed in props\n * and attributes generated from an embed block's preview.\n *\n * We require `attributesFromPreview` to be generated from the latest attributes\n * and preview, and because of the way the react lifecycle operates, we can't\n * guarantee that the attributes contained in the block's props are the latest\n * versions, so we require that these are generated separately.\n * See `getAttributesFromPreview` in the generated embed edit component.\n *\n * @param {Object} props The block's props.\n * @param {Object} [attributesFromPreview] Attributes generated from the block's most up to date preview.\n * @return {Object|undefined} A more suitable embed block if one exists.\n */\nexport const createUpgradedEmbedBlock = (\n\tprops,\n\tattributesFromPreview = {}\n) => {\n\tconst { preview, attributes = {} } = props;\n\tconst { url, providerNameSlug, type, ...restAttributes } = attributes;\n\n\tif ( ! url || ! getBlockType( DEFAULT_EMBED_BLOCK ) ) return;\n\n\tconst matchedBlock = findMoreSuitableBlock( url );\n\n\t// WordPress blocks can work on multiple sites, and so don't have patterns,\n\t// so if we're in a WordPress block, assume the user has chosen it for a WordPress URL.\n\tconst isCurrentBlockWP =\n\t\tproviderNameSlug === 'wordpress' || type === WP_EMBED_TYPE;\n\t// if current block is not WordPress and a more suitable block found\n\t// that is different from the current one, create the new matched block\n\tconst shouldCreateNewBlock =\n\t\t! isCurrentBlockWP &&\n\t\tmatchedBlock &&\n\t\t( matchedBlock.attributes.providerNameSlug !== providerNameSlug ||\n\t\t\t! providerNameSlug );\n\tif ( shouldCreateNewBlock ) {\n\t\treturn createBlock( DEFAULT_EMBED_BLOCK, {\n\t\t\turl,\n\t\t\t...restAttributes,\n\t\t\t...matchedBlock.attributes,\n\t\t} );\n\t}\n\n\tconst wpVariation = getBlockVariations( DEFAULT_EMBED_BLOCK )?.find(\n\t\t( { name } ) => name === 'wordpress'\n\t);\n\n\t// We can't match the URL for WordPress embeds, we have to check the HTML instead.\n\tif (\n\t\t! wpVariation ||\n\t\t! preview ||\n\t\t! isFromWordPress( preview.html ) ||\n\t\tisCurrentBlockWP\n\t) {\n\t\treturn;\n\t}\n\n\t// This is not the WordPress embed block so transform it into one.\n\treturn createBlock( DEFAULT_EMBED_BLOCK, {\n\t\turl,\n\t\t...wpVariation.attributes,\n\t\t// By now we have the preview, but when the new block first renders, it\n\t\t// won't have had all the attributes set, and so won't get the correct\n\t\t// type and it won't render correctly. So, we pass through the current attributes\n\t\t// here so that the initial render works when we switch to the WordPress\n\t\t// block. This only affects the WordPress block because it can't be\n\t\t// rendered in the usual Sandbox (it has a sandbox of its own) and it\n\t\t// relies on the preview to set the correct render type.\n\t\t...attributesFromPreview,\n\t} );\n};\n\n/**\n * Removes all previously set aspect ratio related classes and return the rest\n * existing class names.\n *\n * @param {string} existingClassNames Any existing class names.\n * @return {string} The class names without any aspect ratio related class.\n */\nexport const removeAspectRatioClasses = ( existingClassNames ) => {\n\tif ( ! existingClassNames ) {\n\t\t// Avoids extraneous work and also, by returning the same value as\n\t\t// received, ensures the post is not dirtied by a change of the block\n\t\t// attribute from `undefined` to an emtpy string.\n\t\treturn existingClassNames;\n\t}\n\tconst aspectRatioClassNames = ASPECT_RATIOS.reduce(\n\t\t( accumulator, { className } ) => {\n\t\t\taccumulator[ className ] = false;\n\t\t\treturn accumulator;\n\t\t},\n\t\t{ 'wp-has-aspect-ratio': false }\n\t);\n\treturn classnames( existingClassNames, aspectRatioClassNames );\n};\n\n/**\n * Returns class names with any relevant responsive aspect ratio names.\n *\n * @param {string} html The preview HTML that possibly contains an iframe with width and height set.\n * @param {string} existingClassNames Any existing class names.\n * @param {boolean} allowResponsive If the responsive class names should be added, or removed.\n * @return {string} Deduped class names.\n */\nexport function getClassNames(\n\thtml,\n\texistingClassNames,\n\tallowResponsive = true\n) {\n\tif ( ! allowResponsive ) {\n\t\treturn removeAspectRatioClasses( existingClassNames );\n\t}\n\n\tconst previewDocument = document.implementation.createHTMLDocument( '' );\n\tpreviewDocument.body.innerHTML = html;\n\tconst iframe = previewDocument.body.querySelector( 'iframe' );\n\n\t// If we have a fixed aspect iframe, and it's a responsive embed block.\n\tif ( iframe && iframe.height && iframe.width ) {\n\t\tconst aspectRatio = ( iframe.width / iframe.height ).toFixed( 2 );\n\t\t// Given the actual aspect ratio, find the widest ratio to support it.\n\t\tfor (\n\t\t\tlet ratioIndex = 0;\n\t\t\tratioIndex < ASPECT_RATIOS.length;\n\t\t\tratioIndex++\n\t\t) {\n\t\t\tconst potentialRatio = ASPECT_RATIOS[ ratioIndex ];\n\t\t\tif ( aspectRatio >= potentialRatio.ratio ) {\n\t\t\t\t// Evaluate the difference between actual aspect ratio and closest match.\n\t\t\t\t// If the difference is too big, do not scale the embed according to aspect ratio.\n\t\t\t\tconst ratioDiff = aspectRatio - potentialRatio.ratio;\n\t\t\t\tif ( ratioDiff > 0.1 ) {\n\t\t\t\t\t// No close aspect ratio match found.\n\t\t\t\t\treturn removeAspectRatioClasses( existingClassNames );\n\t\t\t\t}\n\t\t\t\t// Close aspect ratio match found.\n\t\t\t\treturn classnames(\n\t\t\t\t\tremoveAspectRatioClasses( existingClassNames ),\n\t\t\t\t\tpotentialRatio.className,\n\t\t\t\t\t'wp-has-aspect-ratio'\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn existingClassNames;\n}\n\n/**\n * Fallback behaviour for unembeddable URLs.\n * Creates a paragraph block containing a link to the URL, and calls `onReplace`.\n *\n * @param {string} url The URL that could not be embedded.\n * @param {Function} onReplace Function to call with the created fallback block.\n */\nexport function fallback( url, onReplace ) {\n\tconst link = <a href={ url }>{ url }</a>;\n\tonReplace(\n\t\tcreateBlock( 'core/paragraph', { content: renderToString( link ) } )\n\t);\n}\n\n/***\n * Gets block attributes based on the preview and responsive state.\n *\n * @param {Object} preview The preview data.\n * @param {string} title The block's title, e.g. Twitter.\n * @param {Object} currentClassNames The block's current class names.\n * @param {boolean} isResponsive Boolean indicating if the block supports responsive content.\n * @param {boolean} allowResponsive Apply responsive classes to fixed size content.\n * @return {Object} Attributes and values.\n */\nexport const getAttributesFromPreview = memoize(\n\t(\n\t\tpreview,\n\t\ttitle,\n\t\tcurrentClassNames,\n\t\tisResponsive,\n\t\tallowResponsive = true\n\t) => {\n\t\tif ( ! preview ) {\n\t\t\treturn {};\n\t\t}\n\n\t\tconst attributes = {};\n\t\t// Some plugins only return HTML with no type info, so default this to 'rich'.\n\t\tlet { type = 'rich' } = preview;\n\t\t// If we got a provider name from the API, use it for the slug, otherwise we use the title,\n\t\t// because not all embed code gives us a provider name.\n\t\tconst { html, provider_name: providerName } = preview;\n\t\tconst providerNameSlug = kebabCase(\n\t\t\t( providerName || title ).toLowerCase()\n\t\t);\n\n\t\tif ( isFromWordPress( html ) ) {\n\t\t\ttype = WP_EMBED_TYPE;\n\t\t}\n\n\t\tif ( html || 'photo' === type ) {\n\t\t\tattributes.type = type;\n\t\t\tattributes.providerNameSlug = providerNameSlug;\n\t\t}\n\n\t\tattributes.className = getClassNames(\n\t\t\thtml,\n\t\t\tcurrentClassNames,\n\t\t\tisResponsive && allowResponsive\n\t\t);\n\n\t\treturn attributes;\n\t}\n);\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/embed/util.js"],"names":["name","DEFAULT_EMBED_BLOCK","metadata","getEmbedInfoByProvider","provider","find","matchesPatterns","url","patterns","some","pattern","match","findMoreSuitableBlock","isFromWordPress","html","includes","getPhotoHtml","photo","imageUrl","thumbnail_url","photoPreview","title","createUpgradedEmbedBlock","props","attributesFromPreview","preview","attributes","providerNameSlug","type","restAttributes","matchedBlock","isCurrentBlockWP","WP_EMBED_TYPE","shouldCreateNewBlock","wpVariation","removeAspectRatioClasses","existingClassNames","aspectRatioClassNames","ASPECT_RATIOS","reduce","accumulator","className","getClassNames","allowResponsive","previewDocument","document","implementation","createHTMLDocument","body","innerHTML","iframe","querySelector","height","width","aspectRatio","toFixed","ratioIndex","length","potentialRatio","ratio","ratioDiff","fallback","onReplace","link","content","getAttributesFromPreview","currentClassNames","isResponsive","provider_name","providerName","toLowerCase"],"mappings":";;;;;;;;;;;;;AAeA;;AAZA;;AAKA;;AACA;;AACA;;AAMA;;AAhBA;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;;AAQA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,MAAM;AAAEA,EAAAA,IAAI,EAAEC;AAAR,IAAgCC,QAAtC;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AACO,MAAMC,sBAAsB,GAAKC,QAAF;AAAA;;AAAA,gCACrC,gCAAoBH,mBAApB,CADqC,wDACrC,oBAA2CI,IAA3C,CACC;AAAA,QAAE;AAAEL,MAAAA;AAAF,KAAF;AAAA,WAAgBA,IAAI,KAAKI,QAAzB;AAAA,GADD,CADqC;AAAA,CAA/B;AAKP;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAME,eAAe,GAAG,UAAEC,GAAF;AAAA,MAAOC,QAAP,uEAAkB,EAAlB;AAAA,SAC9BA,QAAQ,CAACC,IAAT,CAAiBC,OAAF,IAAeH,GAAG,CAACI,KAAJ,CAAWD,OAAX,CAA9B,CAD8B;AAAA,CAA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tCsC,CAAjC","sourcesContent":["/**\n * Internal dependencies\n */\nimport { ASPECT_RATIOS, WP_EMBED_TYPE } from './constants';\n\n/**\n * External dependencies\n */\nimport { kebabCase } from 'lodash';\nimport classnames from 'classnames/dedupe';\nimport memoize from 'memize';\n\n/**\n * WordPress dependencies\n */\nimport { renderToString } from '@wordpress/element';\nimport {\n\tcreateBlock,\n\tgetBlockType,\n\tgetBlockVariations,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport metadata from './block.json';\n\nconst { name: DEFAULT_EMBED_BLOCK } = metadata;\n\n/** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */\n\n/**\n * Returns the embed block's information by matching the provided service provider\n *\n * @param {string} provider The embed block's provider\n * @return {WPBlockVariation} The embed block's information\n */\nexport const getEmbedInfoByProvider = ( provider ) =>\n\tgetBlockVariations( DEFAULT_EMBED_BLOCK )?.find(\n\t\t( { name } ) => name === provider\n\t);\n\n/**\n * Returns true if any of the regular expressions match the URL.\n *\n * @param {string} url The URL to test.\n * @param {Array} patterns The list of regular expressions to test agains.\n * @return {boolean} True if any of the regular expressions match the URL.\n */\nexport const matchesPatterns = ( url, patterns = [] ) =>\n\tpatterns.some( ( pattern ) => url.match( pattern ) );\n\n/**\n * Finds the block variation that should be used for the URL,\n * based on the provided URL and the variation's patterns.\n *\n * @param {string} url The URL to test.\n * @return {WPBlockVariation} The block variation that should be used for this URL\n */\nexport const findMoreSuitableBlock = ( url ) =>\n\tgetBlockVariations( DEFAULT_EMBED_BLOCK )?.find( ( { patterns } ) =>\n\t\tmatchesPatterns( url, patterns )\n\t);\n\nexport const isFromWordPress = ( html ) =>\n\thtml && html.includes( 'class=\"wp-embedded-content\"' );\n\nexport const getPhotoHtml = ( photo ) => {\n\t// 100% width for the preview so it fits nicely into the document, some \"thumbnails\" are\n\t// actually the full size photo. If thumbnails not found, use full image.\n\tconst imageUrl = photo.thumbnail_url || photo.url;\n\tconst photoPreview = (\n\t\t<p>\n\t\t\t<img src={ imageUrl } alt={ photo.title } width=\"100%\" />\n\t\t</p>\n\t);\n\treturn renderToString( photoPreview );\n};\n\n/**\n * Creates a more suitable embed block based on the passed in props\n * and attributes generated from an embed block's preview.\n *\n * We require `attributesFromPreview` to be generated from the latest attributes\n * and preview, and because of the way the react lifecycle operates, we can't\n * guarantee that the attributes contained in the block's props are the latest\n * versions, so we require that these are generated separately.\n * See `getAttributesFromPreview` in the generated embed edit component.\n *\n * @param {Object} props The block's props.\n * @param {Object} [attributesFromPreview] Attributes generated from the block's most up to date preview.\n * @return {Object|undefined} A more suitable embed block if one exists.\n */\nexport const createUpgradedEmbedBlock = (\n\tprops,\n\tattributesFromPreview = {}\n) => {\n\tconst { preview, attributes = {} } = props;\n\tconst { url, providerNameSlug, type, ...restAttributes } = attributes;\n\n\tif ( ! url || ! getBlockType( DEFAULT_EMBED_BLOCK ) ) return;\n\n\tconst matchedBlock = findMoreSuitableBlock( url );\n\n\t// WordPress blocks can work on multiple sites, and so don't have patterns,\n\t// so if we're in a WordPress block, assume the user has chosen it for a WordPress URL.\n\tconst isCurrentBlockWP =\n\t\tproviderNameSlug === 'wordpress' || type === WP_EMBED_TYPE;\n\t// if current block is not WordPress and a more suitable block found\n\t// that is different from the current one, create the new matched block\n\tconst shouldCreateNewBlock =\n\t\t! isCurrentBlockWP &&\n\t\tmatchedBlock &&\n\t\t( matchedBlock.attributes.providerNameSlug !== providerNameSlug ||\n\t\t\t! providerNameSlug );\n\tif ( shouldCreateNewBlock ) {\n\t\treturn createBlock( DEFAULT_EMBED_BLOCK, {\n\t\t\turl,\n\t\t\t...restAttributes,\n\t\t\t...matchedBlock.attributes,\n\t\t} );\n\t}\n\n\tconst wpVariation = getBlockVariations( DEFAULT_EMBED_BLOCK )?.find(\n\t\t( { name } ) => name === 'wordpress'\n\t);\n\n\t// We can't match the URL for WordPress embeds, we have to check the HTML instead.\n\tif (\n\t\t! wpVariation ||\n\t\t! preview ||\n\t\t! isFromWordPress( preview.html ) ||\n\t\tisCurrentBlockWP\n\t) {\n\t\treturn;\n\t}\n\n\t// This is not the WordPress embed block so transform it into one.\n\treturn createBlock( DEFAULT_EMBED_BLOCK, {\n\t\turl,\n\t\t...wpVariation.attributes,\n\t\t// By now we have the preview, but when the new block first renders, it\n\t\t// won't have had all the attributes set, and so won't get the correct\n\t\t// type and it won't render correctly. So, we pass through the current attributes\n\t\t// here so that the initial render works when we switch to the WordPress\n\t\t// block. This only affects the WordPress block because it can't be\n\t\t// rendered in the usual Sandbox (it has a sandbox of its own) and it\n\t\t// relies on the preview to set the correct render type.\n\t\t...attributesFromPreview,\n\t} );\n};\n\n/**\n * Removes all previously set aspect ratio related classes and return the rest\n * existing class names.\n *\n * @param {string} existingClassNames Any existing class names.\n * @return {string} The class names without any aspect ratio related class.\n */\nexport const removeAspectRatioClasses = ( existingClassNames ) => {\n\tif ( ! existingClassNames ) {\n\t\t// Avoids extraneous work and also, by returning the same value as\n\t\t// received, ensures the post is not dirtied by a change of the block\n\t\t// attribute from `undefined` to an emtpy string.\n\t\treturn existingClassNames;\n\t}\n\tconst aspectRatioClassNames = ASPECT_RATIOS.reduce(\n\t\t( accumulator, { className } ) => {\n\t\t\taccumulator[ className ] = false;\n\t\t\treturn accumulator;\n\t\t},\n\t\t{ 'wp-has-aspect-ratio': false }\n\t);\n\treturn classnames( existingClassNames, aspectRatioClassNames );\n};\n\n/**\n * Returns class names with any relevant responsive aspect ratio names.\n *\n * @param {string} html The preview HTML that possibly contains an iframe with width and height set.\n * @param {string} existingClassNames Any existing class names.\n * @param {boolean} allowResponsive If the responsive class names should be added, or removed.\n * @return {string} Deduped class names.\n */\nexport function getClassNames(\n\thtml,\n\texistingClassNames,\n\tallowResponsive = true\n) {\n\tif ( ! allowResponsive ) {\n\t\treturn removeAspectRatioClasses( existingClassNames );\n\t}\n\n\tconst previewDocument = document.implementation.createHTMLDocument( '' );\n\tpreviewDocument.body.innerHTML = html;\n\tconst iframe = previewDocument.body.querySelector( 'iframe' );\n\n\t// If we have a fixed aspect iframe, and it's a responsive embed block.\n\tif ( iframe && iframe.height && iframe.width ) {\n\t\tconst aspectRatio = ( iframe.width / iframe.height ).toFixed( 2 );\n\t\t// Given the actual aspect ratio, find the widest ratio to support it.\n\t\tfor (\n\t\t\tlet ratioIndex = 0;\n\t\t\tratioIndex < ASPECT_RATIOS.length;\n\t\t\tratioIndex++\n\t\t) {\n\t\t\tconst potentialRatio = ASPECT_RATIOS[ ratioIndex ];\n\t\t\tif ( aspectRatio >= potentialRatio.ratio ) {\n\t\t\t\t// Evaluate the difference between actual aspect ratio and closest match.\n\t\t\t\t// If the difference is too big, do not scale the embed according to aspect ratio.\n\t\t\t\tconst ratioDiff = aspectRatio - potentialRatio.ratio;\n\t\t\t\tif ( ratioDiff > 0.1 ) {\n\t\t\t\t\t// No close aspect ratio match found.\n\t\t\t\t\treturn removeAspectRatioClasses( existingClassNames );\n\t\t\t\t}\n\t\t\t\t// Close aspect ratio match found.\n\t\t\t\treturn classnames(\n\t\t\t\t\tremoveAspectRatioClasses( existingClassNames ),\n\t\t\t\t\tpotentialRatio.className,\n\t\t\t\t\t'wp-has-aspect-ratio'\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn existingClassNames;\n}\n\n/**\n * Fallback behaviour for unembeddable URLs.\n * Creates a paragraph block containing a link to the URL, and calls `onReplace`.\n *\n * @param {string} url The URL that could not be embedded.\n * @param {Function} onReplace Function to call with the created fallback block.\n */\nexport function fallback( url, onReplace ) {\n\tconst link = <a href={ url }>{ url }</a>;\n\tonReplace(\n\t\tcreateBlock( 'core/paragraph', { content: renderToString( link ) } )\n\t);\n}\n\n/***\n * Gets block attributes based on the preview and responsive state.\n *\n * @param {Object} preview The preview data.\n * @param {string} title The block's title, e.g. Twitter.\n * @param {Object} currentClassNames The block's current class names.\n * @param {boolean} isResponsive Boolean indicating if the block supports responsive content.\n * @param {boolean} allowResponsive Apply responsive classes to fixed size content.\n * @return {Object} Attributes and values.\n */\nexport const getAttributesFromPreview = memoize(\n\t(\n\t\tpreview,\n\t\ttitle,\n\t\tcurrentClassNames,\n\t\tisResponsive,\n\t\tallowResponsive = true\n\t) => {\n\t\tif ( ! preview ) {\n\t\t\treturn {};\n\t\t}\n\n\t\tconst attributes = {};\n\t\t// Some plugins only return HTML with no type info, so default this to 'rich'.\n\t\tlet { type = 'rich' } = preview;\n\t\t// If we got a provider name from the API, use it for the slug, otherwise we use the title,\n\t\t// because not all embed code gives us a provider name.\n\t\tconst { html, provider_name: providerName } = preview;\n\t\tconst providerNameSlug = kebabCase(\n\t\t\t( providerName || title ).toLowerCase()\n\t\t);\n\n\t\tif ( isFromWordPress( html ) ) {\n\t\t\ttype = WP_EMBED_TYPE;\n\t\t}\n\n\t\tif ( html || 'photo' === type ) {\n\t\t\tattributes.type = type;\n\t\t\tattributes.providerNameSlug = providerNameSlug;\n\t\t}\n\n\t\tattributes.className = getClassNames(\n\t\t\thtml,\n\t\t\tcurrentClassNames,\n\t\t\tisResponsive && allowResponsive\n\t\t);\n\n\t\treturn attributes;\n\t}\n);\n"]}
|
|
@@ -25,19 +25,21 @@ const attributeMap = {
|
|
|
25
25
|
marginwidth: 'marginWidth'
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
function WpEmbedPreview({
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
function WpEmbedPreview(_ref) {
|
|
29
|
+
let {
|
|
30
|
+
html
|
|
31
|
+
} = _ref;
|
|
31
32
|
const ref = (0, _element.useRef)();
|
|
32
33
|
const props = (0, _element.useMemo)(() => {
|
|
33
34
|
const doc = new window.DOMParser().parseFromString(html, 'text/html');
|
|
34
35
|
const iframe = doc.querySelector('iframe');
|
|
35
36
|
const iframeProps = {};
|
|
36
37
|
if (!iframe) return iframeProps;
|
|
37
|
-
Array.from(iframe.attributes).forEach(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
Array.from(iframe.attributes).forEach(_ref2 => {
|
|
39
|
+
let {
|
|
40
|
+
name,
|
|
41
|
+
value
|
|
42
|
+
} = _ref2;
|
|
41
43
|
if (name === 'style') return;
|
|
42
44
|
iframeProps[attributeMap[name] || name] = value;
|
|
43
45
|
});
|
|
@@ -66,13 +68,15 @@ function WpEmbedPreview({
|
|
|
66
68
|
* @param {MessageEvent} event Message event.
|
|
67
69
|
*/
|
|
68
70
|
|
|
69
|
-
function resizeWPembeds({
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
71
|
+
function resizeWPembeds(_ref3) {
|
|
72
|
+
let {
|
|
73
|
+
data: {
|
|
74
|
+
secret,
|
|
75
|
+
message,
|
|
76
|
+
value
|
|
77
|
+
} = {}
|
|
78
|
+
} = _ref3;
|
|
79
|
+
|
|
76
80
|
if (message !== 'height' || secret !== props['data-secret']) {
|
|
77
81
|
return;
|
|
78
82
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/embed/wp-embed-preview.js"],"names":["attributeMap","class","frameborder","marginheight","marginwidth","WpEmbedPreview","html","ref","props","doc","window","DOMParser","parseFromString","iframe","querySelector","iframeProps","Array","from","attributes","forEach","name","value","ownerDocument","current","defaultView","resizeWPembeds","data","secret","message","height","addEventListener","removeEventListener","title"],"mappings":";;;;;;;;;AAIA;;;;AADA;;AAHA;AACA;AACA;;AAIA;AAEA,MAAMA,YAAY,GAAG;AACpBC,EAAAA,KAAK,EAAE,WADa;AAEpBC,EAAAA,WAAW,EAAE,aAFO;AAGpBC,EAAAA,YAAY,EAAE,cAHM;AAIpBC,EAAAA,WAAW,EAAE;AAJO,CAArB;;AAOe,SAASC,cAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/embed/wp-embed-preview.js"],"names":["attributeMap","class","frameborder","marginheight","marginwidth","WpEmbedPreview","html","ref","props","doc","window","DOMParser","parseFromString","iframe","querySelector","iframeProps","Array","from","attributes","forEach","name","value","ownerDocument","current","defaultView","resizeWPembeds","data","secret","message","height","addEventListener","removeEventListener","title"],"mappings":";;;;;;;;;AAIA;;;;AADA;;AAHA;AACA;AACA;;AAIA;AAEA,MAAMA,YAAY,GAAG;AACpBC,EAAAA,KAAK,EAAE,WADa;AAEpBC,EAAAA,WAAW,EAAE,aAFO;AAGpBC,EAAAA,YAAY,EAAE,cAHM;AAIpBC,EAAAA,WAAW,EAAE;AAJO,CAArB;;AAOe,SAASC,cAAT,OAAoC;AAAA,MAAX;AAAEC,IAAAA;AAAF,GAAW;AAClD,QAAMC,GAAG,GAAG,sBAAZ;AACA,QAAMC,KAAK,GAAG,sBAAS,MAAM;AAC5B,UAAMC,GAAG,GAAG,IAAIC,MAAM,CAACC,SAAX,GAAuBC,eAAvB,CAAwCN,IAAxC,EAA8C,WAA9C,CAAZ;AACA,UAAMO,MAAM,GAAGJ,GAAG,CAACK,aAAJ,CAAmB,QAAnB,CAAf;AACA,UAAMC,WAAW,GAAG,EAApB;AAEA,QAAK,CAAEF,MAAP,EAAgB,OAAOE,WAAP;AAEhBC,IAAAA,KAAK,CAACC,IAAN,CAAYJ,MAAM,CAACK,UAAnB,EAAgCC,OAAhC,CAAyC,SAAuB;AAAA,UAArB;AAAEC,QAAAA,IAAF;AAAQC,QAAAA;AAAR,OAAqB;AAC/D,UAAKD,IAAI,KAAK,OAAd,EAAwB;AACxBL,MAAAA,WAAW,CAAEf,YAAY,CAAEoB,IAAF,CAAZ,IAAwBA,IAA1B,CAAX,GAA8CC,KAA9C;AACA,KAHD;AAKA,WAAON,WAAP;AACA,GAba,EAaX,CAAET,IAAF,CAbW,CAAd;AAeA,0BAAW,MAAM;AAChB,UAAM;AAAEgB,MAAAA;AAAF,QAAoBf,GAAG,CAACgB,OAA9B;AACA,UAAM;AAAEC,MAAAA;AAAF,QAAkBF,aAAxB;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACE,aAASG,cAAT,QAAqE;AAAA,UAA5C;AAAEC,QAAAA,IAAI,EAAE;AAAEC,UAAAA,MAAF;AAAUC,UAAAA,OAAV;AAAmBP,UAAAA;AAAnB,YAA6B;AAArC,OAA4C;;AACpE,UAAKO,OAAO,KAAK,QAAZ,IAAwBD,MAAM,KAAKnB,KAAK,CAAE,aAAF,CAA7C,EAAiE;AAChE;AACA;;AAEDD,MAAAA,GAAG,CAACgB,OAAJ,CAAYM,MAAZ,GAAqBR,KAArB;AACA;;AAEDG,IAAAA,WAAW,CAACM,gBAAZ,CAA8B,SAA9B,EAAyCL,cAAzC;AACA,WAAO,MAAM;AACZD,MAAAA,WAAW,CAACO,mBAAZ,CAAiC,SAAjC,EAA4CN,cAA5C;AACA,KAFD;AAGA,GA/BD,EA+BG,EA/BH;AAiCA,SACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC;AACC,IAAA,GAAG,EAAG,2BAAc,CAAElB,GAAF,EAAO,kCAAP,CAAd,CADP;AAEC,IAAA,KAAK,EAAGC,KAAK,CAACwB;AAFf,KAGMxB,KAHN,EADD,CADD;AASA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMergeRefs, useFocusableIframe } from '@wordpress/compose';\nimport { useRef, useEffect, useMemo } from '@wordpress/element';\n\n/** @typedef {import('@wordpress/element').WPSyntheticEvent} WPSyntheticEvent */\n\nconst attributeMap = {\n\tclass: 'className',\n\tframeborder: 'frameBorder',\n\tmarginheight: 'marginHeight',\n\tmarginwidth: 'marginWidth',\n};\n\nexport default function WpEmbedPreview( { html } ) {\n\tconst ref = useRef();\n\tconst props = useMemo( () => {\n\t\tconst doc = new window.DOMParser().parseFromString( html, 'text/html' );\n\t\tconst iframe = doc.querySelector( 'iframe' );\n\t\tconst iframeProps = {};\n\n\t\tif ( ! iframe ) return iframeProps;\n\n\t\tArray.from( iframe.attributes ).forEach( ( { name, value } ) => {\n\t\t\tif ( name === 'style' ) return;\n\t\t\tiframeProps[ attributeMap[ name ] || name ] = value;\n\t\t} );\n\n\t\treturn iframeProps;\n\t}, [ html ] );\n\n\tuseEffect( () => {\n\t\tconst { ownerDocument } = ref.current;\n\t\tconst { defaultView } = ownerDocument;\n\n\t\t/**\n\t\t * Checks for WordPress embed events signaling the height change when\n\t\t * iframe content loads or iframe's window is resized. The event is\n\t\t * sent from WordPress core via the window.postMessage API.\n\t\t *\n\t\t * References:\n\t\t * window.postMessage:\n\t\t * https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage\n\t\t * WordPress core embed-template on load:\n\t\t * https://github.com/WordPress/WordPress/blob/HEAD/wp-includes/js/wp-embed-template.js#L143\n\t\t * WordPress core embed-template on resize:\n\t\t * https://github.com/WordPress/WordPress/blob/HEAD/wp-includes/js/wp-embed-template.js#L187\n\t\t *\n\t\t * @param {MessageEvent} event Message event.\n\t\t */\n\t\tfunction resizeWPembeds( { data: { secret, message, value } = {} } ) {\n\t\t\tif ( message !== 'height' || secret !== props[ 'data-secret' ] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tref.current.height = value;\n\t\t}\n\n\t\tdefaultView.addEventListener( 'message', resizeWPembeds );\n\t\treturn () => {\n\t\t\tdefaultView.removeEventListener( 'message', resizeWPembeds );\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<div className=\"wp-block-embed__wrapper\">\n\t\t\t<iframe\n\t\t\t\tref={ useMergeRefs( [ ref, useFocusableIframe() ] ) }\n\t\t\t\ttitle={ props.title }\n\t\t\t\t{ ...props }\n\t\t\t/>\n\t\t</div>\n\t);\n}\n"]}
|
|
@@ -63,10 +63,11 @@ const observeAndResizeJS = `
|
|
|
63
63
|
window.addEventListener( 'message', sendResize );
|
|
64
64
|
} )();`;
|
|
65
65
|
|
|
66
|
-
function WpEmbedPreview({
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
function WpEmbedPreview(_ref) {
|
|
67
|
+
let {
|
|
68
|
+
html,
|
|
69
|
+
...rest
|
|
70
|
+
} = _ref;
|
|
70
71
|
const wpEmbedHtml = (0, _element.useMemo)(() => {
|
|
71
72
|
const doc = new window.DOMParser().parseFromString(html, 'text/html');
|
|
72
73
|
const iframe = doc.querySelector('iframe');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/embed/wp-embed-preview.native.js"],"names":["observeAndResizeJS","WpEmbedPreview","html","rest","wpEmbedHtml","doc","window","DOMParser","parseFromString","iframe","querySelector","removeAttribute","blockQuote","innerHTML","body"],"mappings":";;;;;;;;;AAGA;;;;AACA;;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,kBAAkB,GAAI;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAlCA;;AAoCA,SAASC,cAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/embed/wp-embed-preview.native.js"],"names":["observeAndResizeJS","WpEmbedPreview","html","rest","wpEmbedHtml","doc","window","DOMParser","parseFromString","iframe","querySelector","removeAttribute","blockQuote","innerHTML","body"],"mappings":";;;;;;;;;AAGA;;;;AACA;;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,kBAAkB,GAAI;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAlCA;;AAoCA,SAASC,cAAT,OAA6C;AAAA,MAApB;AAAEC,IAAAA,IAAF;AAAQ,OAAGC;AAAX,GAAoB;AAC5C,QAAMC,WAAW,GAAG,sBAAS,MAAM;AAClC,UAAMC,GAAG,GAAG,IAAIC,MAAM,CAACC,SAAX,GAAuBC,eAAvB,CAAwCN,IAAxC,EAA8C,WAA9C,CAAZ;AACA,UAAMO,MAAM,GAAGJ,GAAG,CAACK,aAAJ,CAAmB,QAAnB,CAAf;;AAEA,QAAKD,MAAL,EAAc;AACbA,MAAAA,MAAM,CAACE,eAAP,CAAwB,OAAxB;AACA;;AAED,UAAMC,UAAU,GAAGP,GAAG,CAACK,aAAJ,CAAmB,YAAnB,CAAnB;;AAEA,QAAKE,UAAL,EAAkB;AACjBA,MAAAA,UAAU,CAACC,SAAX,GAAuB,EAAvB;AACA;;AAED,WAAOR,GAAG,CAACS,IAAJ,CAASD,SAAhB;AACA,GAfmB,EAejB,CAAEX,IAAF,CAfiB,CAApB;AAiBA,SACC,4BAAC,mBAAD;AACC,IAAA,QAAQ,EAAGF,kBADZ;AAEC,IAAA,IAAI,EAAGI;AAFR,KAGMD,IAHN,EADD;AAOA;;eAEc,mBAAMF,cAAN,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { memo, useMemo } from '@wordpress/element';\nimport { SandBox } from '@wordpress/components';\n\n/**\n * Checks for WordPress embed events signaling the height change when iframe\n * content loads or iframe's window is resized. The event is sent from\n * WordPress core via the window.postMessage API.\n *\n * References:\n * window.postMessage: https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage\n * WordPress core embed-template on load: https://github.com/WordPress/WordPress/blob/HEAD/wp-includes/js/wp-embed-template.js#L143\n * WordPress core embed-template on resize: https://github.com/WordPress/WordPress/blob/HEAD/wp-includes/js/wp-embed-template.js#L187\n */\nconst observeAndResizeJS = `\n ( function() {\n if ( ! document.body || ! window.parent ) {\n return;\n }\n\n function sendResize( { data: { secret, message, value } = {} } ) {\n if (\n [ secret, message, value ].some(\n ( attribute ) => ! attribute\n ) ||\n message !== 'height'\n ) {\n return;\n }\n\n document\n .querySelectorAll( 'iframe[data-secret=\"' + secret + '\"' )\n .forEach( ( iframe ) => { \n if ( +iframe.height !== value ) {\n iframe.height = value;\n }\n } );\n\n // The function postMessage is exposed by the react-native-webview library \n // to communicate between React Native and the WebView, in this case, \n // we use it for notifying resize changes.\n window.ReactNativeWebView.postMessage(JSON.stringify( {\n action: 'resize',\n height: value,\n }));\n }\n\n window.addEventListener( 'message', sendResize );\n} )();`;\n\nfunction WpEmbedPreview( { html, ...rest } ) {\n\tconst wpEmbedHtml = useMemo( () => {\n\t\tconst doc = new window.DOMParser().parseFromString( html, 'text/html' );\n\t\tconst iframe = doc.querySelector( 'iframe' );\n\n\t\tif ( iframe ) {\n\t\t\tiframe.removeAttribute( 'style' );\n\t\t}\n\n\t\tconst blockQuote = doc.querySelector( 'blockquote' );\n\n\t\tif ( blockQuote ) {\n\t\t\tblockQuote.innerHTML = '';\n\t\t}\n\n\t\treturn doc.body.innerHTML;\n\t}, [ html ] );\n\n\treturn (\n\t\t<SandBox\n\t\t\tcustomJS={ observeAndResizeJS }\n\t\t\thtml={ wpEmbedHtml }\n\t\t\t{ ...rest }\n\t\t/>\n\t);\n}\n\nexport default memo( WpEmbedPreview );\n"]}
|