@wordpress/block-library 8.10.0 → 8.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/build/archives/edit.js +4 -5
- package/build/archives/edit.js.map +1 -1
- package/build/archives/index.js +1 -1
- package/build/audio/deprecated.js +3 -4
- package/build/audio/deprecated.js.map +1 -1
- package/build/audio/edit.js +9 -13
- package/build/audio/edit.js.map +1 -1
- package/build/audio/edit.native.js +22 -26
- package/build/audio/edit.native.js.map +1 -1
- package/build/audio/index.js +1 -1
- package/build/audio/save.js +3 -4
- package/build/audio/save.js.map +1 -1
- package/build/audio/transforms.js +25 -29
- package/build/audio/transforms.js.map +1 -1
- package/build/avatar/edit.js +62 -70
- package/build/avatar/edit.js.map +1 -1
- package/build/avatar/hooks.js +12 -16
- package/build/avatar/hooks.js.map +1 -1
- package/build/avatar/index.js +1 -1
- package/build/avatar/user-control.js +4 -5
- package/build/avatar/user-control.js.map +1 -1
- package/build/block/edit-title.native.js +4 -5
- package/build/block/edit-title.native.js.map +1 -1
- package/build/block/edit.js +7 -8
- package/build/block/edit.js.map +1 -1
- package/build/block/edit.native.js +24 -18
- package/build/block/edit.native.js.map +1 -1
- package/build/block/index.js +1 -1
- package/build/button/color-background.native.js +5 -6
- package/build/button/color-background.native.js.map +1 -1
- package/build/button/deprecated.js +55 -80
- package/build/button/deprecated.js.map +1 -1
- package/build/button/edit.js +12 -23
- package/build/button/edit.js.map +1 -1
- package/build/button/edit.native.js +38 -41
- package/build/button/edit.native.js.map +1 -1
- package/build/button/index.js +6 -9
- package/build/button/index.js.map +1 -1
- package/build/button/save.js +6 -9
- package/build/button/save.js.map +1 -1
- package/build/buttons/deprecated.js +13 -18
- package/build/buttons/deprecated.js.map +1 -1
- package/build/buttons/edit.js +6 -11
- package/build/buttons/edit.js.map +1 -1
- package/build/buttons/edit.native.js +13 -16
- package/build/buttons/edit.native.js.map +1 -1
- package/build/buttons/index.js +1 -1
- package/build/buttons/save.js +5 -8
- package/build/buttons/save.js.map +1 -1
- package/build/buttons/transforms.js +2 -2
- package/build/buttons/transforms.js.map +1 -1
- package/build/calendar/edit.js +4 -5
- package/build/calendar/edit.js.map +1 -1
- package/build/calendar/index.js +1 -1
- package/build/categories/edit.js +19 -23
- package/build/categories/edit.js.map +1 -1
- package/build/categories/index.js +1 -1
- package/build/code/edit.js +5 -6
- package/build/code/edit.js.map +1 -1
- package/build/code/edit.native.js +1 -1
- package/build/code/edit.native.js.map +1 -1
- package/build/code/index.js +2 -1
- package/build/code/index.js.map +1 -1
- package/build/code/save.js +3 -4
- package/build/code/save.js.map +1 -1
- package/build/code/transforms.js +6 -8
- package/build/code/transforms.js.map +1 -1
- package/build/column/column-preview.native.js +9 -11
- package/build/column/column-preview.native.js.map +1 -1
- package/build/column/deprecated.js +6 -8
- package/build/column/deprecated.js.map +1 -1
- package/build/column/edit.js +10 -11
- package/build/column/edit.js.map +1 -1
- package/build/column/edit.native.js +18 -23
- package/build/column/edit.native.js.map +1 -1
- package/build/column/index.js +2 -2
- package/build/column/save.js +4 -5
- package/build/column/save.js.map +1 -1
- package/build/columns/columnCalculations.native.js +13 -8
- package/build/columns/columnCalculations.native.js.map +1 -1
- package/build/columns/deprecated.js +9 -12
- package/build/columns/deprecated.js.map +1 -1
- package/build/columns/edit.js +15 -21
- package/build/columns/edit.js.map +1 -1
- package/build/columns/edit.native.js +12 -15
- package/build/columns/edit.native.js.map +1 -1
- package/build/columns/index.js +1 -1
- package/build/columns/save.js +3 -4
- package/build/columns/save.js.map +1 -1
- package/build/columns/transforms.js +12 -21
- package/build/columns/transforms.js.map +1 -1
- package/build/columns/utils.js +6 -13
- package/build/columns/utils.js.map +1 -1
- package/build/comment-author-avatar/edit.js +8 -9
- package/build/comment-author-avatar/edit.js.map +1 -1
- package/build/comment-author-avatar/index.js +1 -1
- package/build/comment-author-name/deprecated.js +4 -7
- package/build/comment-author-name/deprecated.js.map +1 -1
- package/build/comment-author-name/edit.js +13 -14
- package/build/comment-author-name/edit.js.map +1 -1
- package/build/comment-author-name/index.js +1 -1
- package/build/comment-content/edit.js +9 -10
- package/build/comment-content/edit.js.map +1 -1
- package/build/comment-content/index.js +1 -1
- package/build/comment-date/deprecated.js +4 -7
- package/build/comment-date/deprecated.js.map +1 -1
- package/build/comment-date/edit.js +10 -11
- package/build/comment-date/edit.js.map +1 -1
- package/build/comment-date/index.js +1 -1
- package/build/comment-edit-link/edit.js +7 -8
- package/build/comment-edit-link/edit.js.map +1 -1
- package/build/comment-edit-link/index.js +1 -1
- package/build/comment-reply-link/edit.js +6 -7
- package/build/comment-reply-link/edit.js.map +1 -1
- package/build/comment-reply-link/index.js +1 -1
- package/build/comment-template/edit.js +58 -72
- package/build/comment-template/edit.js.map +1 -1
- package/build/comment-template/hooks.js +14 -17
- package/build/comment-template/hooks.js.map +1 -1
- package/build/comment-template/index.js +1 -1
- package/build/comment-template/util.js +1 -3
- package/build/comment-template/util.js.map +1 -1
- package/build/comments/deprecated.js +8 -10
- package/build/comments/deprecated.js.map +1 -1
- package/build/comments/edit/comments-inspector-controls.js +6 -7
- package/build/comments/edit/comments-inspector-controls.js.map +1 -1
- package/build/comments/edit/comments-legacy.js +8 -9
- package/build/comments/edit/comments-legacy.js.map +1 -1
- package/build/comments/edit/placeholder.js +4 -5
- package/build/comments/edit/placeholder.js.map +1 -1
- package/build/comments/index.js +1 -1
- package/build/comments/save.js +6 -8
- package/build/comments/save.js.map +1 -1
- package/build/comments-pagination/comments-pagination-arrow-controls.js +4 -5
- package/build/comments-pagination/comments-pagination-arrow-controls.js.map +1 -1
- package/build/comments-pagination/edit.js +9 -10
- package/build/comments-pagination/edit.js.map +1 -1
- package/build/comments-pagination/index.js +1 -1
- package/build/comments-pagination-next/edit.js +9 -10
- package/build/comments-pagination-next/edit.js.map +1 -1
- package/build/comments-pagination-next/index.js +1 -1
- package/build/comments-pagination-numbers/edit.js +11 -14
- package/build/comments-pagination-numbers/edit.js.map +1 -1
- package/build/comments-pagination-numbers/index.js +1 -1
- package/build/comments-pagination-previous/edit.js +9 -10
- package/build/comments-pagination-previous/edit.js.map +1 -1
- package/build/comments-pagination-previous/index.js +1 -1
- package/build/comments-title/deprecated.js +5 -8
- package/build/comments-title/deprecated.js.map +1 -1
- package/build/comments-title/edit.js +13 -14
- package/build/comments-title/edit.js.map +1 -1
- package/build/comments-title/index.js +1 -1
- package/build/cover/controls.native.js +92 -101
- package/build/cover/controls.native.js.map +1 -1
- package/build/cover/deprecated.js +33 -44
- package/build/cover/deprecated.js.map +1 -1
- package/build/cover/edit/block-controls.js +7 -8
- package/build/cover/edit/block-controls.js.map +1 -1
- package/build/cover/edit/cover-placeholder.js +8 -9
- package/build/cover/edit/cover-placeholder.js.map +1 -1
- package/build/cover/edit/index.js +16 -19
- package/build/cover/edit/index.js.map +1 -1
- package/build/cover/edit/inspector-controls.js +14 -16
- package/build/cover/edit/inspector-controls.js.map +1 -1
- package/build/cover/edit/resizable-cover-popover.js +15 -16
- package/build/cover/edit/resizable-cover-popover.js.map +1 -1
- package/build/cover/edit/use-cover-is-dark.js +1 -3
- package/build/cover/edit/use-cover-is-dark.js.map +1 -1
- package/build/cover/edit.native.js +122 -145
- package/build/cover/edit.native.js.map +1 -1
- package/build/cover/focal-point-settings-button.native.js +6 -7
- package/build/cover/focal-point-settings-button.native.js.map +1 -1
- package/build/cover/index.js +1 -1
- package/build/cover/overlay-color-settings.native.js +8 -9
- package/build/cover/overlay-color-settings.native.js.map +1 -1
- package/build/cover/save.js +3 -4
- package/build/cover/save.js.map +1 -1
- package/build/cover/shared.js +5 -6
- package/build/cover/shared.js.map +1 -1
- package/build/cover/transforms.js +115 -145
- package/build/cover/transforms.js.map +1 -1
- package/build/cover/use-cover-is-dark.native.js +1 -5
- package/build/cover/use-cover-is-dark.native.js.map +1 -1
- package/build/details/edit.js +5 -6
- package/build/details/edit.js.map +1 -1
- package/build/details/index.js +1 -2
- package/build/details/index.js.map +1 -1
- package/build/details/save.js +3 -4
- package/build/details/save.js.map +1 -1
- package/build/embed/deprecated.js +12 -15
- package/build/embed/deprecated.js.map +1 -1
- package/build/embed/edit.js +4 -6
- package/build/embed/edit.js.map +1 -1
- package/build/embed/edit.native.js +4 -4
- package/build/embed/edit.native.js.map +1 -1
- package/build/embed/embed-controls.js +22 -25
- package/build/embed/embed-controls.js.map +1 -1
- package/build/embed/embed-controls.native.js +9 -10
- package/build/embed/embed-controls.native.js.map +1 -1
- package/build/embed/embed-link-settings.native.js +9 -10
- package/build/embed/embed-link-settings.native.js.map +1 -1
- package/build/embed/embed-no-preview.native.js +8 -9
- package/build/embed/embed-no-preview.native.js.map +1 -1
- package/build/embed/embed-placeholder.js +10 -11
- package/build/embed/embed-placeholder.js.map +1 -1
- package/build/embed/embed-placeholder.native.js +11 -14
- package/build/embed/embed-placeholder.native.js.map +1 -1
- package/build/embed/embed-preview.native.js +16 -17
- package/build/embed/embed-preview.native.js.map +1 -1
- package/build/embed/index.js +1 -1
- package/build/embed/save.js +3 -4
- package/build/embed/save.js.map +1 -1
- package/build/embed/transforms.js +10 -18
- package/build/embed/transforms.js.map +1 -1
- package/build/embed/util.js +20 -51
- package/build/embed/util.js.map +1 -1
- package/build/embed/wp-embed-preview.js +14 -18
- package/build/embed/wp-embed-preview.js.map +1 -1
- package/build/embed/wp-embed-preview.native.js +4 -5
- package/build/embed/wp-embed-preview.native.js.map +1 -1
- package/build/file/deprecated.js +9 -12
- package/build/file/deprecated.js.map +1 -1
- package/build/file/edit.js +11 -16
- package/build/file/edit.js.map +1 -1
- package/build/file/edit.native.js +20 -25
- package/build/file/edit.native.js.map +1 -1
- package/build/file/index.js +2 -2
- package/build/file/inspector.js +12 -13
- package/build/file/inspector.js.map +1 -1
- package/build/file/interactivity.js +19 -0
- package/build/file/interactivity.js.map +1 -0
- package/build/file/save.js +3 -4
- package/build/file/save.js.map +1 -1
- package/build/file/transforms.js +9 -15
- package/build/file/transforms.js.map +1 -1
- package/build/file/{utils.js → utils/index.js} +1 -1
- package/build/file/utils/index.js.map +1 -0
- package/build/freeform/convert-to-blocks-button.js +3 -4
- package/build/freeform/convert-to-blocks-button.js.map +1 -1
- package/build/freeform/edit.js +10 -13
- package/build/freeform/edit.js.map +1 -1
- package/build/freeform/index.js +2 -2
- package/build/freeform/modal.js +23 -21
- package/build/freeform/modal.js.map +1 -1
- package/build/freeform/save.js +3 -4
- package/build/freeform/save.js.map +1 -1
- package/build/gallery/deprecated.js +40 -54
- package/build/gallery/deprecated.js.map +1 -1
- package/build/gallery/edit.js +25 -53
- package/build/gallery/edit.js.map +1 -1
- package/build/gallery/gap-styles.js +6 -7
- package/build/gallery/gap-styles.js.map +1 -1
- package/build/gallery/index.js +1 -1
- package/build/gallery/save.js +3 -5
- package/build/gallery/save.js.map +1 -1
- package/build/gallery/shared-icon.native.js +3 -4
- package/build/gallery/shared-icon.native.js.map +1 -1
- package/build/gallery/shared.js +4 -10
- package/build/gallery/shared.js.map +1 -1
- package/build/gallery/transforms.js +103 -142
- package/build/gallery/transforms.js.map +1 -1
- package/build/gallery/use-get-media.native.js +8 -15
- package/build/gallery/use-get-media.native.js.map +1 -1
- package/build/gallery/use-get-new-images.js +2 -2
- package/build/gallery/use-get-new-images.js.map +1 -1
- package/build/gallery/use-image-sizes.js +11 -19
- package/build/gallery/use-image-sizes.js.map +1 -1
- package/build/gallery/utils.js +2 -2
- package/build/gallery/utils.js.map +1 -1
- package/build/gallery/v1/edit.js +31 -67
- package/build/gallery/v1/edit.js.map +1 -1
- package/build/gallery/v1/gallery-image.native.js +1 -3
- package/build/gallery/v1/gallery-image.native.js.map +1 -1
- package/build/gallery/v1/gallery.js +4 -5
- package/build/gallery/v1/gallery.js.map +1 -1
- package/build/gallery/v1/save.js +4 -5
- package/build/gallery/v1/save.js.map +1 -1
- package/build/gallery/v1/shared.js +4 -10
- package/build/gallery/v1/shared.js.map +1 -1
- package/build/group/deprecated.js +20 -28
- package/build/group/deprecated.js.map +1 -1
- package/build/group/edit.js +14 -18
- package/build/group/edit.js.map +1 -1
- package/build/group/edit.native.js +14 -18
- package/build/group/edit.native.js.map +1 -1
- package/build/group/index.js +1 -1
- package/build/group/placeholder.js +16 -19
- package/build/group/placeholder.js.map +1 -1
- package/build/group/save.js +5 -6
- package/build/group/save.js.map +1 -1
- package/build/group/transforms.js +0 -5
- package/build/group/transforms.js.map +1 -1
- package/build/group/variations.js +8 -23
- package/build/group/variations.js.map +1 -1
- package/build/heading/deprecated.js +18 -26
- package/build/heading/deprecated.js.map +1 -1
- package/build/heading/edit.js +8 -9
- package/build/heading/edit.js.map +1 -1
- package/build/heading/heading-level-dropdown.js +4 -5
- package/build/heading/heading-level-dropdown.js.map +1 -1
- package/build/heading/heading-level-dropdown.native.js +4 -6
- package/build/heading/heading-level-dropdown.native.js.map +1 -1
- package/build/heading/heading-level-icon.js +4 -5
- package/build/heading/heading-level-icon.js.map +1 -1
- package/build/heading/index.js +4 -5
- package/build/heading/index.js.map +1 -1
- package/build/heading/save.js +3 -4
- package/build/heading/save.js.map +1 -1
- package/build/heading/transforms.js +21 -28
- package/build/heading/transforms.js.map +1 -1
- package/build/home-link/edit.js +10 -15
- package/build/home-link/edit.js.map +1 -1
- package/build/home-link/index.js +1 -1
- package/build/html/edit.js +5 -6
- package/build/html/edit.js.map +1 -1
- package/build/html/index.js +1 -1
- package/build/html/preview.js +5 -8
- package/build/html/preview.js.map +1 -1
- package/build/html/save.js +3 -4
- package/build/html/save.js.map +1 -1
- package/build/html/transforms.js +3 -4
- package/build/html/transforms.js.map +1 -1
- package/build/image/deprecated.js +17 -24
- package/build/image/deprecated.js.map +1 -1
- package/build/image/edit.js +29 -36
- package/build/image/edit.js.map +1 -1
- package/build/image/edit.native.js +40 -55
- package/build/image/edit.native.js.map +1 -1
- package/build/image/image.js +38 -61
- package/build/image/image.js.map +1 -1
- package/build/image/index.js +7 -6
- package/build/image/index.js.map +1 -1
- package/build/image/interactivity.js +99 -0
- package/build/image/interactivity.js.map +1 -0
- package/build/image/save.js +5 -8
- package/build/image/save.js.map +1 -1
- package/build/image/transforms.js +36 -46
- package/build/image/transforms.js.map +1 -1
- package/build/image/use-client-width.js +1 -3
- package/build/image/use-client-width.js.map +1 -1
- package/build/image/utils.js +14 -25
- package/build/image/utils.js.map +1 -1
- package/build/index.js +20 -44
- package/build/index.js.map +1 -1
- package/build/index.native.js +3 -6
- package/build/index.native.js.map +1 -1
- package/build/latest-comments/edit.js +5 -6
- package/build/latest-comments/edit.js.map +1 -1
- package/build/latest-comments/index.js +1 -1
- package/build/latest-posts/deprecated.js +4 -7
- package/build/latest-posts/deprecated.js.map +1 -1
- package/build/latest-posts/edit.js +24 -34
- package/build/latest-posts/edit.js.map +1 -1
- package/build/latest-posts/edit.native.js +5 -8
- package/build/latest-posts/edit.native.js.map +1 -1
- package/build/latest-posts/index.js +1 -1
- package/build/list/deprecated.js +10 -15
- package/build/list/deprecated.js.map +1 -1
- package/build/list/edit.js +10 -12
- package/build/list/edit.js.map +1 -1
- package/build/list/index.js +1 -1
- package/build/list/ordered-list-settings.js +31 -34
- package/build/list/ordered-list-settings.js.map +1 -1
- package/build/list/save.js +3 -4
- package/build/list/save.js.map +1 -1
- package/build/list/transforms.js +11 -15
- package/build/list/transforms.js.map +1 -1
- package/build/list/utils.js +1 -1
- package/build/list/utils.js.map +1 -1
- package/build/list-item/edit.js +11 -17
- package/build/list-item/edit.js.map +1 -1
- package/build/list-item/edit.native.js +16 -24
- package/build/list-item/edit.native.js.map +1 -1
- package/build/list-item/hooks/use-enter.js +1 -3
- package/build/list-item/hooks/use-enter.js.map +1 -1
- package/build/list-item/hooks/use-enter.native.js +1 -3
- package/build/list-item/hooks/use-enter.native.js.map +1 -1
- package/build/list-item/hooks/use-indent-list-item.js +1 -3
- package/build/list-item/hooks/use-indent-list-item.js.map +1 -1
- package/build/list-item/hooks/use-merge.js +1 -1
- package/build/list-item/hooks/use-outdent-list-item.js +2 -4
- package/build/list-item/hooks/use-outdent-list-item.js.map +1 -1
- package/build/list-item/index.js +1 -1
- package/build/list-item/list-style-type.native.js +29 -34
- package/build/list-item/list-style-type.native.js.map +1 -1
- package/build/list-item/save.js +3 -4
- package/build/list-item/save.js.map +1 -1
- package/build/list-item/transforms.js +1 -1
- package/build/list-item/transforms.js.map +1 -1
- package/build/list-item/utils.js +4 -4
- package/build/list-item/utils.js.map +1 -1
- package/build/loginout/edit.js +4 -5
- package/build/loginout/edit.js.map +1 -1
- package/build/loginout/index.js +1 -1
- package/build/media-text/deprecated.js +26 -37
- package/build/media-text/deprecated.js.map +1 -1
- package/build/media-text/edit.js +37 -49
- package/build/media-text/edit.js.map +1 -1
- package/build/media-text/edit.native.js +9 -13
- package/build/media-text/edit.native.js.map +1 -1
- package/build/media-text/index.js +1 -1
- package/build/media-text/media-container.js +18 -21
- package/build/media-text/media-container.js.map +1 -1
- package/build/media-text/media-container.native.js +4 -5
- package/build/media-text/media-container.native.js.map +1 -1
- package/build/media-text/save.js +4 -7
- package/build/media-text/save.js.map +1 -1
- package/build/media-text/transforms.js +73 -91
- package/build/media-text/transforms.js.map +1 -1
- package/build/missing/edit.js +9 -11
- package/build/missing/edit.js.map +1 -1
- package/build/missing/edit.native.js +7 -8
- package/build/missing/edit.native.js.map +1 -1
- package/build/missing/index.js +4 -6
- package/build/missing/index.js.map +1 -1
- package/build/missing/save.js +3 -4
- package/build/missing/save.js.map +1 -1
- package/build/more/edit.js +11 -15
- package/build/more/edit.js.map +1 -1
- package/build/more/edit.native.js +4 -10
- package/build/more/edit.native.js.map +1 -1
- package/build/more/index.js +4 -6
- package/build/more/index.js.map +1 -1
- package/build/more/save.js +6 -7
- package/build/more/save.js.map +1 -1
- package/build/navigation/constants.js +3 -1
- package/build/navigation/constants.js.map +1 -1
- package/build/navigation/deprecated.js +16 -27
- package/build/navigation/deprecated.js.map +1 -1
- package/build/navigation/edit/are-blocks-dirty.js +1 -1
- package/build/navigation/edit/are-blocks-dirty.js.map +1 -1
- package/build/navigation/edit/deleted-navigation-warning.js +3 -4
- package/build/navigation/edit/deleted-navigation-warning.js.map +1 -1
- package/build/navigation/edit/index.js +33 -40
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/inner-blocks.js +11 -14
- package/build/navigation/edit/inner-blocks.js.map +1 -1
- package/build/navigation/edit/leaf-more-menu.js +144 -0
- package/build/navigation/edit/leaf-more-menu.js.map +1 -0
- package/build/navigation/edit/manage-menus-button.js +5 -6
- package/build/navigation/edit/manage-menus-button.js.map +1 -1
- package/build/navigation/edit/menu-inspector-controls.js +65 -16
- package/build/navigation/edit/menu-inspector-controls.js.map +1 -1
- package/build/navigation/edit/navigation-menu-delete-control.js +9 -10
- package/build/navigation/edit/navigation-menu-delete-control.js.map +1 -1
- package/build/navigation/edit/navigation-menu-selector.js +50 -56
- package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build/navigation/edit/overlay-menu-icon.js +3 -5
- package/build/navigation/edit/overlay-menu-icon.js.map +1 -1
- package/build/navigation/edit/overlay-menu-preview.js +5 -6
- package/build/navigation/edit/overlay-menu-preview.js.map +1 -1
- package/build/navigation/edit/placeholder/index.js +10 -11
- package/build/navigation/edit/placeholder/index.js.map +1 -1
- package/build/navigation/edit/placeholder/placeholder-preview.js +3 -4
- package/build/navigation/edit/placeholder/placeholder-preview.js.map +1 -1
- package/build/navigation/edit/responsive-wrapper.js +18 -20
- package/build/navigation/edit/responsive-wrapper.js.map +1 -1
- package/build/navigation/edit/unsaved-inner-blocks.js +19 -34
- package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js +2 -3
- package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
- package/build/navigation/edit/use-create-navigation-menu.js +3 -7
- package/build/navigation/edit/use-create-navigation-menu.js.map +1 -1
- package/build/navigation/edit/use-generate-default-navigation-title.js +1 -5
- package/build/navigation/edit/use-generate-default-navigation-title.js.map +1 -1
- package/build/navigation/edit/use-inner-blocks.js +1 -1
- package/build/navigation/edit/use-inner-blocks.js.map +1 -1
- package/build/navigation/edit/use-navigation-notice.js +4 -5
- package/build/navigation/edit/use-navigation-notice.js.map +1 -1
- package/build/navigation/edit/utils.js +2 -4
- package/build/navigation/edit/utils.js.map +1 -1
- package/build/navigation/index.js +2 -2
- package/build/navigation/interactivity.js +98 -70
- package/build/navigation/interactivity.js.map +1 -1
- package/build/navigation/menu-items-to-blocks.js +25 -34
- package/build/navigation/menu-items-to-blocks.js.map +1 -1
- package/build/navigation/save.js +3 -5
- package/build/navigation/save.js.map +1 -1
- package/build/navigation/use-navigation-entities.js +2 -2
- package/build/navigation/use-navigation-entities.js.map +1 -1
- package/build/navigation/use-navigation-menu.js +1 -1
- package/build/navigation/use-navigation-menu.js.map +1 -1
- package/build/navigation/use-template-part-area-label.js +3 -5
- package/build/navigation/use-template-part-area-label.js.map +1 -1
- package/build/navigation-link/edit.js +20 -25
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-link/hooks.js +1 -1
- package/build/navigation-link/hooks.js.map +1 -1
- package/build/navigation-link/index.js +11 -16
- package/build/navigation-link/index.js.map +1 -1
- package/build/navigation-link/link-ui.js +9 -8
- package/build/navigation-link/link-ui.js.map +1 -1
- package/build/navigation-link/update-attributes.js +6 -9
- package/build/navigation-link/update-attributes.js.map +1 -1
- package/build/navigation-submenu/edit.js +19 -20
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/navigation-submenu/index.js +7 -12
- package/build/navigation-submenu/index.js.map +1 -1
- package/build/navigation-submenu/transforms.js +6 -30
- package/build/navigation-submenu/transforms.js.map +1 -1
- package/build/nextpage/edit.native.js +9 -10
- package/build/nextpage/edit.native.js.map +1 -1
- package/build/nextpage/index.js +1 -1
- package/build/page-list/convert-to-links-modal.js +5 -6
- package/build/page-list/convert-to-links-modal.js.map +1 -1
- package/build/page-list/edit.js +23 -35
- package/build/page-list/edit.js.map +1 -1
- package/build/page-list/index.js +1 -1
- package/build/page-list/use-convert-to-navigation-links.js +16 -21
- package/build/page-list/use-convert-to-navigation-links.js.map +1 -1
- package/build/page-list-item/edit.js +5 -6
- package/build/page-list-item/edit.js.map +1 -1
- package/build/page-list-item/index.js +4 -7
- package/build/page-list-item/index.js.map +1 -1
- package/build/paragraph/deprecated.js +18 -24
- package/build/paragraph/deprecated.js.map +1 -1
- package/build/paragraph/edit.js +12 -14
- package/build/paragraph/edit.js.map +1 -1
- package/build/paragraph/edit.native.js +13 -16
- package/build/paragraph/edit.native.js.map +1 -1
- package/build/paragraph/index.js +4 -6
- package/build/paragraph/index.js.map +1 -1
- package/build/paragraph/save.js +3 -4
- package/build/paragraph/save.js.map +1 -1
- package/build/paragraph/transforms.js +10 -13
- package/build/paragraph/transforms.js.map +1 -1
- package/build/pattern/edit.js +44 -13
- package/build/pattern/edit.js.map +1 -1
- package/build/pattern/index.js +11 -3
- package/build/pattern/index.js.map +1 -1
- package/build/pattern/v1/edit.js +56 -0
- package/build/pattern/v1/edit.js.map +1 -0
- package/build/post-author/edit.js +19 -23
- package/build/post-author/edit.js.map +1 -1
- package/build/post-author/index.js +1 -1
- package/build/post-author-biography/edit.js +12 -15
- package/build/post-author-biography/edit.js.map +1 -1
- package/build/post-author-biography/index.js +1 -1
- package/build/post-author-name/edit.js +14 -17
- package/build/post-author-name/edit.js.map +1 -1
- package/build/post-author-name/index.js +1 -1
- package/build/post-author-name/transforms.js +10 -16
- package/build/post-author-name/transforms.js.map +1 -1
- package/build/post-comment/edit.js +6 -7
- package/build/post-comment/edit.js.map +1 -1
- package/build/post-comment/index.js +1 -1
- package/build/post-comments-count/edit.js +6 -9
- package/build/post-comments-count/edit.js.map +1 -1
- package/build/post-comments-count/index.js +1 -1
- package/build/post-comments-form/edit.js +5 -6
- package/build/post-comments-form/edit.js.map +1 -1
- package/build/post-comments-form/form.js +5 -10
- package/build/post-comments-form/form.js.map +1 -1
- package/build/post-comments-form/index.js +1 -1
- package/build/post-comments-link/edit.js +5 -6
- package/build/post-comments-link/edit.js.map +1 -1
- package/build/post-comments-link/index.js +1 -1
- package/build/post-content/edit.js +27 -23
- package/build/post-content/edit.js.map +1 -1
- package/build/post-content/index.js +1 -1
- package/build/post-date/deprecated.js +4 -7
- package/build/post-date/deprecated.js.map +1 -1
- package/build/post-date/edit.js +27 -33
- package/build/post-date/edit.js.map +1 -1
- package/build/post-date/index.js +1 -1
- package/build/post-excerpt/edit.js +21 -24
- package/build/post-excerpt/edit.js.map +1 -1
- package/build/post-excerpt/index.js +3 -3
- package/build/post-featured-image/dimension-controls.js +12 -13
- package/build/post-featured-image/dimension-controls.js.map +1 -1
- package/build/post-featured-image/edit.js +27 -37
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/post-featured-image/index.js +1 -1
- package/build/post-featured-image/overlay.js +7 -8
- package/build/post-featured-image/overlay.js.map +1 -1
- package/build/post-navigation-link/edit.js +11 -12
- package/build/post-navigation-link/edit.js.map +1 -1
- package/build/post-navigation-link/index.js +1 -1
- package/build/post-template/edit.js +97 -83
- package/build/post-template/edit.js.map +1 -1
- package/build/post-template/index.js +10 -4
- package/build/post-template/index.js.map +1 -1
- package/build/post-terms/edit.js +10 -15
- package/build/post-terms/edit.js.map +1 -1
- package/build/post-terms/index.js +1 -1
- package/build/post-terms/use-post-terms.js +7 -12
- package/build/post-terms/use-post-terms.js.map +1 -1
- package/build/post-time-to-read/edit.js +5 -6
- package/build/post-time-to-read/edit.js.map +1 -1
- package/build/post-time-to-read/index.js +1 -1
- package/build/post-title/deprecated.js +4 -7
- package/build/post-title/deprecated.js.map +1 -1
- package/build/post-title/edit.js +37 -24
- package/build/post-title/edit.js.map +1 -1
- package/build/post-title/index.js +2 -2
- package/build/preformatted/edit.js +7 -8
- package/build/preformatted/edit.js.map +1 -1
- package/build/preformatted/edit.native.js +5 -7
- package/build/preformatted/edit.native.js.map +1 -1
- package/build/preformatted/index.js +1 -1
- package/build/preformatted/save.js +3 -4
- package/build/preformatted/save.js.map +1 -1
- package/build/preformatted/transforms.js +14 -20
- package/build/preformatted/transforms.js.map +1 -1
- package/build/pullquote/deprecated.js +61 -73
- package/build/pullquote/deprecated.js.map +1 -1
- package/build/pullquote/edit.js +6 -7
- package/build/pullquote/edit.js.map +1 -1
- package/build/pullquote/edit.native.js +13 -21
- package/build/pullquote/edit.native.js.map +1 -1
- package/build/pullquote/figure.native.js +5 -6
- package/build/pullquote/figure.native.js.map +1 -1
- package/build/pullquote/index.js +1 -1
- package/build/pullquote/save.js +3 -4
- package/build/pullquote/save.js.map +1 -1
- package/build/pullquote/transforms.js +17 -24
- package/build/pullquote/transforms.js.map +1 -1
- package/build/query/deprecated.js +197 -79
- package/build/query/deprecated.js.map +1 -1
- package/build/query/edit/inspector-controls/author-control.js +5 -8
- package/build/query/edit/inspector-controls/author-control.js.map +1 -1
- package/build/query/edit/inspector-controls/create-new-post-link.js +6 -7
- package/build/query/edit/inspector-controls/create-new-post-link.js.map +1 -1
- package/build/query/edit/inspector-controls/index.js +4 -6
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/edit/inspector-controls/order-control.js +5 -6
- package/build/query/edit/inspector-controls/order-control.js.map +1 -1
- package/build/query/edit/inspector-controls/parent-control.js +10 -13
- package/build/query/edit/inspector-controls/parent-control.js.map +1 -1
- package/build/query/edit/inspector-controls/sticky-control.js +4 -5
- package/build/query/edit/inspector-controls/sticky-control.js.map +1 -1
- package/build/query/edit/inspector-controls/taxonomy-controls.js +15 -19
- package/build/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
- package/build/query/edit/pattern-selection-modal.js +5 -6
- package/build/query/edit/pattern-selection-modal.js.map +1 -1
- package/build/query/edit/query-content.js +7 -9
- package/build/query/edit/query-content.js.map +1 -1
- package/build/query/edit/query-placeholder.js +16 -20
- package/build/query/edit/query-placeholder.js.map +1 -1
- package/build/query/edit/query-toolbar.js +17 -41
- package/build/query/edit/query-toolbar.js.map +1 -1
- package/build/query/index.js +1 -7
- package/build/query/index.js.map +1 -1
- package/build/query/save.js +5 -7
- package/build/query/save.js.map +1 -1
- package/build/query/utils.js +24 -60
- package/build/query/utils.js.map +1 -1
- package/build/query-no-results/index.js +1 -1
- package/build/query-pagination/edit.js +28 -11
- package/build/query-pagination/edit.js.map +1 -1
- package/build/query-pagination/index.js +7 -2
- package/build/query-pagination/index.js.map +1 -1
- package/build/query-pagination/query-pagination-arrow-controls.js +4 -5
- package/build/query-pagination/query-pagination-arrow-controls.js.map +1 -1
- package/build/query-pagination/query-pagination-label-control.js +29 -0
- package/build/query-pagination/query-pagination-label-control.js.map +1 -0
- package/build/query-pagination-next/edit.js +11 -11
- package/build/query-pagination-next/edit.js.map +1 -1
- package/build/query-pagination-next/index.js +2 -2
- package/build/query-pagination-numbers/edit.js +3 -7
- package/build/query-pagination-numbers/edit.js.map +1 -1
- package/build/query-pagination-numbers/index.js +1 -1
- package/build/query-pagination-previous/edit.js +11 -11
- package/build/query-pagination-previous/edit.js.map +1 -1
- package/build/query-pagination-previous/index.js +2 -2
- package/build/query-title/deprecated.js +4 -7
- package/build/query-title/deprecated.js.map +1 -1
- package/build/query-title/edit.js +10 -11
- package/build/query-title/edit.js.map +1 -1
- package/build/query-title/index.js +1 -1
- package/build/quote/deprecated.js +17 -24
- package/build/quote/deprecated.js.map +1 -1
- package/build/quote/edit.js +8 -9
- package/build/quote/edit.js.map +1 -1
- package/build/quote/index.js +1 -1
- package/build/quote/save.js +3 -4
- package/build/quote/save.js.map +1 -1
- package/build/quote/transforms.js +38 -61
- package/build/quote/transforms.js.map +1 -1
- package/build/read-more/edit.js +8 -9
- package/build/read-more/edit.js.map +1 -1
- package/build/read-more/index.js +1 -1
- package/build/rss/edit.js +4 -5
- package/build/rss/edit.js.map +1 -1
- package/build/rss/index.js +1 -1
- package/build/search/edit.js +74 -32
- package/build/search/edit.js.map +1 -1
- package/build/search/edit.native.js +39 -35
- package/build/search/edit.native.js.map +1 -1
- package/build/search/index.js +9 -1
- package/build/search/index.js.map +1 -1
- package/build/search/view.js +67 -0
- package/build/search/view.js.map +1 -0
- package/build/separator/deprecated.js +3 -4
- package/build/separator/deprecated.js.map +1 -1
- package/build/separator/edit.js +6 -9
- package/build/separator/edit.js.map +1 -1
- package/build/separator/index.js +1 -1
- package/build/separator/save.js +5 -8
- package/build/separator/save.js.map +1 -1
- package/build/shortcode/edit.js +4 -5
- package/build/shortcode/edit.js.map +1 -1
- package/build/shortcode/index.js +2 -2
- package/build/shortcode/save.js +3 -4
- package/build/shortcode/save.js.map +1 -1
- package/build/shortcode/transforms.js +3 -4
- package/build/shortcode/transforms.js.map +1 -1
- package/build/site-logo/edit.js +58 -74
- package/build/site-logo/edit.js.map +1 -1
- package/build/site-logo/index.js +1 -1
- package/build/site-logo/transforms.js +4 -5
- package/build/site-logo/transforms.js.map +1 -1
- package/build/site-tagline/deprecated.js +4 -7
- package/build/site-tagline/deprecated.js.map +1 -1
- package/build/site-tagline/edit.js +6 -7
- package/build/site-tagline/edit.js.map +1 -1
- package/build/site-tagline/index.js +1 -1
- package/build/site-title/deprecated.js +4 -7
- package/build/site-title/deprecated.js.map +1 -1
- package/build/site-title/edit/index.js +6 -7
- package/build/site-title/edit/index.js.map +1 -1
- package/build/site-title/edit/level-icon.js +4 -5
- package/build/site-title/edit/level-icon.js.map +1 -1
- package/build/site-title/edit/level-toolbar.js +4 -5
- package/build/site-title/edit/level-toolbar.js.map +1 -1
- package/build/site-title/index.js +1 -1
- package/build/site-title/transforms.js +4 -5
- package/build/site-title/transforms.js.map +1 -1
- package/build/social-link/edit.js +36 -17
- package/build/social-link/edit.js.map +1 -1
- package/build/social-link/edit.native.js +11 -13
- package/build/social-link/edit.native.js.map +1 -1
- package/build/social-link/index.js +2 -2
- package/build/social-links/deprecated.js +2 -4
- package/build/social-links/deprecated.js.map +1 -1
- package/build/social-links/edit.js +36 -42
- package/build/social-links/edit.js.map +1 -1
- package/build/social-links/edit.native.js +18 -25
- package/build/social-links/edit.native.js.map +1 -1
- package/build/social-links/index.js +3 -1
- package/build/social-links/index.js.map +1 -1
- package/build/spacer/controls.js +18 -21
- package/build/spacer/controls.js.map +1 -1
- package/build/spacer/controls.native.js +7 -8
- package/build/spacer/controls.native.js.map +1 -1
- package/build/spacer/deprecated.js +3 -4
- package/build/spacer/deprecated.js.map +1 -1
- package/build/spacer/edit.js +20 -23
- package/build/spacer/edit.js.map +1 -1
- package/build/spacer/edit.native.js +7 -8
- package/build/spacer/edit.native.js.map +1 -1
- package/build/spacer/index.js +1 -1
- package/build/spacer/save.js +6 -7
- package/build/spacer/save.js.map +1 -1
- package/build/spacer/save.native.js +6 -7
- package/build/spacer/save.native.js.map +1 -1
- package/build/table/deprecated.js +79 -102
- package/build/table/deprecated.js.map +1 -1
- package/build/table/edit.js +45 -59
- package/build/table/edit.js.map +1 -1
- package/build/table/index.js +1 -1
- package/build/table/save.js +33 -40
- package/build/table/save.js.map +1 -1
- package/build/table/state.js +32 -59
- package/build/table/state.js.map +1 -1
- package/build/table/transforms.js +17 -20
- package/build/table/transforms.js.map +1 -1
- package/build/table-of-contents/edit.js +9 -10
- package/build/table-of-contents/edit.js.map +1 -1
- package/build/table-of-contents/index.js +1 -1
- package/build/table-of-contents/list.js +3 -4
- package/build/table-of-contents/list.js.map +1 -1
- package/build/table-of-contents/save.js +5 -7
- package/build/table-of-contents/save.js.map +1 -1
- package/build/table-of-contents/utils.js +1 -3
- package/build/table-of-contents/utils.js.map +1 -1
- package/build/tag-cloud/edit.js +6 -8
- package/build/tag-cloud/edit.js.map +1 -1
- package/build/tag-cloud/index.js +1 -1
- package/build/template-part/edit/advanced-controls.js +15 -19
- package/build/template-part/edit/advanced-controls.js.map +1 -1
- package/build/template-part/edit/import-controls.js +7 -11
- package/build/template-part/edit/import-controls.js.map +1 -1
- package/build/template-part/edit/index.js +8 -15
- package/build/template-part/edit/index.js.map +1 -1
- package/build/template-part/edit/inner-blocks.js +8 -11
- package/build/template-part/edit/inner-blocks.js.map +1 -1
- package/build/template-part/edit/placeholder.js +7 -8
- package/build/template-part/edit/placeholder.js.map +1 -1
- package/build/template-part/edit/selection-modal.js +8 -11
- package/build/template-part/edit/selection-modal.js.map +1 -1
- package/build/template-part/edit/title-modal.js +5 -6
- package/build/template-part/edit/title-modal.js.map +1 -1
- package/build/template-part/edit/utils/hooks.js +6 -8
- package/build/template-part/edit/utils/hooks.js.map +1 -1
- package/build/template-part/edit/utils/transformers.js +3 -6
- package/build/template-part/edit/utils/transformers.js.map +1 -1
- package/build/template-part/index.js +11 -19
- package/build/template-part/index.js.map +1 -1
- package/build/template-part/variations.js +2 -2
- package/build/template-part/variations.js.map +1 -1
- package/build/term-description/edit.js +5 -6
- package/build/term-description/edit.js.map +1 -1
- package/build/term-description/index.js +1 -1
- package/build/text-columns/edit.js +5 -8
- package/build/text-columns/edit.js.map +1 -1
- package/build/text-columns/index.js +1 -1
- package/build/text-columns/save.js +10 -15
- package/build/text-columns/save.js.map +1 -1
- package/build/text-columns/transforms.js +14 -20
- package/build/text-columns/transforms.js.map +1 -1
- package/build/utils/init-block.native.js +1 -3
- package/build/utils/init-block.native.js.map +1 -1
- package/build/utils/interactivity/constants.js +1 -1
- package/build/utils/interactivity/constants.js.map +1 -1
- package/build/utils/interactivity/directives.js +102 -85
- package/build/utils/interactivity/directives.js.map +1 -1
- package/build/utils/interactivity/hooks.js +80 -33
- package/build/utils/interactivity/hooks.js.map +1 -1
- package/build/utils/interactivity/hydration.js +1 -1
- package/build/utils/interactivity/hydration.js.map +1 -1
- package/build/utils/interactivity/portals.js +108 -0
- package/build/utils/interactivity/portals.js.map +1 -0
- package/build/utils/interactivity/store.js +4 -5
- package/build/utils/interactivity/store.js.map +1 -1
- package/build/utils/interactivity/vdom.js +14 -4
- package/build/utils/interactivity/vdom.js.map +1 -1
- package/build/utils/migrate-font-family.js +1 -3
- package/build/utils/migrate-font-family.js.map +1 -1
- package/build/utils/search-patterns.js +5 -19
- package/build/utils/search-patterns.js.map +1 -1
- package/build/utils/transformation-categories.native.js +1 -4
- package/build/utils/transformation-categories.native.js.map +1 -1
- package/build/verse/deprecated.js +10 -15
- package/build/verse/deprecated.js.map +1 -1
- package/build/verse/edit.js +7 -8
- package/build/verse/edit.js.map +1 -1
- package/build/verse/index.js +1 -1
- package/build/verse/save.js +3 -4
- package/build/verse/save.js.map +1 -1
- package/build/video/deprecated.js +4 -5
- package/build/video/deprecated.js.map +1 -1
- package/build/video/edit-common-settings.js +4 -5
- package/build/video/edit-common-settings.js.map +1 -1
- package/build/video/edit.js +18 -27
- package/build/video/edit.js.map +1 -1
- package/build/video/edit.native.js +18 -24
- package/build/video/edit.native.js.map +1 -1
- package/build/video/index.js +1 -1
- package/build/video/save.js +3 -4
- package/build/video/save.js.map +1 -1
- package/build/video/tracks-editor.js +39 -51
- package/build/video/tracks-editor.js.map +1 -1
- package/build/video/tracks.js +3 -4
- package/build/video/tracks.js.map +1 -1
- package/build/video/transforms.js +30 -35
- package/build/video/transforms.js.map +1 -1
- package/build-module/archives/edit.js +4 -5
- package/build-module/archives/edit.js.map +1 -1
- package/build-module/archives/index.js +1 -1
- package/build-module/audio/deprecated.js +3 -4
- package/build-module/audio/deprecated.js.map +1 -1
- package/build-module/audio/edit.js +9 -13
- package/build-module/audio/edit.js.map +1 -1
- package/build-module/audio/edit.native.js +22 -26
- package/build-module/audio/edit.native.js.map +1 -1
- package/build-module/audio/index.js +1 -1
- package/build-module/audio/save.js +3 -4
- package/build-module/audio/save.js.map +1 -1
- package/build-module/audio/transforms.js +25 -29
- package/build-module/audio/transforms.js.map +1 -1
- package/build-module/avatar/edit.js +61 -69
- package/build-module/avatar/edit.js.map +1 -1
- package/build-module/avatar/hooks.js +12 -16
- package/build-module/avatar/hooks.js.map +1 -1
- package/build-module/avatar/index.js +1 -1
- package/build-module/avatar/user-control.js +4 -5
- package/build-module/avatar/user-control.js.map +1 -1
- package/build-module/block/edit-title.native.js +4 -5
- package/build-module/block/edit-title.native.js.map +1 -1
- package/build-module/block/edit.js +7 -8
- package/build-module/block/edit.js.map +1 -1
- package/build-module/block/edit.native.js +14 -9
- package/build-module/block/edit.native.js.map +1 -1
- package/build-module/block/index.js +1 -1
- package/build-module/button/color-background.native.js +5 -6
- package/build-module/button/color-background.native.js.map +1 -1
- package/build-module/button/deprecated.js +55 -80
- package/build-module/button/deprecated.js.map +1 -1
- package/build-module/button/edit.js +12 -23
- package/build-module/button/edit.js.map +1 -1
- package/build-module/button/edit.native.js +26 -41
- package/build-module/button/edit.native.js.map +1 -1
- package/build-module/button/index.js +6 -9
- package/build-module/button/index.js.map +1 -1
- package/build-module/button/save.js +6 -9
- package/build-module/button/save.js.map +1 -1
- package/build-module/buttons/deprecated.js +13 -18
- package/build-module/buttons/deprecated.js.map +1 -1
- package/build-module/buttons/edit.js +6 -11
- package/build-module/buttons/edit.js.map +1 -1
- package/build-module/buttons/edit.native.js +13 -16
- package/build-module/buttons/edit.native.js.map +1 -1
- package/build-module/buttons/index.js +1 -1
- package/build-module/buttons/save.js +5 -8
- package/build-module/buttons/save.js.map +1 -1
- package/build-module/buttons/transforms.js +2 -2
- package/build-module/buttons/transforms.js.map +1 -1
- package/build-module/calendar/edit.js +4 -5
- package/build-module/calendar/edit.js.map +1 -1
- package/build-module/calendar/index.js +1 -1
- package/build-module/categories/edit.js +19 -23
- package/build-module/categories/edit.js.map +1 -1
- package/build-module/categories/index.js +1 -1
- package/build-module/code/edit.js +5 -6
- package/build-module/code/edit.js.map +1 -1
- package/build-module/code/edit.native.js +1 -1
- package/build-module/code/edit.native.js.map +1 -1
- package/build-module/code/index.js +2 -1
- package/build-module/code/index.js.map +1 -1
- package/build-module/code/save.js +3 -4
- package/build-module/code/save.js.map +1 -1
- package/build-module/code/transforms.js +6 -8
- package/build-module/code/transforms.js.map +1 -1
- package/build-module/column/column-preview.native.js +9 -11
- package/build-module/column/column-preview.native.js.map +1 -1
- package/build-module/column/deprecated.js +6 -8
- package/build-module/column/deprecated.js.map +1 -1
- package/build-module/column/edit.js +10 -11
- package/build-module/column/edit.js.map +1 -1
- package/build-module/column/edit.native.js +18 -23
- package/build-module/column/edit.native.js.map +1 -1
- package/build-module/column/index.js +2 -2
- package/build-module/column/save.js +4 -5
- package/build-module/column/save.js.map +1 -1
- package/build-module/columns/columnCalculations.native.js +6 -9
- package/build-module/columns/columnCalculations.native.js.map +1 -1
- package/build-module/columns/deprecated.js +9 -12
- package/build-module/columns/deprecated.js.map +1 -1
- package/build-module/columns/edit.js +15 -21
- package/build-module/columns/edit.js.map +1 -1
- package/build-module/columns/edit.native.js +12 -15
- package/build-module/columns/edit.native.js.map +1 -1
- package/build-module/columns/index.js +1 -1
- package/build-module/columns/save.js +3 -4
- package/build-module/columns/save.js.map +1 -1
- package/build-module/columns/transforms.js +12 -21
- package/build-module/columns/transforms.js.map +1 -1
- package/build-module/columns/utils.js +6 -13
- package/build-module/columns/utils.js.map +1 -1
- package/build-module/comment-author-avatar/edit.js +8 -9
- package/build-module/comment-author-avatar/edit.js.map +1 -1
- package/build-module/comment-author-avatar/index.js +1 -1
- package/build-module/comment-author-name/deprecated.js +4 -7
- package/build-module/comment-author-name/deprecated.js.map +1 -1
- package/build-module/comment-author-name/edit.js +13 -14
- package/build-module/comment-author-name/edit.js.map +1 -1
- package/build-module/comment-author-name/index.js +1 -1
- package/build-module/comment-content/edit.js +9 -10
- package/build-module/comment-content/edit.js.map +1 -1
- package/build-module/comment-content/index.js +1 -1
- package/build-module/comment-date/deprecated.js +4 -7
- package/build-module/comment-date/deprecated.js.map +1 -1
- package/build-module/comment-date/edit.js +10 -11
- package/build-module/comment-date/edit.js.map +1 -1
- package/build-module/comment-date/index.js +1 -1
- package/build-module/comment-edit-link/edit.js +7 -8
- package/build-module/comment-edit-link/edit.js.map +1 -1
- package/build-module/comment-edit-link/index.js +1 -1
- package/build-module/comment-reply-link/edit.js +6 -7
- package/build-module/comment-reply-link/edit.js.map +1 -1
- package/build-module/comment-reply-link/index.js +1 -1
- package/build-module/comment-template/edit.js +57 -71
- package/build-module/comment-template/edit.js.map +1 -1
- package/build-module/comment-template/hooks.js +14 -17
- package/build-module/comment-template/hooks.js.map +1 -1
- package/build-module/comment-template/index.js +1 -1
- package/build-module/comment-template/util.js +1 -3
- package/build-module/comment-template/util.js.map +1 -1
- package/build-module/comments/deprecated.js +8 -9
- package/build-module/comments/deprecated.js.map +1 -1
- package/build-module/comments/edit/comments-inspector-controls.js +6 -7
- package/build-module/comments/edit/comments-inspector-controls.js.map +1 -1
- package/build-module/comments/edit/comments-legacy.js +8 -9
- package/build-module/comments/edit/comments-legacy.js.map +1 -1
- package/build-module/comments/edit/placeholder.js +4 -5
- package/build-module/comments/edit/placeholder.js.map +1 -1
- package/build-module/comments/index.js +1 -1
- package/build-module/comments/save.js +6 -7
- package/build-module/comments/save.js.map +1 -1
- package/build-module/comments-pagination/comments-pagination-arrow-controls.js +4 -5
- package/build-module/comments-pagination/comments-pagination-arrow-controls.js.map +1 -1
- package/build-module/comments-pagination/edit.js +9 -10
- package/build-module/comments-pagination/edit.js.map +1 -1
- package/build-module/comments-pagination/index.js +1 -1
- package/build-module/comments-pagination-next/edit.js +9 -10
- package/build-module/comments-pagination-next/edit.js.map +1 -1
- package/build-module/comments-pagination-next/index.js +1 -1
- package/build-module/comments-pagination-numbers/edit.js +11 -14
- package/build-module/comments-pagination-numbers/edit.js.map +1 -1
- package/build-module/comments-pagination-numbers/index.js +1 -1
- package/build-module/comments-pagination-previous/edit.js +9 -10
- package/build-module/comments-pagination-previous/edit.js.map +1 -1
- package/build-module/comments-pagination-previous/index.js +1 -1
- package/build-module/comments-title/deprecated.js +5 -8
- package/build-module/comments-title/deprecated.js.map +1 -1
- package/build-module/comments-title/edit.js +13 -14
- package/build-module/comments-title/edit.js.map +1 -1
- package/build-module/comments-title/index.js +1 -1
- package/build-module/cover/controls.native.js +92 -101
- package/build-module/cover/controls.native.js.map +1 -1
- package/build-module/cover/deprecated.js +33 -44
- package/build-module/cover/deprecated.js.map +1 -1
- package/build-module/cover/edit/block-controls.js +7 -8
- package/build-module/cover/edit/block-controls.js.map +1 -1
- package/build-module/cover/edit/cover-placeholder.js +8 -9
- package/build-module/cover/edit/cover-placeholder.js.map +1 -1
- package/build-module/cover/edit/index.js +16 -19
- package/build-module/cover/edit/index.js.map +1 -1
- package/build-module/cover/edit/inspector-controls.js +14 -16
- package/build-module/cover/edit/inspector-controls.js.map +1 -1
- package/build-module/cover/edit/resizable-cover-popover.js +15 -16
- package/build-module/cover/edit/resizable-cover-popover.js.map +1 -1
- package/build-module/cover/edit/use-cover-is-dark.js +1 -3
- package/build-module/cover/edit/use-cover-is-dark.js.map +1 -1
- package/build-module/cover/edit.native.js +122 -145
- package/build-module/cover/edit.native.js.map +1 -1
- package/build-module/cover/focal-point-settings-button.native.js +6 -7
- package/build-module/cover/focal-point-settings-button.native.js.map +1 -1
- package/build-module/cover/index.js +1 -1
- package/build-module/cover/overlay-color-settings.native.js +8 -9
- package/build-module/cover/overlay-color-settings.native.js.map +1 -1
- package/build-module/cover/save.js +3 -4
- package/build-module/cover/save.js.map +1 -1
- package/build-module/cover/shared.js +5 -6
- package/build-module/cover/shared.js.map +1 -1
- package/build-module/cover/transforms.js +115 -145
- package/build-module/cover/transforms.js.map +1 -1
- package/build-module/cover/use-cover-is-dark.native.js +1 -5
- package/build-module/cover/use-cover-is-dark.native.js.map +1 -1
- package/build-module/details/edit.js +5 -6
- package/build-module/details/edit.js.map +1 -1
- package/build-module/details/index.js +1 -2
- package/build-module/details/index.js.map +1 -1
- package/build-module/details/save.js +3 -4
- package/build-module/details/save.js.map +1 -1
- package/build-module/embed/deprecated.js +12 -15
- package/build-module/embed/deprecated.js.map +1 -1
- package/build-module/embed/edit.js +4 -6
- package/build-module/embed/edit.js.map +1 -1
- package/build-module/embed/edit.native.js +4 -4
- package/build-module/embed/edit.native.js.map +1 -1
- package/build-module/embed/embed-controls.js +22 -25
- package/build-module/embed/embed-controls.js.map +1 -1
- package/build-module/embed/embed-controls.native.js +9 -10
- package/build-module/embed/embed-controls.native.js.map +1 -1
- package/build-module/embed/embed-link-settings.native.js +9 -10
- package/build-module/embed/embed-link-settings.native.js.map +1 -1
- package/build-module/embed/embed-no-preview.native.js +8 -9
- package/build-module/embed/embed-no-preview.native.js.map +1 -1
- package/build-module/embed/embed-placeholder.js +10 -11
- package/build-module/embed/embed-placeholder.js.map +1 -1
- package/build-module/embed/embed-placeholder.native.js +11 -14
- package/build-module/embed/embed-placeholder.native.js.map +1 -1
- package/build-module/embed/embed-preview.native.js +16 -17
- package/build-module/embed/embed-preview.native.js.map +1 -1
- package/build-module/embed/index.js +1 -1
- package/build-module/embed/save.js +3 -4
- package/build-module/embed/save.js.map +1 -1
- package/build-module/embed/transforms.js +10 -18
- package/build-module/embed/transforms.js.map +1 -1
- package/build-module/embed/util.js +20 -51
- package/build-module/embed/util.js.map +1 -1
- package/build-module/embed/wp-embed-preview.js +14 -18
- package/build-module/embed/wp-embed-preview.js.map +1 -1
- package/build-module/embed/wp-embed-preview.native.js +4 -5
- package/build-module/embed/wp-embed-preview.native.js.map +1 -1
- package/build-module/file/deprecated.js +9 -12
- package/build-module/file/deprecated.js.map +1 -1
- package/build-module/file/edit.js +11 -16
- package/build-module/file/edit.js.map +1 -1
- package/build-module/file/edit.native.js +20 -25
- package/build-module/file/edit.native.js.map +1 -1
- package/build-module/file/index.js +2 -2
- package/build-module/file/inspector.js +12 -13
- package/build-module/file/inspector.js.map +1 -1
- package/build-module/file/interactivity.js +15 -0
- package/build-module/file/interactivity.js.map +1 -0
- package/build-module/file/save.js +3 -4
- package/build-module/file/save.js.map +1 -1
- package/build-module/file/transforms.js +9 -15
- package/build-module/file/transforms.js.map +1 -1
- package/build-module/file/{utils.js → utils/index.js} +1 -1
- package/build-module/file/utils/index.js.map +1 -0
- package/build-module/freeform/convert-to-blocks-button.js +3 -4
- package/build-module/freeform/convert-to-blocks-button.js.map +1 -1
- package/build-module/freeform/edit.js +10 -13
- package/build-module/freeform/edit.js.map +1 -1
- package/build-module/freeform/index.js +2 -2
- package/build-module/freeform/modal.js +22 -22
- package/build-module/freeform/modal.js.map +1 -1
- package/build-module/freeform/save.js +3 -4
- package/build-module/freeform/save.js.map +1 -1
- package/build-module/gallery/deprecated.js +40 -54
- package/build-module/gallery/deprecated.js.map +1 -1
- package/build-module/gallery/edit.js +25 -53
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/gallery/gap-styles.js +6 -7
- package/build-module/gallery/gap-styles.js.map +1 -1
- package/build-module/gallery/index.js +1 -1
- package/build-module/gallery/save.js +3 -5
- package/build-module/gallery/save.js.map +1 -1
- package/build-module/gallery/shared-icon.native.js +3 -4
- package/build-module/gallery/shared-icon.native.js.map +1 -1
- package/build-module/gallery/shared.js +4 -10
- package/build-module/gallery/shared.js.map +1 -1
- package/build-module/gallery/transforms.js +103 -142
- package/build-module/gallery/transforms.js.map +1 -1
- package/build-module/gallery/use-get-media.native.js +8 -15
- package/build-module/gallery/use-get-media.native.js.map +1 -1
- package/build-module/gallery/use-get-new-images.js +2 -2
- package/build-module/gallery/use-get-new-images.js.map +1 -1
- package/build-module/gallery/use-image-sizes.js +11 -19
- package/build-module/gallery/use-image-sizes.js.map +1 -1
- package/build-module/gallery/utils.js +2 -2
- package/build-module/gallery/utils.js.map +1 -1
- package/build-module/gallery/v1/edit.js +31 -66
- package/build-module/gallery/v1/edit.js.map +1 -1
- package/build-module/gallery/v1/gallery-image.native.js +1 -2
- package/build-module/gallery/v1/gallery-image.native.js.map +1 -1
- package/build-module/gallery/v1/gallery.js +4 -5
- package/build-module/gallery/v1/gallery.js.map +1 -1
- package/build-module/gallery/v1/save.js +4 -5
- package/build-module/gallery/v1/save.js.map +1 -1
- package/build-module/gallery/v1/shared.js +4 -10
- package/build-module/gallery/v1/shared.js.map +1 -1
- package/build-module/group/deprecated.js +20 -28
- package/build-module/group/deprecated.js.map +1 -1
- package/build-module/group/edit.js +14 -18
- package/build-module/group/edit.js.map +1 -1
- package/build-module/group/edit.native.js +14 -18
- package/build-module/group/edit.native.js.map +1 -1
- package/build-module/group/index.js +1 -1
- package/build-module/group/placeholder.js +16 -19
- package/build-module/group/placeholder.js.map +1 -1
- package/build-module/group/save.js +5 -6
- package/build-module/group/save.js.map +1 -1
- package/build-module/group/transforms.js +0 -5
- package/build-module/group/transforms.js.map +1 -1
- package/build-module/group/variations.js +5 -23
- package/build-module/group/variations.js.map +1 -1
- package/build-module/heading/deprecated.js +18 -26
- package/build-module/heading/deprecated.js.map +1 -1
- package/build-module/heading/edit.js +8 -9
- package/build-module/heading/edit.js.map +1 -1
- package/build-module/heading/heading-level-dropdown.js +4 -5
- package/build-module/heading/heading-level-dropdown.js.map +1 -1
- package/build-module/heading/heading-level-dropdown.native.js +4 -6
- package/build-module/heading/heading-level-dropdown.native.js.map +1 -1
- package/build-module/heading/heading-level-icon.js +4 -5
- package/build-module/heading/heading-level-icon.js.map +1 -1
- package/build-module/heading/index.js +4 -5
- package/build-module/heading/index.js.map +1 -1
- package/build-module/heading/save.js +3 -4
- package/build-module/heading/save.js.map +1 -1
- package/build-module/heading/transforms.js +21 -28
- package/build-module/heading/transforms.js.map +1 -1
- package/build-module/home-link/edit.js +10 -15
- package/build-module/home-link/edit.js.map +1 -1
- package/build-module/home-link/index.js +1 -1
- package/build-module/html/edit.js +5 -6
- package/build-module/html/edit.js.map +1 -1
- package/build-module/html/index.js +1 -1
- package/build-module/html/preview.js +5 -8
- package/build-module/html/preview.js.map +1 -1
- package/build-module/html/save.js +3 -4
- package/build-module/html/save.js.map +1 -1
- package/build-module/html/transforms.js +3 -4
- package/build-module/html/transforms.js.map +1 -1
- package/build-module/image/deprecated.js +17 -23
- package/build-module/image/deprecated.js.map +1 -1
- package/build-module/image/edit.js +28 -36
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/edit.native.js +40 -55
- package/build-module/image/edit.native.js.map +1 -1
- package/build-module/image/image.js +38 -60
- package/build-module/image/image.js.map +1 -1
- package/build-module/image/index.js +7 -6
- package/build-module/image/index.js.map +1 -1
- package/build-module/image/interactivity.js +96 -0
- package/build-module/image/interactivity.js.map +1 -0
- package/build-module/image/save.js +5 -7
- package/build-module/image/save.js.map +1 -1
- package/build-module/image/transforms.js +36 -46
- package/build-module/image/transforms.js.map +1 -1
- package/build-module/image/use-client-width.js +1 -3
- package/build-module/image/use-client-width.js.map +1 -1
- package/build-module/image/utils.js +14 -24
- package/build-module/image/utils.js.map +1 -1
- package/build-module/index.js +20 -44
- package/build-module/index.js.map +1 -1
- package/build-module/index.native.js +3 -6
- package/build-module/index.native.js.map +1 -1
- package/build-module/latest-comments/edit.js +5 -6
- package/build-module/latest-comments/edit.js.map +1 -1
- package/build-module/latest-comments/index.js +1 -1
- package/build-module/latest-posts/deprecated.js +4 -7
- package/build-module/latest-posts/deprecated.js.map +1 -1
- package/build-module/latest-posts/edit.js +24 -34
- package/build-module/latest-posts/edit.js.map +1 -1
- package/build-module/latest-posts/edit.native.js +5 -7
- package/build-module/latest-posts/edit.native.js.map +1 -1
- package/build-module/latest-posts/index.js +1 -1
- package/build-module/list/deprecated.js +10 -15
- package/build-module/list/deprecated.js.map +1 -1
- package/build-module/list/edit.js +10 -12
- package/build-module/list/edit.js.map +1 -1
- package/build-module/list/index.js +1 -1
- package/build-module/list/ordered-list-settings.js +31 -34
- package/build-module/list/ordered-list-settings.js.map +1 -1
- package/build-module/list/save.js +3 -4
- package/build-module/list/save.js.map +1 -1
- package/build-module/list/transforms.js +11 -15
- package/build-module/list/transforms.js.map +1 -1
- package/build-module/list/utils.js +1 -1
- package/build-module/list/utils.js.map +1 -1
- package/build-module/list-item/edit.js +11 -17
- package/build-module/list-item/edit.js.map +1 -1
- package/build-module/list-item/edit.native.js +16 -24
- package/build-module/list-item/edit.native.js.map +1 -1
- package/build-module/list-item/hooks/use-enter.js +1 -3
- package/build-module/list-item/hooks/use-enter.js.map +1 -1
- package/build-module/list-item/hooks/use-enter.native.js +1 -3
- package/build-module/list-item/hooks/use-enter.native.js.map +1 -1
- package/build-module/list-item/hooks/use-indent-list-item.js +1 -3
- package/build-module/list-item/hooks/use-indent-list-item.js.map +1 -1
- package/build-module/list-item/hooks/use-merge.js +1 -1
- package/build-module/list-item/hooks/use-outdent-list-item.js +2 -4
- package/build-module/list-item/hooks/use-outdent-list-item.js.map +1 -1
- package/build-module/list-item/index.js +1 -1
- package/build-module/list-item/list-style-type.native.js +29 -34
- package/build-module/list-item/list-style-type.native.js.map +1 -1
- package/build-module/list-item/save.js +3 -4
- package/build-module/list-item/save.js.map +1 -1
- package/build-module/list-item/transforms.js +2 -2
- package/build-module/list-item/transforms.js.map +1 -1
- package/build-module/list-item/utils.js +4 -4
- package/build-module/list-item/utils.js.map +1 -1
- package/build-module/loginout/edit.js +4 -5
- package/build-module/loginout/edit.js.map +1 -1
- package/build-module/loginout/index.js +1 -1
- package/build-module/media-text/deprecated.js +26 -36
- package/build-module/media-text/deprecated.js.map +1 -1
- package/build-module/media-text/edit.js +37 -50
- package/build-module/media-text/edit.js.map +1 -1
- package/build-module/media-text/edit.native.js +9 -13
- package/build-module/media-text/edit.native.js.map +1 -1
- package/build-module/media-text/index.js +1 -1
- package/build-module/media-text/media-container.js +18 -21
- package/build-module/media-text/media-container.js.map +1 -1
- package/build-module/media-text/media-container.native.js +4 -5
- package/build-module/media-text/media-container.native.js.map +1 -1
- package/build-module/media-text/save.js +4 -6
- package/build-module/media-text/save.js.map +1 -1
- package/build-module/media-text/transforms.js +73 -91
- package/build-module/media-text/transforms.js.map +1 -1
- package/build-module/missing/edit.js +9 -11
- package/build-module/missing/edit.js.map +1 -1
- package/build-module/missing/edit.native.js +7 -8
- package/build-module/missing/edit.native.js.map +1 -1
- package/build-module/missing/index.js +4 -6
- package/build-module/missing/index.js.map +1 -1
- package/build-module/missing/save.js +3 -4
- package/build-module/missing/save.js.map +1 -1
- package/build-module/more/edit.js +11 -15
- package/build-module/more/edit.js.map +1 -1
- package/build-module/more/edit.native.js +3 -8
- package/build-module/more/edit.native.js.map +1 -1
- package/build-module/more/index.js +4 -6
- package/build-module/more/index.js.map +1 -1
- package/build-module/more/save.js +6 -7
- package/build-module/more/save.js.map +1 -1
- package/build-module/navigation/constants.js +1 -0
- package/build-module/navigation/constants.js.map +1 -1
- package/build-module/navigation/deprecated.js +16 -27
- package/build-module/navigation/deprecated.js.map +1 -1
- package/build-module/navigation/edit/are-blocks-dirty.js +1 -1
- package/build-module/navigation/edit/are-blocks-dirty.js.map +1 -1
- package/build-module/navigation/edit/deleted-navigation-warning.js +3 -4
- package/build-module/navigation/edit/deleted-navigation-warning.js.map +1 -1
- package/build-module/navigation/edit/index.js +33 -40
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/inner-blocks.js +12 -15
- package/build-module/navigation/edit/inner-blocks.js.map +1 -1
- package/build-module/navigation/edit/leaf-more-menu.js +128 -0
- package/build-module/navigation/edit/leaf-more-menu.js.map +1 -0
- package/build-module/navigation/edit/manage-menus-button.js +5 -6
- package/build-module/navigation/edit/manage-menus-button.js.map +1 -1
- package/build-module/navigation/edit/menu-inspector-controls.js +64 -17
- package/build-module/navigation/edit/menu-inspector-controls.js.map +1 -1
- package/build-module/navigation/edit/navigation-menu-delete-control.js +10 -11
- package/build-module/navigation/edit/navigation-menu-delete-control.js.map +1 -1
- package/build-module/navigation/edit/navigation-menu-selector.js +50 -56
- package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build-module/navigation/edit/overlay-menu-icon.js +3 -5
- package/build-module/navigation/edit/overlay-menu-icon.js.map +1 -1
- package/build-module/navigation/edit/overlay-menu-preview.js +5 -6
- package/build-module/navigation/edit/overlay-menu-preview.js.map +1 -1
- package/build-module/navigation/edit/placeholder/index.js +10 -11
- package/build-module/navigation/edit/placeholder/index.js.map +1 -1
- package/build-module/navigation/edit/placeholder/placeholder-preview.js +3 -4
- package/build-module/navigation/edit/placeholder/placeholder-preview.js.map +1 -1
- package/build-module/navigation/edit/responsive-wrapper.js +18 -20
- package/build-module/navigation/edit/responsive-wrapper.js.map +1 -1
- package/build-module/navigation/edit/unsaved-inner-blocks.js +18 -30
- package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js +2 -3
- package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
- package/build-module/navigation/edit/use-create-navigation-menu.js +3 -7
- package/build-module/navigation/edit/use-create-navigation-menu.js.map +1 -1
- package/build-module/navigation/edit/use-generate-default-navigation-title.js +1 -5
- package/build-module/navigation/edit/use-generate-default-navigation-title.js.map +1 -1
- package/build-module/navigation/edit/use-inner-blocks.js +1 -1
- package/build-module/navigation/edit/use-inner-blocks.js.map +1 -1
- package/build-module/navigation/edit/use-navigation-notice.js +4 -5
- package/build-module/navigation/edit/use-navigation-notice.js.map +1 -1
- package/build-module/navigation/edit/utils.js +2 -4
- package/build-module/navigation/edit/utils.js.map +1 -1
- package/build-module/navigation/index.js +2 -2
- package/build-module/navigation/interactivity.js +98 -70
- package/build-module/navigation/interactivity.js.map +1 -1
- package/build-module/navigation/menu-items-to-blocks.js +25 -34
- package/build-module/navigation/menu-items-to-blocks.js.map +1 -1
- package/build-module/navigation/save.js +3 -5
- package/build-module/navigation/save.js.map +1 -1
- package/build-module/navigation/use-navigation-entities.js +2 -2
- package/build-module/navigation/use-navigation-entities.js.map +1 -1
- package/build-module/navigation/use-navigation-menu.js +1 -1
- package/build-module/navigation/use-navigation-menu.js.map +1 -1
- package/build-module/navigation/use-template-part-area-label.js +3 -5
- package/build-module/navigation/use-template-part-area-label.js.map +1 -1
- package/build-module/navigation-link/edit.js +21 -26
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-link/hooks.js +2 -2
- package/build-module/navigation-link/hooks.js.map +1 -1
- package/build-module/navigation-link/index.js +11 -16
- package/build-module/navigation-link/index.js.map +1 -1
- package/build-module/navigation-link/link-ui.js +10 -9
- package/build-module/navigation-link/link-ui.js.map +1 -1
- package/build-module/navigation-link/update-attributes.js +5 -8
- package/build-module/navigation-link/update-attributes.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +19 -20
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/navigation-submenu/index.js +7 -12
- package/build-module/navigation-submenu/index.js.map +1 -1
- package/build-module/navigation-submenu/transforms.js +6 -30
- package/build-module/navigation-submenu/transforms.js.map +1 -1
- package/build-module/nextpage/edit.native.js +8 -9
- package/build-module/nextpage/edit.native.js.map +1 -1
- package/build-module/nextpage/index.js +1 -1
- package/build-module/page-list/convert-to-links-modal.js +5 -6
- package/build-module/page-list/convert-to-links-modal.js.map +1 -1
- package/build-module/page-list/edit.js +23 -35
- package/build-module/page-list/edit.js.map +1 -1
- package/build-module/page-list/index.js +1 -1
- package/build-module/page-list/use-convert-to-navigation-links.js +16 -21
- package/build-module/page-list/use-convert-to-navigation-links.js.map +1 -1
- package/build-module/page-list-item/edit.js +5 -6
- package/build-module/page-list-item/edit.js.map +1 -1
- package/build-module/page-list-item/index.js +4 -7
- package/build-module/page-list-item/index.js.map +1 -1
- package/build-module/paragraph/deprecated.js +18 -24
- package/build-module/paragraph/deprecated.js.map +1 -1
- package/build-module/paragraph/edit.js +12 -14
- package/build-module/paragraph/edit.js.map +1 -1
- package/build-module/paragraph/edit.native.js +13 -16
- package/build-module/paragraph/edit.native.js.map +1 -1
- package/build-module/paragraph/index.js +4 -6
- package/build-module/paragraph/index.js.map +1 -1
- package/build-module/paragraph/save.js +3 -4
- package/build-module/paragraph/save.js.map +1 -1
- package/build-module/paragraph/transforms.js +10 -13
- package/build-module/paragraph/transforms.js.map +1 -1
- package/build-module/pattern/edit.js +45 -15
- package/build-module/pattern/edit.js.map +1 -1
- package/build-module/pattern/index.js +11 -4
- package/build-module/pattern/index.js.map +1 -1
- package/build-module/pattern/v1/edit.js +47 -0
- package/build-module/pattern/v1/edit.js.map +1 -0
- package/build-module/post-author/edit.js +19 -23
- package/build-module/post-author/edit.js.map +1 -1
- package/build-module/post-author/index.js +1 -1
- package/build-module/post-author-biography/edit.js +12 -15
- package/build-module/post-author-biography/edit.js.map +1 -1
- package/build-module/post-author-biography/index.js +1 -1
- package/build-module/post-author-name/edit.js +14 -17
- package/build-module/post-author-name/edit.js.map +1 -1
- package/build-module/post-author-name/index.js +1 -1
- package/build-module/post-author-name/transforms.js +10 -16
- package/build-module/post-author-name/transforms.js.map +1 -1
- package/build-module/post-comment/edit.js +6 -7
- package/build-module/post-comment/edit.js.map +1 -1
- package/build-module/post-comment/index.js +1 -1
- package/build-module/post-comments-count/edit.js +6 -9
- package/build-module/post-comments-count/edit.js.map +1 -1
- package/build-module/post-comments-count/index.js +1 -1
- package/build-module/post-comments-form/edit.js +5 -6
- package/build-module/post-comments-form/edit.js.map +1 -1
- package/build-module/post-comments-form/form.js +5 -10
- package/build-module/post-comments-form/form.js.map +1 -1
- package/build-module/post-comments-form/index.js +1 -1
- package/build-module/post-comments-link/edit.js +5 -6
- package/build-module/post-comments-link/edit.js.map +1 -1
- package/build-module/post-comments-link/index.js +1 -1
- package/build-module/post-content/edit.js +27 -24
- package/build-module/post-content/edit.js.map +1 -1
- package/build-module/post-content/index.js +1 -1
- package/build-module/post-date/deprecated.js +4 -7
- package/build-module/post-date/deprecated.js.map +1 -1
- package/build-module/post-date/edit.js +27 -33
- package/build-module/post-date/edit.js.map +1 -1
- package/build-module/post-date/index.js +1 -1
- package/build-module/post-excerpt/edit.js +21 -24
- package/build-module/post-excerpt/edit.js.map +1 -1
- package/build-module/post-excerpt/index.js +3 -3
- package/build-module/post-featured-image/dimension-controls.js +12 -13
- package/build-module/post-featured-image/dimension-controls.js.map +1 -1
- package/build-module/post-featured-image/edit.js +27 -37
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/post-featured-image/index.js +1 -1
- package/build-module/post-featured-image/overlay.js +7 -8
- package/build-module/post-featured-image/overlay.js.map +1 -1
- package/build-module/post-navigation-link/edit.js +11 -12
- package/build-module/post-navigation-link/edit.js.map +1 -1
- package/build-module/post-navigation-link/index.js +1 -1
- package/build-module/post-template/edit.js +99 -86
- package/build-module/post-template/edit.js.map +1 -1
- package/build-module/post-template/index.js +10 -4
- package/build-module/post-template/index.js.map +1 -1
- package/build-module/post-terms/edit.js +10 -15
- package/build-module/post-terms/edit.js.map +1 -1
- package/build-module/post-terms/index.js +1 -1
- package/build-module/post-terms/use-post-terms.js +7 -12
- package/build-module/post-terms/use-post-terms.js.map +1 -1
- package/build-module/post-time-to-read/edit.js +5 -6
- package/build-module/post-time-to-read/edit.js.map +1 -1
- package/build-module/post-time-to-read/index.js +1 -1
- package/build-module/post-title/deprecated.js +4 -7
- package/build-module/post-title/deprecated.js.map +1 -1
- package/build-module/post-title/edit.js +36 -25
- package/build-module/post-title/edit.js.map +1 -1
- package/build-module/post-title/index.js +2 -2
- package/build-module/preformatted/edit.js +7 -8
- package/build-module/preformatted/edit.js.map +1 -1
- package/build-module/preformatted/edit.native.js +5 -7
- package/build-module/preformatted/edit.native.js.map +1 -1
- package/build-module/preformatted/index.js +1 -1
- package/build-module/preformatted/save.js +3 -4
- package/build-module/preformatted/save.js.map +1 -1
- package/build-module/preformatted/transforms.js +14 -20
- package/build-module/preformatted/transforms.js.map +1 -1
- package/build-module/pullquote/deprecated.js +61 -73
- package/build-module/pullquote/deprecated.js.map +1 -1
- package/build-module/pullquote/edit.js +6 -7
- package/build-module/pullquote/edit.js.map +1 -1
- package/build-module/pullquote/edit.native.js +13 -21
- package/build-module/pullquote/edit.native.js.map +1 -1
- package/build-module/pullquote/figure.native.js +5 -6
- package/build-module/pullquote/figure.native.js.map +1 -1
- package/build-module/pullquote/index.js +1 -1
- package/build-module/pullquote/save.js +3 -4
- package/build-module/pullquote/save.js.map +1 -1
- package/build-module/pullquote/transforms.js +17 -24
- package/build-module/pullquote/transforms.js.map +1 -1
- package/build-module/query/deprecated.js +195 -76
- package/build-module/query/deprecated.js.map +1 -1
- package/build-module/query/edit/inspector-controls/author-control.js +5 -8
- package/build-module/query/edit/inspector-controls/author-control.js.map +1 -1
- package/build-module/query/edit/inspector-controls/create-new-post-link.js +6 -7
- package/build-module/query/edit/inspector-controls/create-new-post-link.js.map +1 -1
- package/build-module/query/edit/inspector-controls/index.js +4 -6
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/query/edit/inspector-controls/order-control.js +5 -6
- package/build-module/query/edit/inspector-controls/order-control.js.map +1 -1
- package/build-module/query/edit/inspector-controls/parent-control.js +10 -13
- package/build-module/query/edit/inspector-controls/parent-control.js.map +1 -1
- package/build-module/query/edit/inspector-controls/sticky-control.js +4 -5
- package/build-module/query/edit/inspector-controls/sticky-control.js.map +1 -1
- package/build-module/query/edit/inspector-controls/taxonomy-controls.js +15 -19
- package/build-module/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
- package/build-module/query/edit/pattern-selection-modal.js +5 -6
- package/build-module/query/edit/pattern-selection-modal.js.map +1 -1
- package/build-module/query/edit/query-content.js +7 -9
- package/build-module/query/edit/query-content.js.map +1 -1
- package/build-module/query/edit/query-placeholder.js +16 -20
- package/build-module/query/edit/query-placeholder.js.map +1 -1
- package/build-module/query/edit/query-toolbar.js +18 -42
- package/build-module/query/edit/query-toolbar.js.map +1 -1
- package/build-module/query/index.js +1 -7
- package/build-module/query/index.js.map +1 -1
- package/build-module/query/save.js +5 -6
- package/build-module/query/save.js.map +1 -1
- package/build-module/query/utils.js +24 -60
- package/build-module/query/utils.js.map +1 -1
- package/build-module/query-no-results/index.js +1 -1
- package/build-module/query-pagination/edit.js +28 -11
- package/build-module/query-pagination/edit.js.map +1 -1
- package/build-module/query-pagination/index.js +7 -2
- package/build-module/query-pagination/index.js.map +1 -1
- package/build-module/query-pagination/query-pagination-arrow-controls.js +4 -5
- package/build-module/query-pagination/query-pagination-arrow-controls.js.map +1 -1
- package/build-module/query-pagination/query-pagination-label-control.js +20 -0
- package/build-module/query-pagination/query-pagination-label-control.js.map +1 -0
- package/build-module/query-pagination-next/edit.js +11 -11
- package/build-module/query-pagination-next/edit.js.map +1 -1
- package/build-module/query-pagination-next/index.js +2 -2
- package/build-module/query-pagination-numbers/edit.js +3 -7
- package/build-module/query-pagination-numbers/edit.js.map +1 -1
- package/build-module/query-pagination-numbers/index.js +1 -1
- package/build-module/query-pagination-previous/edit.js +11 -11
- package/build-module/query-pagination-previous/edit.js.map +1 -1
- package/build-module/query-pagination-previous/index.js +2 -2
- package/build-module/query-title/deprecated.js +4 -7
- package/build-module/query-title/deprecated.js.map +1 -1
- package/build-module/query-title/edit.js +10 -11
- package/build-module/query-title/edit.js.map +1 -1
- package/build-module/query-title/index.js +1 -1
- package/build-module/quote/deprecated.js +17 -24
- package/build-module/quote/deprecated.js.map +1 -1
- package/build-module/quote/edit.js +8 -9
- package/build-module/quote/edit.js.map +1 -1
- package/build-module/quote/index.js +1 -1
- package/build-module/quote/save.js +3 -4
- package/build-module/quote/save.js.map +1 -1
- package/build-module/quote/transforms.js +38 -61
- package/build-module/quote/transforms.js.map +1 -1
- package/build-module/read-more/edit.js +8 -9
- package/build-module/read-more/edit.js.map +1 -1
- package/build-module/read-more/index.js +1 -1
- package/build-module/rss/edit.js +4 -5
- package/build-module/rss/edit.js.map +1 -1
- package/build-module/rss/index.js +1 -1
- package/build-module/search/edit.js +74 -32
- package/build-module/search/edit.js.map +1 -1
- package/build-module/search/edit.native.js +28 -37
- package/build-module/search/edit.native.js.map +1 -1
- package/build-module/search/index.js +9 -1
- package/build-module/search/index.js.map +1 -1
- package/build-module/search/view.js +65 -0
- package/build-module/search/view.js.map +1 -0
- package/build-module/separator/deprecated.js +3 -4
- package/build-module/separator/deprecated.js.map +1 -1
- package/build-module/separator/edit.js +6 -9
- package/build-module/separator/edit.js.map +1 -1
- package/build-module/separator/index.js +1 -1
- package/build-module/separator/save.js +5 -8
- package/build-module/separator/save.js.map +1 -1
- package/build-module/shortcode/edit.js +4 -5
- package/build-module/shortcode/edit.js.map +1 -1
- package/build-module/shortcode/index.js +2 -2
- package/build-module/shortcode/save.js +3 -4
- package/build-module/shortcode/save.js.map +1 -1
- package/build-module/shortcode/transforms.js +3 -4
- package/build-module/shortcode/transforms.js.map +1 -1
- package/build-module/site-logo/edit.js +58 -74
- package/build-module/site-logo/edit.js.map +1 -1
- package/build-module/site-logo/index.js +1 -1
- package/build-module/site-logo/transforms.js +4 -5
- package/build-module/site-logo/transforms.js.map +1 -1
- package/build-module/site-tagline/deprecated.js +4 -7
- package/build-module/site-tagline/deprecated.js.map +1 -1
- package/build-module/site-tagline/edit.js +6 -7
- package/build-module/site-tagline/edit.js.map +1 -1
- package/build-module/site-tagline/index.js +1 -1
- package/build-module/site-title/deprecated.js +4 -7
- package/build-module/site-title/deprecated.js.map +1 -1
- package/build-module/site-title/edit/index.js +6 -7
- package/build-module/site-title/edit/index.js.map +1 -1
- package/build-module/site-title/edit/level-icon.js +4 -5
- package/build-module/site-title/edit/level-icon.js.map +1 -1
- package/build-module/site-title/edit/level-toolbar.js +4 -5
- package/build-module/site-title/edit/level-toolbar.js.map +1 -1
- package/build-module/site-title/index.js +1 -1
- package/build-module/site-title/transforms.js +4 -5
- package/build-module/site-title/transforms.js.map +1 -1
- package/build-module/social-link/edit.js +35 -18
- package/build-module/social-link/edit.js.map +1 -1
- package/build-module/social-link/edit.native.js +11 -13
- package/build-module/social-link/edit.native.js.map +1 -1
- package/build-module/social-link/index.js +2 -2
- package/build-module/social-links/deprecated.js +2 -4
- package/build-module/social-links/deprecated.js.map +1 -1
- package/build-module/social-links/edit.js +36 -42
- package/build-module/social-links/edit.js.map +1 -1
- package/build-module/social-links/edit.native.js +18 -25
- package/build-module/social-links/edit.native.js.map +1 -1
- package/build-module/social-links/index.js +3 -1
- package/build-module/social-links/index.js.map +1 -1
- package/build-module/spacer/controls.js +18 -21
- package/build-module/spacer/controls.js.map +1 -1
- package/build-module/spacer/controls.native.js +7 -8
- package/build-module/spacer/controls.native.js.map +1 -1
- package/build-module/spacer/deprecated.js +3 -4
- package/build-module/spacer/deprecated.js.map +1 -1
- package/build-module/spacer/edit.js +20 -23
- package/build-module/spacer/edit.js.map +1 -1
- package/build-module/spacer/edit.native.js +7 -8
- package/build-module/spacer/edit.native.js.map +1 -1
- package/build-module/spacer/index.js +1 -1
- package/build-module/spacer/save.js +6 -7
- package/build-module/spacer/save.js.map +1 -1
- package/build-module/spacer/save.native.js +6 -7
- package/build-module/spacer/save.native.js.map +1 -1
- package/build-module/table/deprecated.js +79 -102
- package/build-module/table/deprecated.js.map +1 -1
- package/build-module/table/edit.js +45 -59
- package/build-module/table/edit.js.map +1 -1
- package/build-module/table/index.js +1 -1
- package/build-module/table/save.js +33 -40
- package/build-module/table/save.js.map +1 -1
- package/build-module/table/state.js +32 -59
- package/build-module/table/state.js.map +1 -1
- package/build-module/table/transforms.js +17 -20
- package/build-module/table/transforms.js.map +1 -1
- package/build-module/table-of-contents/edit.js +9 -10
- package/build-module/table-of-contents/edit.js.map +1 -1
- package/build-module/table-of-contents/index.js +1 -1
- package/build-module/table-of-contents/list.js +3 -4
- package/build-module/table-of-contents/list.js.map +1 -1
- package/build-module/table-of-contents/save.js +5 -7
- package/build-module/table-of-contents/save.js.map +1 -1
- package/build-module/table-of-contents/utils.js +1 -3
- package/build-module/table-of-contents/utils.js.map +1 -1
- package/build-module/tag-cloud/edit.js +6 -8
- package/build-module/tag-cloud/edit.js.map +1 -1
- package/build-module/tag-cloud/index.js +1 -1
- package/build-module/template-part/edit/advanced-controls.js +15 -19
- package/build-module/template-part/edit/advanced-controls.js.map +1 -1
- package/build-module/template-part/edit/import-controls.js +7 -11
- package/build-module/template-part/edit/import-controls.js.map +1 -1
- package/build-module/template-part/edit/index.js +8 -14
- package/build-module/template-part/edit/index.js.map +1 -1
- package/build-module/template-part/edit/inner-blocks.js +8 -11
- package/build-module/template-part/edit/inner-blocks.js.map +1 -1
- package/build-module/template-part/edit/placeholder.js +7 -8
- package/build-module/template-part/edit/placeholder.js.map +1 -1
- package/build-module/template-part/edit/selection-modal.js +8 -11
- package/build-module/template-part/edit/selection-modal.js.map +1 -1
- package/build-module/template-part/edit/title-modal.js +5 -6
- package/build-module/template-part/edit/title-modal.js.map +1 -1
- package/build-module/template-part/edit/utils/hooks.js +5 -7
- package/build-module/template-part/edit/utils/hooks.js.map +1 -1
- package/build-module/template-part/edit/utils/transformers.js +3 -6
- package/build-module/template-part/edit/utils/transformers.js.map +1 -1
- package/build-module/template-part/index.js +11 -19
- package/build-module/template-part/index.js.map +1 -1
- package/build-module/template-part/variations.js +2 -2
- package/build-module/template-part/variations.js.map +1 -1
- package/build-module/term-description/edit.js +5 -6
- package/build-module/term-description/edit.js.map +1 -1
- package/build-module/term-description/index.js +1 -1
- package/build-module/text-columns/edit.js +5 -8
- package/build-module/text-columns/edit.js.map +1 -1
- package/build-module/text-columns/index.js +1 -1
- package/build-module/text-columns/save.js +10 -15
- package/build-module/text-columns/save.js.map +1 -1
- package/build-module/text-columns/transforms.js +14 -20
- package/build-module/text-columns/transforms.js.map +1 -1
- package/build-module/utils/init-block.native.js +1 -3
- package/build-module/utils/init-block.native.js.map +1 -1
- package/build-module/utils/interactivity/constants.js +1 -1
- package/build-module/utils/interactivity/constants.js.map +1 -1
- package/build-module/utils/interactivity/directives.js +96 -80
- package/build-module/utils/interactivity/directives.js.map +1 -1
- package/build-module/utils/interactivity/hooks.js +79 -32
- package/build-module/utils/interactivity/hooks.js.map +1 -1
- package/build-module/utils/interactivity/hydration.js +1 -1
- package/build-module/utils/interactivity/hydration.js.map +1 -1
- package/build-module/utils/interactivity/portals.js +100 -0
- package/build-module/utils/interactivity/portals.js.map +1 -0
- package/build-module/utils/interactivity/store.js +4 -5
- package/build-module/utils/interactivity/store.js.map +1 -1
- package/build-module/utils/interactivity/vdom.js +14 -4
- package/build-module/utils/interactivity/vdom.js.map +1 -1
- package/build-module/utils/migrate-font-family.js +1 -3
- package/build-module/utils/migrate-font-family.js.map +1 -1
- package/build-module/utils/search-patterns.js +5 -19
- package/build-module/utils/search-patterns.js.map +1 -1
- package/build-module/utils/transformation-categories.native.js +1 -4
- package/build-module/utils/transformation-categories.native.js.map +1 -1
- package/build-module/verse/deprecated.js +10 -15
- package/build-module/verse/deprecated.js.map +1 -1
- package/build-module/verse/edit.js +7 -8
- package/build-module/verse/edit.js.map +1 -1
- package/build-module/verse/index.js +1 -1
- package/build-module/verse/save.js +3 -4
- package/build-module/verse/save.js.map +1 -1
- package/build-module/video/deprecated.js +4 -5
- package/build-module/video/deprecated.js.map +1 -1
- package/build-module/video/edit-common-settings.js +4 -5
- package/build-module/video/edit-common-settings.js.map +1 -1
- package/build-module/video/edit.js +18 -27
- package/build-module/video/edit.js.map +1 -1
- package/build-module/video/edit.native.js +18 -24
- package/build-module/video/edit.native.js.map +1 -1
- package/build-module/video/index.js +1 -1
- package/build-module/video/save.js +3 -4
- package/build-module/video/save.js.map +1 -1
- package/build-module/video/tracks-editor.js +39 -51
- package/build-module/video/tracks-editor.js.map +1 -1
- package/build-module/video/tracks.js +3 -4
- package/build-module/video/tracks.js.map +1 -1
- package/build-module/video/transforms.js +30 -35
- package/build-module/video/transforms.js.map +1 -1
- package/build-style/common-rtl.css +1 -1
- package/build-style/common.css +1 -1
- package/build-style/cover/style-rtl.css +1 -2
- package/build-style/cover/style.css +1 -2
- package/build-style/editor-rtl.css +76 -8
- package/build-style/editor.css +76 -8
- package/build-style/file/editor-rtl.css +3 -0
- package/build-style/file/editor.css +3 -0
- package/build-style/freeform/editor-rtl.css +29 -0
- package/build-style/freeform/editor.css +29 -0
- package/build-style/gallery/style-rtl.css +2 -4
- package/build-style/gallery/style.css +2 -4
- package/build-style/image/style-rtl.css +108 -0
- package/build-style/image/style.css +108 -0
- package/build-style/navigation/editor-rtl.css +44 -8
- package/build-style/navigation/editor.css +44 -8
- package/build-style/post-comments-form/style-rtl.css +1 -1
- package/build-style/post-comments-form/style.css +1 -1
- package/build-style/post-template/style-rtl.css +6 -0
- package/build-style/post-template/style.css +6 -0
- package/build-style/search/style-rtl.css +30 -0
- package/build-style/search/style.css +30 -0
- package/build-style/social-links/style-rtl.css +4 -0
- package/build-style/social-links/style.css +4 -0
- package/build-style/style-rtl.css +162 -9
- package/build-style/style.css +162 -9
- package/build-style/term-description/style-rtl.css +97 -0
- package/build-style/term-description/style.css +97 -0
- package/build-style/video/style-rtl.css +1 -2
- package/build-style/video/style.css +1 -2
- package/package.json +32 -32
- package/src/archives/block.json +1 -1
- package/src/audio/block.json +1 -1
- package/src/avatar/block.json +1 -1
- package/src/block/block.json +1 -1
- package/src/block/edit.native.js +18 -4
- package/src/button/block.json +1 -1
- package/src/buttons/block.json +1 -1
- package/src/buttons/test/edit.native.js +0 -9
- package/src/calendar/block.json +1 -1
- package/src/categories/block.json +1 -1
- package/src/code/block.json +2 -1
- package/src/column/block.json +2 -2
- package/src/columns/block.json +1 -1
- package/src/columns/test/__snapshots__/edit.native.js.snap +72 -0
- package/src/columns/test/__snapshots__/transforms.native.js.snap +1 -1
- package/src/columns/test/edit.native.js +25 -0
- package/src/columns/test/transforms.native.js +3 -5
- package/src/columns/transforms.js +2 -8
- package/src/comment-author-avatar/block.json +1 -1
- package/src/comment-author-name/block.json +1 -1
- package/src/comment-content/block.json +1 -1
- package/src/comment-date/block.json +1 -1
- package/src/comment-edit-link/block.json +1 -1
- package/src/comment-reply-link/block.json +1 -1
- package/src/comment-template/block.json +1 -1
- package/src/comment-template/index.php +13 -1
- package/src/comments/block.json +1 -1
- package/src/comments/deprecated.js +1 -1
- package/src/comments/index.php +1 -6
- package/src/comments-pagination/block.json +1 -1
- package/src/comments-pagination-next/block.json +1 -1
- package/src/comments-pagination-next/index.php +1 -1
- package/src/comments-pagination-numbers/block.json +1 -1
- package/src/comments-pagination-previous/block.json +1 -1
- package/src/comments-pagination-previous/index.php +1 -1
- package/src/comments-title/block.json +1 -1
- package/src/cover/block.json +1 -1
- package/src/cover/edit/resizable-cover-popover.js +2 -1
- package/src/details/block.json +1 -2
- package/src/embed/block.json +1 -1
- package/src/file/block.json +2 -2
- package/src/file/editor.scss +4 -0
- package/src/file/index.php +30 -7
- package/src/file/interactivity.js +15 -0
- package/src/freeform/block.json +2 -2
- package/src/freeform/editor.scss +45 -0
- package/src/freeform/modal.js +22 -19
- package/src/gallery/block.json +1 -1
- package/src/gallery/v1/edit.js +1 -6
- package/src/gallery/v1/gallery-image.native.js +1 -2
- package/src/gallery/v1/save.js +1 -1
- package/src/group/block.json +1 -1
- package/src/group/test/__snapshots__/transforms.native.js.snap +1 -1
- package/src/group/test/transforms.native.js +3 -5
- package/src/group/transforms.js +0 -7
- package/src/heading/block.json +1 -1
- package/src/home-link/block.json +1 -1
- package/src/html/block.json +1 -1
- package/src/image/block.json +4 -1
- package/src/image/deprecated.js +2 -3
- package/src/image/edit.js +18 -18
- package/src/image/image.js +8 -11
- package/src/image/index.php +4 -3
- package/src/image/interactivity.js +118 -0
- package/src/image/save.js +4 -3
- package/src/image/style.scss +125 -0
- package/src/image/utils.js +11 -18
- package/src/index.js +1 -3
- package/src/latest-comments/block.json +1 -1
- package/src/latest-posts/block.json +1 -1
- package/src/latest-posts/edit.native.js +1 -4
- package/src/list/block.json +1 -1
- package/src/list/edit.js +1 -1
- package/src/list/test/edit.native.js +80 -1
- package/src/list-item/block.json +1 -1
- package/src/list-item/edit.native.js +1 -1
- package/src/list-item/transforms.js +4 -2
- package/src/loginout/block.json +1 -1
- package/src/media-text/block.json +1 -1
- package/src/media-text/deprecated.js +4 -5
- package/src/media-text/edit.js +12 -10
- package/src/media-text/media-container.js +3 -3
- package/src/media-text/save.js +1 -2
- package/src/missing/block.json +1 -1
- package/src/more/block.json +1 -1
- package/src/more/edit.native.js +8 -15
- package/src/navigation/block.json +2 -2
- package/src/navigation/constants.js +5 -0
- package/src/navigation/edit/inner-blocks.js +6 -1
- package/src/navigation/edit/leaf-more-menu.js +170 -0
- package/src/navigation/edit/menu-inspector-controls.js +71 -10
- package/src/navigation/edit/navigation-menu-delete-control.js +29 -29
- package/src/navigation/edit/unsaved-inner-blocks.js +11 -24
- package/src/navigation/editor.scss +24 -12
- package/src/navigation/index.php +173 -34
- package/src/navigation/interactivity.js +77 -52
- package/src/navigation-link/block.json +1 -1
- package/src/navigation-link/edit.js +9 -11
- package/src/navigation-link/hooks.js +2 -2
- package/src/navigation-link/link-ui.js +12 -6
- package/src/navigation-link/test/__snapshots__/hooks.js.snap +2 -2
- package/src/navigation-link/update-attributes.js +2 -2
- package/src/navigation-submenu/block.json +1 -1
- package/src/navigation-submenu/edit.js +8 -2
- package/src/nextpage/block.json +1 -1
- package/src/nextpage/edit.native.js +2 -2
- package/src/page-list/block.json +1 -1
- package/src/page-list-item/block.json +1 -1
- package/src/page-list-item/index.php +14 -0
- package/src/paragraph/block.json +1 -1
- package/src/pattern/block.json +5 -1
- package/src/pattern/edit.js +53 -16
- package/src/pattern/index.js +5 -4
- package/src/pattern/index.php +14 -1
- package/src/pattern/v1/edit.js +57 -0
- package/src/post-author/block.json +1 -1
- package/src/post-author-biography/block.json +1 -1
- package/src/post-author-name/block.json +1 -1
- package/src/post-comment/block.json +1 -1
- package/src/post-comments-count/block.json +1 -1
- package/src/post-comments-form/block.json +1 -1
- package/src/post-comments-form/style.scss +3 -1
- package/src/post-comments-link/block.json +1 -1
- package/src/post-content/block.json +1 -1
- package/src/post-content/edit.js +22 -2
- package/src/post-date/block.json +1 -1
- package/src/post-excerpt/block.json +3 -3
- package/src/post-excerpt/edit.js +5 -14
- package/src/post-excerpt/index.php +2 -2
- package/src/post-featured-image/block.json +1 -1
- package/src/post-navigation-link/block.json +1 -1
- package/src/post-template/block.json +10 -4
- package/src/post-template/edit.js +66 -32
- package/src/post-template/index.php +10 -9
- package/src/post-template/style.scss +8 -1
- package/src/post-terms/block.json +1 -1
- package/src/post-time-to-read/block.json +1 -1
- package/src/post-title/block.json +2 -2
- package/src/post-title/edit.js +70 -59
- package/src/preformatted/block.json +1 -1
- package/src/pullquote/block.json +1 -1
- package/src/query/block.json +1 -7
- package/src/query/deprecated.js +167 -22
- package/src/query/edit/inspector-controls/index.js +4 -2
- package/src/query/edit/query-content.js +0 -1
- package/src/query/edit/query-toolbar.js +3 -22
- package/src/query-no-results/block.json +1 -1
- package/src/query-pagination/block.json +7 -2
- package/src/query-pagination/edit.js +18 -2
- package/src/query-pagination/query-pagination-label-control.js +19 -0
- package/src/query-pagination-next/block.json +2 -2
- package/src/query-pagination-next/edit.js +13 -11
- package/src/query-pagination-next/index.php +7 -2
- package/src/query-pagination-numbers/block.json +1 -1
- package/src/query-pagination-previous/block.json +2 -2
- package/src/query-pagination-previous/edit.js +13 -11
- package/src/query-pagination-previous/index.php +7 -2
- package/src/query-title/block.json +1 -1
- package/src/quote/block.json +1 -1
- package/src/quote/test/__snapshots__/transforms.native.js.snap +1 -1
- package/src/quote/test/transforms.native.js +3 -5
- package/src/quote/transforms.js +9 -13
- package/src/read-more/block.json +1 -1
- package/src/rss/block.json +1 -1
- package/src/search/block.json +9 -1
- package/src/search/edit.js +61 -3
- package/src/search/index.php +50 -51
- package/src/search/style.scss +39 -0
- package/src/search/view.js +68 -0
- package/src/separator/block.json +1 -1
- package/src/shortcode/block.json +2 -2
- package/src/site-logo/block.json +1 -1
- package/src/site-logo/index.php +1 -1
- package/src/site-tagline/block.json +1 -1
- package/src/site-title/block.json +1 -1
- package/src/social-link/block.json +3 -1
- package/src/social-link/edit.js +61 -27
- package/src/social-link/index.php +22 -1
- package/src/social-links/block.json +3 -1
- package/src/social-links/style.scss +10 -0
- package/src/spacer/block.json +1 -1
- package/src/spacer/controls.js +1 -0
- package/src/style.scss +1 -0
- package/src/table/block.json +1 -1
- package/src/table-of-contents/block.json +1 -1
- package/src/tag-cloud/block.json +1 -1
- package/src/template-part/block.json +1 -1
- package/src/template-part/edit/index.js +4 -6
- package/src/template-part/edit/utils/hooks.js +1 -1
- package/src/template-part/index.php +2 -2
- package/src/term-description/block.json +1 -1
- package/src/term-description/style.scss +11 -0
- package/src/text-columns/block.json +1 -1
- package/src/utils/interactivity/constants.js +1 -1
- package/src/utils/interactivity/directives.js +32 -11
- package/src/utils/interactivity/hooks.js +83 -14
- package/src/utils/interactivity/hydration.js +1 -1
- package/src/utils/interactivity/portals.js +98 -0
- package/src/utils/interactivity/vdom.js +21 -4
- package/src/verse/block.json +1 -1
- package/src/video/block.json +1 -1
- package/build/file/utils.js.map +0 -1
- package/build/file/view.js +0 -9
- package/build/file/view.js.map +0 -1
- package/build/navigation/view-modal.js +0 -66
- package/build/navigation/view-modal.js.map +0 -1
- package/build/navigation/view.js +0 -61
- package/build/navigation/view.js.map +0 -1
- package/build-module/file/utils.js.map +0 -1
- package/build-module/file/view.js +0 -6
- package/build-module/file/view.js.map +0 -1
- package/build-module/navigation/view-modal.js +0 -60
- package/build-module/navigation/view-modal.js.map +0 -1
- package/build-module/navigation/view.js +0 -59
- package/build-module/navigation/view.js.map +0 -1
- package/src/file/view.js +0 -9
- package/src/navigation/view-modal.js +0 -78
- package/src/navigation/view.js +0 -74
- /package/src/file/{utils.js → utils/index.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/embed/embed-placeholder.native.js"],"names":["EmbedPlaceholder","icon","isSelected","label","onPress","cannotEmbed","fallback","tryAgain","openEmbedLinkSettings","containerStyle","styles","embed__container","labelStyle","embed__label","descriptionStyle","embed__description","descriptionErrorStyle","actionStyle","embed__action","embedIconErrorStyle","cannotEmbedMenuPickerRef","errorPickerOptions","retry","id","value","onSelect","convertToLink","editLink","options","filter","Boolean","onPickerSelect","selectedItem","find","item","resolveOnPressEvent","current","presentPicker","noticeOutline","fill"],"mappings":";;;;;;;;;AAYA;;AATA;;AAKA;;AACA;;AACA;;AACA;;AAMA;;AACA;;AAlBA;AACA;AACA;;AAGA;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","openEmbedLinkSettings","containerStyle","styles","embed__container","labelStyle","embed__label","descriptionStyle","embed__description","descriptionErrorStyle","actionStyle","embed__action","embedIconErrorStyle","cannotEmbedMenuPickerRef","errorPickerOptions","retry","id","value","onSelect","convertToLink","editLink","options","filter","Boolean","onPickerSelect","selectedItem","find","item","resolveOnPressEvent","current","presentPicker","noticeOutline","fill"],"mappings":";;;;;;;;;AAYA;;AATA;;AAKA;;AACA;;AACA;;AACA;;AAMA;;AACA;;AAlBA;AACA;AACA;;AAGA;AACA;AACA;;AAOA;AACA;AACA;AAIA,MAAMA,gBAAgB,GAAG,CAAE;AAC1BC,EAAAA,IAD0B;AAE1BC,EAAAA,UAF0B;AAG1BC,EAAAA,KAH0B;AAI1BC,EAAAA,OAJ0B;AAK1BC,EAAAA,WAL0B;AAM1BC,EAAAA,QAN0B;AAO1BC,EAAAA,QAP0B;AAQ1BC,EAAAA;AAR0B,CAAF,KASlB;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;AAENpB,MAAAA,KAAK,EAAE,cAAI,OAAJ,CAFD;AAGNqB,MAAAA,KAAK,EAAE,aAHD;AAINC,MAAAA,QAAQ,EAAElB;AAJJ,KADmB;AAO1BmB,IAAAA,aAAa,EAAE;AACdH,MAAAA,EAAE,EAAE,qBADU;AAEdpB,MAAAA,KAAK,EAAE,cAAI,iBAAJ,CAFO;AAGdqB,MAAAA,KAAK,EAAE,qBAHO;AAIdC,MAA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AAK,EAAG,CACPL,gBADO,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,EAAGQ,OAHX;AAIC,IAAA,QAAQ,EAAGG,cAJZ;AAKC,IAAA,gBAAgB,MALjB;AAMC,IAAA,SAAS;AANV,IAjBD,CADY,GA4BZ,qDACC,4BAAC,sBAAD;AAAW,IAAA,IAAI,EAAG9B;AAAlB,IADD,EAEC,4BAAC,iBAAD;AAAM,IAAA,KAAK,EAAGW;AAAd,KAA6BT,KAA7B,CAFD,EAGC,4BAAC,iBAAD;AAAM,IAAA,KAAK,EAAGc;AAAd,KACG,cAAI,UAAJ,CADH,CAHD,CA7BF,CAVD,CADD,CADD;AAqDA,CA1HD;;eA4HejB,gB","sourcesContent":["/**\n * External dependencies\n */\nimport { View, Text, TouchableWithoutFeedback } from 'react-native';\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\topenEmbedLinkSettings,\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\teditLink: {\n\t\t\tid: 'editLinkOption',\n\t\t\tlabel: __( 'Edit link' ),\n\t\t\tvalue: 'editLinkOption',\n\t\t\tonSelect: openEmbedLinkSettings,\n\t\t},\n\t};\n\n\tconst options = [\n\t\tcannotEmbed && errorPickerOptions.retry,\n\t\tcannotEmbed && errorPickerOptions.convertToLink,\n\t\tcannotEmbed && errorPickerOptions.editLink,\n\t].filter( Boolean );\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"]}
|
|
@@ -42,23 +42,22 @@ var _styles = _interopRequireDefault(require("./styles.scss"));
|
|
|
42
42
|
/**
|
|
43
43
|
* Internal dependencies
|
|
44
44
|
*/
|
|
45
|
-
const EmbedPreview =
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
} = _ref;
|
|
45
|
+
const EmbedPreview = ({
|
|
46
|
+
align,
|
|
47
|
+
className,
|
|
48
|
+
clientId,
|
|
49
|
+
icon,
|
|
50
|
+
insertBlocksAfter,
|
|
51
|
+
isSelected,
|
|
52
|
+
label,
|
|
53
|
+
onFocus,
|
|
54
|
+
preview,
|
|
55
|
+
previewable,
|
|
56
|
+
isProviderPreviewable,
|
|
57
|
+
type,
|
|
58
|
+
url,
|
|
59
|
+
isDefaultEmbedInfo
|
|
60
|
+
}) => {
|
|
62
61
|
const [isCaptionSelected, setIsCaptionSelected] = (0, _element.useState)(false);
|
|
63
62
|
const {
|
|
64
63
|
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":";;;;;;;;;AAeA;;AAZA;;AACA;;AAKA;;AACA;;AAIA;;AAEA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAzBA;AACA;AACA;;AAIA;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":";;;;;;;;;AAeA;;AAZA;;AACA;;AAKA;;AACA;;AAIA;;AAEA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAzBA;AACA;AACA;;AAIA;AACA;AACA;;AAWA;AACA;AACA;AAMA,MAAMA,YAAY,GAAG,CAAE;AACtBC,EAAAA,KADsB;AAEtBC,EAAAA,SAFsB;AAGtBC,EAAAA,QAHsB;AAItBC,EAAAA,IAJsB;AAKtBC,EAAAA,iBALsB;AAMtBC,EAAAA,UANsB;AAOtBC,EAAAA,KAPsB;AAQtBC,EAAAA,OARsB;AAStBC,EAAAA,OATsB;AAUtBC,EAAAA,WAVsB;AAWtBC,EAAAA,qBAXsB;AAYtBC,EAAAA,IAZsB;AAatBC,EAAAA,GAbsB;AActBC,EAAAA;AAdsB,CAAF,KAed;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,EA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utFeedback } from 'react-native';\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 ! 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/index.js
CHANGED
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;AAOe,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;AAOe,SAASA,IAAT,CAAe;AAAEC,EAAAA;AAAF,CAAf,EAAgC;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;AACC,IAAA,SAAS,EAAG,oDAAmC,SAAnC,CADb;AAEC,IAAA,OAAO,EAAC,YAFT;AAGC,IAAA,KAAK,EAAGA;AAHT,IALF,CADD;AAcA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames/dedupe';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tRichText,\n\tuseBlockProps,\n\t__experimentalGetElementClassName,\n} 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\n\t\t\t\t\tclassName={ __experimentalGetElementClassName( 'caption' ) }\n\t\t\t\t\ttagName=\"figcaption\"\n\t\t\t\t\tvalue={ caption }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</figure>\n\t);\n}\n"]}
|
|
@@ -16,7 +16,7 @@ var _blocks = require("@wordpress/blocks");
|
|
|
16
16
|
*/
|
|
17
17
|
const metadata = {
|
|
18
18
|
$schema: "https://schemas.wp.org/trunk/block.json",
|
|
19
|
-
apiVersion:
|
|
19
|
+
apiVersion: 3,
|
|
20
20
|
name: "core/embed",
|
|
21
21
|
title: "Embed",
|
|
22
22
|
category: "embed",
|
|
@@ -75,11 +75,7 @@ const {
|
|
|
75
75
|
const transforms = {
|
|
76
76
|
from: [{
|
|
77
77
|
type: 'raw',
|
|
78
|
-
isMatch: node =>
|
|
79
|
-
var _node$textContent, _node$textContent$mat;
|
|
80
|
-
|
|
81
|
-
return node.nodeName === 'P' && /^\s*(https?:\/\/\S+)\s*$/i.test(node.textContent) && ((_node$textContent = node.textContent) === null || _node$textContent === void 0 ? void 0 : (_node$textContent$mat = _node$textContent.match(/https/gi)) === null || _node$textContent$mat === void 0 ? void 0 : _node$textContent$mat.length) === 1;
|
|
82
|
-
},
|
|
78
|
+
isMatch: node => node.nodeName === 'P' && /^\s*(https?:\/\/\S+)\s*$/i.test(node.textContent) && node.textContent?.match(/https/gi)?.length === 1,
|
|
83
79
|
transform: node => {
|
|
84
80
|
return (0, _blocks.createBlock)(EMBED_BLOCK, {
|
|
85
81
|
url: node.textContent.trim()
|
|
@@ -89,20 +85,16 @@ const transforms = {
|
|
|
89
85
|
to: [{
|
|
90
86
|
type: 'block',
|
|
91
87
|
blocks: ['core/paragraph'],
|
|
92
|
-
isMatch:
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
let {
|
|
100
|
-
url,
|
|
101
|
-
caption
|
|
102
|
-
} = _ref2;
|
|
88
|
+
isMatch: ({
|
|
89
|
+
url
|
|
90
|
+
}) => !!url,
|
|
91
|
+
transform: ({
|
|
92
|
+
url,
|
|
93
|
+
caption
|
|
94
|
+
}) => {
|
|
103
95
|
let value = `<a href="${url}">${url}</a>`;
|
|
104
96
|
|
|
105
|
-
if (caption
|
|
97
|
+
if (caption?.trim()) {
|
|
106
98
|
value += `<br />${caption}`;
|
|
107
99
|
}
|
|
108
100
|
|
|
@@ -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
|
|
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,IACRA,IAAI,CAACC,QAAL,KAAkB,GAAlB,IACA,4BAA4BC,IAA5B,CAAkCF,IAAI,CAACG,WAAvC,CADA,IAEAH,IAAI,CAACG,WAAL,EAAkBC,KAAlB,CAAyB,SAAzB,GAAsCC,MAAtC,KAAiD,CALnD;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,CAAE;AAAEQ,MAAAA;AAAF,KAAF,KAAe,CAAC,CAAEA,GAH5B;AAICD,IAAAA,SAAS,EAAE,CAAE;AAAEC,MAAAA,GAAF;AAAOI,MAAAA;AAAP,KAAF,KAAwB;AAClC,UAAIC,KAAK,GAAI,YAAYL,GAAK,KAAKA,GAAK,MAAxC;;AACA,UAAKI,OAAO,EAAEH,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
|
@@ -40,7 +40,7 @@ var _blocks = require("@wordpress/blocks");
|
|
|
40
40
|
*/
|
|
41
41
|
const metadata = {
|
|
42
42
|
$schema: "https://schemas.wp.org/trunk/block.json",
|
|
43
|
-
apiVersion:
|
|
43
|
+
apiVersion: 3,
|
|
44
44
|
name: "core/embed",
|
|
45
45
|
title: "Embed",
|
|
46
46
|
category: "embed",
|
|
@@ -101,16 +101,9 @@ const {
|
|
|
101
101
|
* @return {WPBlockVariation} The embed block's information
|
|
102
102
|
*/
|
|
103
103
|
|
|
104
|
-
const getEmbedInfoByProvider = provider => {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
return (_getBlockVariations = (0, _blocks.getBlockVariations)(DEFAULT_EMBED_BLOCK)) === null || _getBlockVariations === void 0 ? void 0 : _getBlockVariations.find(_ref => {
|
|
108
|
-
let {
|
|
109
|
-
name
|
|
110
|
-
} = _ref;
|
|
111
|
-
return name === provider;
|
|
112
|
-
});
|
|
113
|
-
};
|
|
104
|
+
const getEmbedInfoByProvider = provider => (0, _blocks.getBlockVariations)(DEFAULT_EMBED_BLOCK)?.find(({
|
|
105
|
+
name
|
|
106
|
+
}) => name === provider);
|
|
114
107
|
/**
|
|
115
108
|
* Returns true if any of the regular expressions match the URL.
|
|
116
109
|
*
|
|
@@ -122,10 +115,7 @@ const getEmbedInfoByProvider = provider => {
|
|
|
122
115
|
|
|
123
116
|
exports.getEmbedInfoByProvider = getEmbedInfoByProvider;
|
|
124
117
|
|
|
125
|
-
const matchesPatterns =
|
|
126
|
-
let patterns = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
127
|
-
return patterns.some(pattern => url.match(pattern));
|
|
128
|
-
};
|
|
118
|
+
const matchesPatterns = (url, patterns = []) => patterns.some(pattern => url.match(pattern));
|
|
129
119
|
/**
|
|
130
120
|
* Finds the block variation that should be used for the URL,
|
|
131
121
|
* based on the provided URL and the variation's patterns.
|
|
@@ -137,16 +127,9 @@ const matchesPatterns = function (url) {
|
|
|
137
127
|
|
|
138
128
|
exports.matchesPatterns = matchesPatterns;
|
|
139
129
|
|
|
140
|
-
const findMoreSuitableBlock = url => {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
return (_getBlockVariations2 = (0, _blocks.getBlockVariations)(DEFAULT_EMBED_BLOCK)) === null || _getBlockVariations2 === void 0 ? void 0 : _getBlockVariations2.find(_ref2 => {
|
|
144
|
-
let {
|
|
145
|
-
patterns
|
|
146
|
-
} = _ref2;
|
|
147
|
-
return matchesPatterns(url, patterns);
|
|
148
|
-
});
|
|
149
|
-
};
|
|
130
|
+
const findMoreSuitableBlock = url => (0, _blocks.getBlockVariations)(DEFAULT_EMBED_BLOCK)?.find(({
|
|
131
|
+
patterns
|
|
132
|
+
}) => matchesPatterns(url, patterns));
|
|
150
133
|
|
|
151
134
|
exports.findMoreSuitableBlock = findMoreSuitableBlock;
|
|
152
135
|
|
|
@@ -184,10 +167,7 @@ const getPhotoHtml = photo => {
|
|
|
184
167
|
|
|
185
168
|
exports.getPhotoHtml = getPhotoHtml;
|
|
186
169
|
|
|
187
|
-
const createUpgradedEmbedBlock =
|
|
188
|
-
var _getBlockVariations3;
|
|
189
|
-
|
|
190
|
-
let attributesFromPreview = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
170
|
+
const createUpgradedEmbedBlock = (props, attributesFromPreview = {}) => {
|
|
191
171
|
const {
|
|
192
172
|
preview,
|
|
193
173
|
attributes = {}
|
|
@@ -215,12 +195,9 @@ const createUpgradedEmbedBlock = function (props) {
|
|
|
215
195
|
});
|
|
216
196
|
}
|
|
217
197
|
|
|
218
|
-
const wpVariation = (
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
} = _ref3;
|
|
222
|
-
return name === 'wordpress';
|
|
223
|
-
}); // We can't match the URL for WordPress embeds, we have to check the HTML instead.
|
|
198
|
+
const wpVariation = (0, _blocks.getBlockVariations)(DEFAULT_EMBED_BLOCK)?.find(({
|
|
199
|
+
name
|
|
200
|
+
}) => name === 'wordpress'); // We can't match the URL for WordPress embeds, we have to check the HTML instead.
|
|
224
201
|
|
|
225
202
|
if (!wpVariation || !preview || !isFromWordPress(preview.html) || isCurrentBlockWP) {
|
|
226
203
|
return;
|
|
@@ -255,12 +232,9 @@ const hasAspectRatioClass = existingClassNames => {
|
|
|
255
232
|
return false;
|
|
256
233
|
}
|
|
257
234
|
|
|
258
|
-
return _constants.ASPECT_RATIOS.some(
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
} = _ref4;
|
|
262
|
-
return existingClassNames.includes(className);
|
|
263
|
-
});
|
|
235
|
+
return _constants.ASPECT_RATIOS.some(({
|
|
236
|
+
className
|
|
237
|
+
}) => existingClassNames.includes(className));
|
|
264
238
|
};
|
|
265
239
|
/**
|
|
266
240
|
* Removes all previously set aspect ratio related classes and return the rest
|
|
@@ -281,10 +255,9 @@ const removeAspectRatioClasses = existingClassNames => {
|
|
|
281
255
|
return existingClassNames;
|
|
282
256
|
}
|
|
283
257
|
|
|
284
|
-
const aspectRatioClassNames = _constants.ASPECT_RATIOS.reduce((accumulator,
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
} = _ref5;
|
|
258
|
+
const aspectRatioClassNames = _constants.ASPECT_RATIOS.reduce((accumulator, {
|
|
259
|
+
className
|
|
260
|
+
}) => {
|
|
288
261
|
accumulator[className] = false;
|
|
289
262
|
return accumulator;
|
|
290
263
|
}, {
|
|
@@ -305,9 +278,7 @@ const removeAspectRatioClasses = existingClassNames => {
|
|
|
305
278
|
|
|
306
279
|
exports.removeAspectRatioClasses = removeAspectRatioClasses;
|
|
307
280
|
|
|
308
|
-
function getClassNames(html, existingClassNames) {
|
|
309
|
-
let allowResponsive = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
310
|
-
|
|
281
|
+
function getClassNames(html, existingClassNames, allowResponsive = true) {
|
|
311
282
|
if (!allowResponsive) {
|
|
312
283
|
return removeAspectRatioClasses(existingClassNames);
|
|
313
284
|
}
|
|
@@ -369,9 +340,7 @@ function fallback(url, onReplace) {
|
|
|
369
340
|
*/
|
|
370
341
|
|
|
371
342
|
|
|
372
|
-
const getAttributesFromPreview = (0, _memize.default)(
|
|
373
|
-
let allowResponsive = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
|
|
374
|
-
|
|
343
|
+
const getAttributesFromPreview = (0, _memize.default)((preview, title, currentClassNames, isResponsive, allowResponsive = true) => {
|
|
375
344
|
if (!preview) {
|
|
376
345
|
return {};
|
|
377
346
|
}
|
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","hasAspectRatioClass","existingClassNames","ASPECT_RATIOS","className","removeAspectRatioClasses","aspectRatioClassNames","reduce","accumulator","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","getMergedAttributesWithPreview","currentAttributes"],"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,CAAxB;AAGP;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAME,qBAAqB,GAAKL,GAAF;AAAA;;AAAA,iCACpC,gCAAoBN,mBAApB,CADoC,yDACpC,qBAA2CI,IAA3C,CAAiD;AAAA,QAAE;AAAEG,MAAAA;AAAF,KAAF;AAAA,WAChDF,eAAe,CAAEC,GAAF,EAAOC,QAAP,CADiC;AAAA,GAAjD,CADoC;AAAA,CAA9B;;;;AAKA,MAAMK,eAAe,GAAKC,IAAF,IAC9BA,IAAI,IAAIA,IAAI,CAACC,QAAL,CA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qD,iBAFmC,EAGnCC,YAAY,IAAIxB,eAHmB,CAApC;AAMA,SAAOlB,UAAP;AACA,CA7CsC,CAAjC;AAgDP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AACO,MAAM8C,8BAA8B,GAAG,CAC7CC,iBAD6C,EAE7ChD,OAF6C,EAG7CJ,KAH6C,EAI7C+C,YAJ6C,KAKzC;AACJ,QAAM;AAAExB,IAAAA,eAAF;AAAmBN,IAAAA;AAAnB,MAAiCmC,iBAAvC;AAEA,SAAO,EACN,GAAGA,iBADG;AAEN,OAAGP,wBAAwB,CAC1BzC,OAD0B,EAE1BJ,KAF0B,EAG1BiB,SAH0B,EAI1B8B,YAJ0B,EAK1BxB,eAL0B;AAFrB,GAAP;AAUA,CAlBM","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// If full image url not found use thumbnail.\n\tconst imageUrl = photo.url || photo.thumbnail_url;\n\n\t// 100% width for the preview so it fits nicely into the document, some \"thumbnails\" are\n\t// actually the full size photo.\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 * Determine if the block already has an aspect ratio class applied.\n *\n * @param {string} existingClassNames Existing block classes.\n * @return {boolean} True or false if the classnames contain an aspect ratio class.\n */\nexport const hasAspectRatioClass = ( existingClassNames ) => {\n\tif ( ! existingClassNames ) {\n\t\treturn false;\n\t}\n\treturn ASPECT_RATIOS.some( ( { className } ) =>\n\t\texistingClassNames.includes( className )\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\t// Aspect ratio classes are removed when the embed URL is updated.\n\t\t// If the embed already has an aspect ratio class, that means the URL has not changed.\n\t\t// Which also means no need to regenerate it with getClassNames.\n\t\tif ( hasAspectRatioClass( currentClassNames ) ) {\n\t\t\treturn attributes;\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\n/**\n * Returns the attributes derived from the preview, merged with the current attributes.\n *\n * @param {Object} currentAttributes The current attributes of the block.\n * @param {Object} preview The preview data.\n * @param {string} title The block's title, e.g. Twitter.\n * @param {boolean} isResponsive Boolean indicating if the block supports responsive content.\n * @return {Object} Merged attributes.\n */\nexport const getMergedAttributesWithPreview = (\n\tcurrentAttributes,\n\tpreview,\n\ttitle,\n\tisResponsive\n) => {\n\tconst { allowResponsive, className } = currentAttributes;\n\n\treturn {\n\t\t...currentAttributes,\n\t\t...getAttributesFromPreview(\n\t\t\tpreview,\n\t\t\ttitle,\n\t\t\tclassName,\n\t\t\tisResponsive,\n\t\t\tallowResponsive\n\t\t),\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","hasAspectRatioClass","existingClassNames","ASPECT_RATIOS","className","removeAspectRatioClasses","aspectRatioClassNames","reduce","accumulator","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","getMergedAttributesWithPreview","currentAttributes"],"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,IACrC,gCAAoBH,mBAApB,GAA2CI,IAA3C,CACC,CAAE;AAAEL,EAAAA;AAAF,CAAF,KAAgBA,IAAI,KAAKI,QAD1B,CADM;AAKP;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAME,eAAe,GAAG,CAAEC,GAAF,EAAOC,QAAQ,GAAG,EAAlB,KAC9BA,QAAQ,CAACC,IAAT,CAAiBC,OAAF,IAAeH,GAAG,CAACI,KAAJ,CAAWD,OAAX,CAA9B,CADM;AAGP;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAME,qBAAqB,GAAKL,GAAF,IACpC,gCAAoBN,mBAApB,GAA2CI,IAA3C,CAAiD,CAAE;AAAEG,EAAAA;AAAF,CAAF,KAChDF,eAAe,CAAEC,GAAF,EAAOC,QAAP,CADhB,CADM;;;;AAKA,MAAMK,eAAe,GAAKC,IAAF,IAC9BA,IAAI,IAAIA,IAAI,CAACC,QAAL,CAAe,6BAAf,CADF;;;;AAGA,MAAMC,YAAY,GAAKC,KAAF,IAAa;AACxC;AACA,QAAMC,QAAQ,GAAGD,KAAK,CAACV,GAAN,IAAaU,KAAK,CAACE,aAApC,CAFwC,CAIxC;AACA;;AACA,QAAMC,YAAY,GACjB,uCACC;AAAK,IAAA,GAAG,EA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AiCmC,iBAAvC;AAEA,SAAO,EACN,GAAGA,iBADG;AAEN,OAAGP,wBAAwB,CAC1BzC,OAD0B,EAE1BJ,KAF0B,EAG1BiB,SAH0B,EAI1B8B,YAJ0B,EAK1BxB,eAL0B;AAFrB,GAAP;AAUA,CAlBM","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// If full image url not found use thumbnail.\n\tconst imageUrl = photo.url || photo.thumbnail_url;\n\n\t// 100% width for the preview so it fits nicely into the document, some \"thumbnails\" are\n\t// actually the full size photo.\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 * Determine if the block already has an aspect ratio class applied.\n *\n * @param {string} existingClassNames Existing block classes.\n * @return {boolean} True or false if the classnames contain an aspect ratio class.\n */\nexport const hasAspectRatioClass = ( existingClassNames ) => {\n\tif ( ! existingClassNames ) {\n\t\treturn false;\n\t}\n\treturn ASPECT_RATIOS.some( ( { className } ) =>\n\t\texistingClassNames.includes( className )\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\t// Aspect ratio classes are removed when the embed URL is updated.\n\t\t// If the embed already has an aspect ratio class, that means the URL has not changed.\n\t\t// Which also means no need to regenerate it with getClassNames.\n\t\tif ( hasAspectRatioClass( currentClassNames ) ) {\n\t\t\treturn attributes;\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\n/**\n * Returns the attributes derived from the preview, merged with the current attributes.\n *\n * @param {Object} currentAttributes The current attributes of the block.\n * @param {Object} preview The preview data.\n * @param {string} title The block's title, e.g. Twitter.\n * @param {boolean} isResponsive Boolean indicating if the block supports responsive content.\n * @return {Object} Merged attributes.\n */\nexport const getMergedAttributesWithPreview = (\n\tcurrentAttributes,\n\tpreview,\n\ttitle,\n\tisResponsive\n) => {\n\tconst { allowResponsive, className } = currentAttributes;\n\n\treturn {\n\t\t...currentAttributes,\n\t\t...getAttributesFromPreview(\n\t\t\tpreview,\n\t\t\ttitle,\n\t\t\tclassName,\n\t\t\tisResponsive,\n\t\t\tallowResponsive\n\t\t),\n\t};\n};\n"]}
|
|
@@ -25,21 +25,19 @@ const attributeMap = {
|
|
|
25
25
|
marginwidth: 'marginWidth'
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
function WpEmbedPreview(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
} = _ref;
|
|
28
|
+
function WpEmbedPreview({
|
|
29
|
+
html
|
|
30
|
+
}) {
|
|
32
31
|
const ref = (0, _element.useRef)();
|
|
33
32
|
const props = (0, _element.useMemo)(() => {
|
|
34
33
|
const doc = new window.DOMParser().parseFromString(html, 'text/html');
|
|
35
34
|
const iframe = doc.querySelector('iframe');
|
|
36
35
|
const iframeProps = {};
|
|
37
36
|
if (!iframe) return iframeProps;
|
|
38
|
-
Array.from(iframe.attributes).forEach(
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
} = _ref2;
|
|
37
|
+
Array.from(iframe.attributes).forEach(({
|
|
38
|
+
name,
|
|
39
|
+
value
|
|
40
|
+
}) => {
|
|
43
41
|
if (name === 'style') return;
|
|
44
42
|
iframeProps[attributeMap[name] || name] = value;
|
|
45
43
|
});
|
|
@@ -68,15 +66,13 @@ function WpEmbedPreview(_ref) {
|
|
|
68
66
|
* @param {MessageEvent} event Message event.
|
|
69
67
|
*/
|
|
70
68
|
|
|
71
|
-
function resizeWPembeds(
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
} = _ref3;
|
|
79
|
-
|
|
69
|
+
function resizeWPembeds({
|
|
70
|
+
data: {
|
|
71
|
+
secret,
|
|
72
|
+
message,
|
|
73
|
+
value
|
|
74
|
+
} = {}
|
|
75
|
+
}) {
|
|
80
76
|
if (message !== 'height' || secret !== props['data-secret']) {
|
|
81
77
|
return;
|
|
82
78
|
}
|
|
@@ -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,E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,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,11 +63,10 @@ const observeAndResizeJS = `
|
|
|
63
63
|
window.addEventListener( 'message', sendResize );
|
|
64
64
|
} )();`;
|
|
65
65
|
|
|
66
|
-
function WpEmbedPreview(
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
} = _ref;
|
|
66
|
+
function WpEmbedPreview({
|
|
67
|
+
html,
|
|
68
|
+
...rest
|
|
69
|
+
}) {
|
|
71
70
|
const wpEmbedHtml = (0, _element.useMemo)(() => {
|
|
72
71
|
const doc = new window.DOMParser().parseFromString(html, 'text/html');
|
|
73
72
|
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,CAAyB;AAAEC,EAAAA,IAAF;AAAQ,KAAGC;AAAX,CAAzB,EAA6C;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"]}
|
package/build/file/deprecated.js
CHANGED
|
@@ -76,10 +76,9 @@ const v3 = {
|
|
|
76
76
|
align: true
|
|
77
77
|
},
|
|
78
78
|
|
|
79
|
-
save(
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
} = _ref;
|
|
79
|
+
save({
|
|
80
|
+
attributes
|
|
81
|
+
}) {
|
|
83
82
|
const {
|
|
84
83
|
href,
|
|
85
84
|
fileId,
|
|
@@ -180,10 +179,9 @@ const v2 = {
|
|
|
180
179
|
align: true
|
|
181
180
|
},
|
|
182
181
|
|
|
183
|
-
save(
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
} = _ref2;
|
|
182
|
+
save({
|
|
183
|
+
attributes
|
|
184
|
+
}) {
|
|
187
185
|
const {
|
|
188
186
|
href,
|
|
189
187
|
fileId,
|
|
@@ -277,10 +275,9 @@ const v1 = {
|
|
|
277
275
|
align: true
|
|
278
276
|
},
|
|
279
277
|
|
|
280
|
-
save(
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
} = _ref3;
|
|
278
|
+
save({
|
|
279
|
+
attributes
|
|
280
|
+
}) {
|
|
284
281
|
const {
|
|
285
282
|
href,
|
|
286
283
|
fileName,
|