@wordpress/block-library 8.19.2 → 8.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/archives/edit.js +8 -8
- package/build/archives/edit.js.map +1 -1
- package/build/audio/deprecated.js +3 -3
- package/build/audio/deprecated.js.map +1 -1
- package/build/audio/edit.js +17 -16
- package/build/audio/edit.js.map +1 -1
- package/build/audio/edit.native.js +15 -14
- package/build/audio/edit.native.js.map +1 -1
- package/build/audio/save.js +4 -4
- package/build/audio/save.js.map +1 -1
- package/build/avatar/edit.js +19 -19
- package/build/avatar/edit.js.map +1 -1
- package/build/avatar/user-control.js +3 -2
- package/build/avatar/user-control.js.map +1 -1
- package/build/block/edit-title.native.js +8 -8
- package/build/block/edit-title.native.js.map +1 -1
- package/build/block/edit.js +11 -10
- package/build/block/edit.js.map +1 -1
- package/build/block/edit.native.js +17 -16
- package/build/block/edit.native.js.map +1 -1
- package/build/button/color-background.native.js +3 -3
- package/build/button/color-background.native.js.map +1 -1
- package/build/button/constants.js +13 -0
- package/build/button/constants.js.map +1 -0
- package/build/button/deprecated.js +19 -19
- package/build/button/deprecated.js.map +1 -1
- package/build/button/edit.js +42 -44
- package/build/button/edit.js.map +1 -1
- package/build/button/edit.native.js +15 -14
- package/build/button/edit.native.js.map +1 -1
- package/build/button/get-updated-link-attributes.js +54 -0
- package/build/button/get-updated-link-attributes.js.map +1 -0
- package/build/button/save.js +3 -3
- package/build/button/save.js.map +1 -1
- package/build/buttons/deprecated.js +4 -4
- package/build/buttons/deprecated.js.map +1 -1
- package/build/buttons/edit.js +2 -2
- package/build/buttons/edit.js.map +1 -1
- package/build/buttons/edit.native.js +7 -6
- package/build/buttons/edit.native.js.map +1 -1
- package/build/buttons/save.js +2 -2
- package/build/buttons/save.js.map +1 -1
- package/build/calendar/edit.js +6 -6
- package/build/calendar/edit.js.map +1 -1
- package/build/categories/edit.js +17 -17
- package/build/categories/edit.js.map +1 -1
- package/build/code/edit.js +3 -3
- package/build/code/edit.js.map +1 -1
- package/build/code/edit.native.js +2 -2
- package/build/code/edit.native.js.map +1 -1
- package/build/code/save.js +3 -3
- package/build/code/save.js.map +1 -1
- package/build/column/column-preview.native.js +4 -4
- package/build/column/column-preview.native.js.map +1 -1
- package/build/column/deprecated.js +3 -3
- package/build/column/deprecated.js.map +1 -1
- package/build/column/edit.js +5 -5
- package/build/column/edit.js.map +1 -1
- package/build/column/edit.native.js +14 -13
- package/build/column/edit.native.js.map +1 -1
- package/build/column/save.js +2 -2
- package/build/column/save.js.map +1 -1
- package/build/columns/deprecated.js +7 -7
- package/build/columns/deprecated.js.map +1 -1
- package/build/columns/edit.js +9 -9
- package/build/columns/edit.js.map +1 -1
- package/build/columns/edit.native.js +15 -14
- package/build/columns/edit.native.js.map +1 -1
- package/build/columns/save.js +2 -2
- package/build/columns/save.js.map +1 -1
- package/build/columns/variations.js +13 -13
- package/build/columns/variations.js.map +1 -1
- package/build/comment-author-avatar/edit.js +6 -6
- package/build/comment-author-avatar/edit.js.map +1 -1
- package/build/comment-author-name/edit.js +8 -8
- package/build/comment-author-name/edit.js.map +1 -1
- package/build/comment-content/edit.js +8 -7
- package/build/comment-content/edit.js.map +1 -1
- package/build/comment-date/edit.js +8 -8
- package/build/comment-date/edit.js.map +1 -1
- package/build/comment-edit-link/edit.js +7 -7
- package/build/comment-edit-link/edit.js.map +1 -1
- package/build/comment-reply-link/edit.js +5 -5
- package/build/comment-reply-link/edit.js.map +1 -1
- package/build/comment-template/edit.js +14 -13
- package/build/comment-template/edit.js.map +1 -1
- package/build/comment-template/save.js +2 -2
- package/build/comment-template/save.js.map +1 -1
- package/build/comments/deprecated.js +3 -3
- package/build/comments/deprecated.js.map +1 -1
- package/build/comments/edit/comments-inspector-controls.js +3 -3
- package/build/comments/edit/comments-inspector-controls.js.map +1 -1
- package/build/comments/edit/comments-legacy.js +7 -7
- package/build/comments/edit/comments-legacy.js.map +1 -1
- package/build/comments/edit/index.js +4 -4
- package/build/comments/edit/index.js.map +1 -1
- package/build/comments/edit/placeholder.js +34 -33
- package/build/comments/edit/placeholder.js.map +1 -1
- package/build/comments/save.js +2 -2
- package/build/comments/save.js.map +1 -1
- package/build/comments-pagination/comments-pagination-arrow-controls.js +5 -5
- package/build/comments-pagination/comments-pagination-arrow-controls.js.map +1 -1
- package/build/comments-pagination/edit.js +5 -5
- package/build/comments-pagination/edit.js.map +1 -1
- package/build/comments-pagination/save.js +2 -2
- package/build/comments-pagination/save.js.map +1 -1
- package/build/comments-pagination-next/edit.js +4 -4
- package/build/comments-pagination-next/edit.js.map +1 -1
- package/build/comments-pagination-numbers/edit.js +11 -11
- package/build/comments-pagination-numbers/edit.js.map +1 -1
- package/build/comments-pagination-previous/edit.js +4 -4
- package/build/comments-pagination-previous/edit.js.map +1 -1
- package/build/comments-title/edit.js +9 -8
- package/build/comments-title/edit.js.map +1 -1
- package/build/cover/controls.native.js +17 -16
- package/build/cover/controls.native.js.map +1 -1
- package/build/cover/deprecated.js +239 -62
- package/build/cover/deprecated.js.map +1 -1
- package/build/cover/edit/block-controls.js +6 -5
- package/build/cover/edit/block-controls.js.map +1 -1
- package/build/cover/edit/color-utils.js +135 -0
- package/build/cover/edit/color-utils.js.map +1 -0
- package/build/cover/edit/cover-placeholder.js +3 -3
- package/build/cover/edit/cover-placeholder.js.map +1 -1
- package/build/cover/edit/index.js +106 -52
- package/build/cover/edit/index.js.map +1 -1
- package/build/cover/edit/inspector-controls.js +20 -19
- package/build/cover/edit/inspector-controls.js.map +1 -1
- package/build/cover/edit/resizable-cover-popover.js +3 -2
- package/build/cover/edit/resizable-cover-popover.js.map +1 -1
- package/build/cover/edit.native.js +44 -37
- package/build/cover/edit.native.js.map +1 -1
- package/build/cover/focal-point-settings-button.native.js +4 -4
- package/build/cover/focal-point-settings-button.native.js.map +1 -1
- package/build/cover/index.js +3 -0
- package/build/cover/index.js.map +1 -1
- package/build/cover/overlay-color-settings.native.js +3 -2
- package/build/cover/overlay-color-settings.native.js.map +1 -1
- package/build/cover/save.js +7 -7
- package/build/cover/save.js.map +1 -1
- package/build/cover/shared.js +33 -133
- package/build/cover/shared.js.map +1 -1
- package/build/details/edit.js +6 -6
- package/build/details/edit.js.map +1 -1
- package/build/details/save.js +4 -4
- package/build/details/save.js.map +1 -1
- package/build/embed/deprecated.js +6 -6
- package/build/embed/deprecated.js.map +1 -1
- package/build/embed/edit.js +26 -8
- package/build/embed/edit.js.map +1 -1
- package/build/embed/edit.native.js +27 -9
- package/build/embed/edit.native.js.map +1 -1
- package/build/embed/embed-controls.js +4 -4
- package/build/embed/embed-controls.js.map +1 -1
- package/build/embed/embed-controls.native.js +5 -5
- package/build/embed/embed-controls.native.js.map +1 -1
- package/build/embed/embed-link-settings.native.js +4 -3
- package/build/embed/embed-link-settings.native.js.map +1 -1
- package/build/embed/embed-loading.js +3 -3
- package/build/embed/embed-loading.js.map +1 -1
- package/build/embed/embed-loading.native.js +3 -3
- package/build/embed/embed-loading.native.js.map +1 -1
- package/build/embed/embed-no-preview.native.js +21 -20
- package/build/embed/embed-no-preview.native.js.map +1 -1
- package/build/embed/embed-placeholder.js +12 -12
- package/build/embed/embed-placeholder.js.map +1 -1
- package/build/embed/embed-placeholder.native.js +13 -12
- package/build/embed/embed-placeholder.native.js.map +1 -1
- package/build/embed/embed-preview.js +13 -12
- package/build/embed/embed-preview.js.map +1 -1
- package/build/embed/embed-preview.native.js +8 -7
- package/build/embed/embed-preview.native.js.map +1 -1
- package/build/embed/icons.js +49 -49
- package/build/embed/icons.js.map +1 -1
- package/build/embed/save.js +4 -4
- package/build/embed/save.js.map +1 -1
- package/build/embed/util.js +4 -3
- package/build/embed/util.js.map +1 -1
- package/build/embed/wp-embed-preview.js +5 -4
- package/build/embed/wp-embed-preview.js.map +1 -1
- package/build/embed/wp-embed-preview.native.js +2 -1
- package/build/embed/wp-embed-preview.native.js.map +1 -1
- package/build/file/deprecated.js +19 -19
- package/build/file/deprecated.js.map +1 -1
- package/build/file/edit.js +18 -17
- package/build/file/edit.js.map +1 -1
- package/build/file/edit.native.js +23 -22
- package/build/file/edit.native.js.map +1 -1
- package/build/file/inspector.js +8 -8
- package/build/file/inspector.js.map +1 -1
- package/build/file/save.js +7 -7
- package/build/file/save.js.map +1 -1
- package/build/footnotes/edit.js +11 -11
- package/build/footnotes/edit.js.map +1 -1
- package/build/footnotes/format.js +2 -2
- package/build/footnotes/format.js.map +1 -1
- package/build/footnotes/index.js +1 -1
- package/build/freeform/convert-to-blocks-button.js +2 -2
- package/build/freeform/convert-to-blocks-button.js.map +1 -1
- package/build/freeform/edit.js +8 -7
- package/build/freeform/edit.js.map +1 -1
- package/build/freeform/edit.native.js +2 -2
- package/build/freeform/edit.native.js.map +1 -1
- package/build/freeform/modal.js +11 -10
- package/build/freeform/modal.js.map +1 -1
- package/build/freeform/save.js +2 -1
- package/build/freeform/save.js.map +1 -1
- package/build/gallery/deprecated.js +38 -38
- package/build/gallery/deprecated.js.map +1 -1
- package/build/gallery/edit-wrapper.js +3 -3
- package/build/gallery/edit-wrapper.js.map +1 -1
- package/build/gallery/edit.js +18 -17
- package/build/gallery/edit.js.map +1 -1
- package/build/gallery/gallery.js +5 -4
- package/build/gallery/gallery.js.map +1 -1
- package/build/gallery/gallery.native.js +6 -5
- package/build/gallery/gallery.native.js.map +1 -1
- package/build/gallery/gap-styles.js +4 -3
- package/build/gallery/gap-styles.js.map +1 -1
- package/build/gallery/save.js +3 -3
- package/build/gallery/save.js.map +1 -1
- package/build/gallery/shared-icon.js +2 -2
- package/build/gallery/shared-icon.js.map +1 -1
- package/build/gallery/v1/edit.js +10 -9
- package/build/gallery/v1/edit.js.map +1 -1
- package/build/gallery/v1/gallery-button.native.js +3 -3
- package/build/gallery/v1/gallery-button.native.js.map +1 -1
- package/build/gallery/v1/gallery-image.js +14 -13
- package/build/gallery/v1/gallery-image.js.map +1 -1
- package/build/gallery/v1/gallery-image.native.js +15 -14
- package/build/gallery/v1/gallery-image.native.js.map +1 -1
- package/build/gallery/v1/gallery.js +8 -8
- package/build/gallery/v1/gallery.js.map +1 -1
- package/build/gallery/v1/gallery.native.js +7 -6
- package/build/gallery/v1/gallery.native.js.map +1 -1
- package/build/gallery/v1/save.js +8 -8
- package/build/gallery/v1/save.js.map +1 -1
- package/build/gallery/v1/tiles.native.js +4 -3
- package/build/gallery/v1/tiles.native.js.map +1 -1
- package/build/group/deprecated.js +13 -13
- package/build/group/deprecated.js.map +1 -1
- package/build/group/edit.js +8 -8
- package/build/group/edit.js.map +1 -1
- package/build/group/edit.native.js +7 -6
- package/build/group/edit.native.js.map +1 -1
- package/build/group/placeholder.js +16 -15
- package/build/group/placeholder.js.map +1 -1
- package/build/group/save.js +2 -2
- package/build/group/save.js.map +1 -1
- package/build/heading/deprecated.js +8 -8
- package/build/heading/deprecated.js.map +1 -1
- package/build/heading/edit.js +6 -5
- package/build/heading/edit.js.map +1 -1
- package/build/heading/save.js +3 -3
- package/build/heading/save.js.map +1 -1
- package/build/home-link/edit.js +5 -4
- package/build/home-link/edit.js.map +1 -1
- package/build/home-link/save.js +2 -2
- package/build/home-link/save.js.map +1 -1
- package/build/html/edit.js +16 -9
- package/build/html/edit.js.map +1 -1
- package/build/html/preview.js +7 -3
- package/build/html/preview.js.map +1 -1
- package/build/html/save.js +2 -1
- package/build/html/save.js.map +1 -1
- package/build/image/deprecated.js +35 -35
- package/build/image/deprecated.js.map +1 -1
- package/build/image/edit.js +10 -9
- package/build/image/edit.js.map +1 -1
- package/build/image/edit.native.js +30 -29
- package/build/image/edit.native.js.map +1 -1
- package/build/image/image.js +32 -31
- package/build/image/image.js.map +1 -1
- package/build/image/save.js +5 -5
- package/build/image/save.js.map +1 -1
- package/build/image/view.js +128 -27
- package/build/image/view.js.map +1 -1
- package/build/latest-comments/edit.js +8 -8
- package/build/latest-comments/edit.js.map +1 -1
- package/build/latest-posts/edit.js +34 -33
- package/build/latest-posts/edit.js.map +1 -1
- package/build/latest-posts/edit.native.js +19 -18
- package/build/latest-posts/edit.native.js.map +1 -1
- package/build/list/deprecated.js +7 -7
- package/build/list/deprecated.js.map +1 -1
- package/build/list/edit.js +9 -8
- package/build/list/edit.js.map +1 -1
- package/build/list/ordered-list-settings.js +5 -5
- package/build/list/ordered-list-settings.js.map +1 -1
- package/build/list/save.js +3 -3
- package/build/list/save.js.map +1 -1
- package/build/list/tag-name.js +2 -1
- package/build/list/tag-name.js.map +1 -1
- package/build/list/tag-name.native.js +2 -1
- package/build/list/tag-name.native.js.map +1 -1
- package/build/list-item/edit.js +7 -7
- package/build/list-item/edit.js.map +1 -1
- package/build/list-item/edit.native.js +11 -10
- package/build/list-item/edit.native.js.map +1 -1
- package/build/list-item/icons.native.js +7 -7
- package/build/list-item/icons.native.js.map +1 -1
- package/build/list-item/list-style-type.native.js +8 -7
- package/build/list-item/list-style-type.native.js.map +1 -1
- package/build/list-item/save.js +4 -4
- package/build/list-item/save.js.map +1 -1
- package/build/loginout/edit.js +6 -6
- package/build/loginout/edit.js.map +1 -1
- package/build/loginout/index.js +8 -0
- package/build/loginout/index.js.map +1 -1
- package/build/media-text/deprecated.js +44 -44
- package/build/media-text/deprecated.js.map +1 -1
- package/build/media-text/edit.js +21 -20
- package/build/media-text/edit.js.map +1 -1
- package/build/media-text/edit.native.js +12 -11
- package/build/media-text/edit.native.js.map +1 -1
- package/build/media-text/icon-retry.native.js +4 -4
- package/build/media-text/icon-retry.native.js.map +1 -1
- package/build/media-text/media-container.js +13 -12
- package/build/media-text/media-container.js.map +1 -1
- package/build/media-text/media-container.native.js +20 -19
- package/build/media-text/media-container.native.js.map +1 -1
- package/build/media-text/save.js +10 -10
- package/build/media-text/save.js.map +1 -1
- package/build/missing/edit.js +6 -5
- package/build/missing/edit.js.map +1 -1
- package/build/missing/edit.native.js +17 -16
- package/build/missing/edit.native.js.map +1 -1
- package/build/missing/save.js +2 -1
- package/build/missing/save.js.map +1 -1
- package/build/more/edit.js +4 -4
- package/build/more/edit.js.map +1 -1
- package/build/more/edit.native.js +3 -2
- package/build/more/edit.native.js.map +1 -1
- package/build/more/save.js +2 -1
- package/build/more/save.js.map +1 -1
- package/build/navigation/deprecated.js +7 -7
- package/build/navigation/deprecated.js.map +1 -1
- package/build/navigation/edit/accessible-description.js +2 -2
- package/build/navigation/edit/accessible-description.js.map +1 -1
- package/build/navigation/edit/accessible-menu-description.js +2 -2
- package/build/navigation/edit/accessible-menu-description.js.map +1 -1
- package/build/navigation/edit/deleted-navigation-warning.js +8 -5
- package/build/navigation/edit/deleted-navigation-warning.js.map +1 -1
- package/build/navigation/edit/index.js +47 -45
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/inner-blocks.js +6 -4
- package/build/navigation/edit/inner-blocks.js.map +1 -1
- package/build/navigation/edit/leaf-more-menu.js +7 -7
- package/build/navigation/edit/leaf-more-menu.js.map +1 -1
- package/build/navigation/edit/manage-menus-button.js +2 -2
- package/build/navigation/edit/manage-menus-button.js.map +1 -1
- package/build/navigation/edit/menu-inspector-controls.js +13 -13
- package/build/navigation/edit/menu-inspector-controls.js.map +1 -1
- package/build/navigation/edit/navigation-menu-delete-control.js +7 -6
- package/build/navigation/edit/navigation-menu-delete-control.js.map +1 -1
- package/build/navigation/edit/navigation-menu-name-control.js +2 -2
- package/build/navigation/edit/navigation-menu-name-control.js.map +1 -1
- package/build/navigation/edit/navigation-menu-selector.js +9 -8
- package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build/navigation/edit/overlay-menu-icon.js +5 -5
- package/build/navigation/edit/overlay-menu-icon.js.map +1 -1
- package/build/navigation/edit/overlay-menu-preview.js +7 -7
- package/build/navigation/edit/overlay-menu-preview.js.map +1 -1
- package/build/navigation/edit/placeholder/index.js +10 -9
- package/build/navigation/edit/placeholder/index.js.map +1 -1
- package/build/navigation/edit/placeholder/placeholder-preview.js +4 -4
- package/build/navigation/edit/placeholder/placeholder-preview.js.map +1 -1
- package/build/navigation/edit/responsive-wrapper.js +9 -9
- package/build/navigation/edit/responsive-wrapper.js.map +1 -1
- package/build/navigation/edit/unsaved-inner-blocks.js +3 -2
- package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build/navigation/save.js +2 -2
- package/build/navigation/save.js.map +1 -1
- package/build/navigation-link/edit.js +21 -20
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-link/icons.js +3 -3
- package/build/navigation-link/icons.js.map +1 -1
- package/build/navigation-link/index.js +2 -2
- package/build/navigation-link/index.js.map +1 -1
- package/build/navigation-link/link-ui.js +20 -11
- package/build/navigation-link/link-ui.js.map +1 -1
- package/build/navigation-link/save.js +2 -2
- package/build/navigation-link/save.js.map +1 -1
- package/build/navigation-submenu/edit.js +16 -15
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/navigation-submenu/icons.js +3 -3
- package/build/navigation-submenu/icons.js.map +1 -1
- package/build/navigation-submenu/save.js +2 -2
- package/build/navigation-submenu/save.js.map +1 -1
- package/build/nextpage/edit.js +3 -3
- package/build/nextpage/edit.js.map +1 -1
- package/build/nextpage/edit.native.js +3 -3
- package/build/nextpage/edit.native.js.map +1 -1
- package/build/nextpage/save.js +2 -1
- package/build/nextpage/save.js.map +1 -1
- package/build/page-list/convert-to-links-modal.js +6 -6
- package/build/page-list/convert-to-links-modal.js.map +1 -1
- package/build/page-list/edit.js +21 -20
- package/build/page-list/edit.js.map +1 -1
- package/build/page-list-item/edit.js +7 -7
- package/build/page-list-item/edit.js.map +1 -1
- package/build/paragraph/deprecated.js +9 -8
- package/build/paragraph/deprecated.js.map +1 -1
- package/build/paragraph/edit.js +10 -10
- package/build/paragraph/edit.js.map +1 -1
- package/build/paragraph/edit.native.js +5 -4
- package/build/paragraph/edit.native.js.map +1 -1
- package/build/paragraph/save.js +3 -3
- package/build/paragraph/save.js.map +1 -1
- package/build/pattern/edit.js +3 -2
- package/build/pattern/edit.js.map +1 -1
- package/build/post-author/edit.js +19 -19
- package/build/post-author/edit.js.map +1 -1
- package/build/post-author-biography/edit.js +4 -4
- package/build/post-author-biography/edit.js.map +1 -1
- package/build/post-author-name/edit.js +8 -8
- package/build/post-author-name/edit.js.map +1 -1
- package/build/post-comment/edit.js +7 -6
- package/build/post-comment/edit.js.map +1 -1
- package/build/post-comment/save.js +2 -2
- package/build/post-comment/save.js.map +1 -1
- package/build/post-comments-count/edit.js +6 -5
- package/build/post-comments-count/edit.js.map +1 -1
- package/build/post-comments-form/edit.js +6 -6
- package/build/post-comments-form/edit.js.map +1 -1
- package/build/post-comments-form/form.js +13 -13
- package/build/post-comments-form/form.js.map +1 -1
- package/build/post-comments-link/edit.js +7 -6
- package/build/post-comments-link/edit.js.map +1 -1
- package/build/post-content/edit.js +14 -14
- package/build/post-content/edit.js.map +1 -1
- package/build/post-date/edit.js +14 -13
- package/build/post-date/edit.js.map +1 -1
- package/build/post-excerpt/edit.js +16 -15
- package/build/post-excerpt/edit.js.map +1 -1
- package/build/post-featured-image/dimension-controls.js +15 -15
- package/build/post-featured-image/dimension-controls.js.map +1 -1
- package/build/post-featured-image/edit.js +17 -17
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/post-featured-image/overlay.js +6 -6
- package/build/post-featured-image/overlay.js.map +1 -1
- package/build/post-navigation-link/edit.js +13 -13
- package/build/post-navigation-link/edit.js.map +1 -1
- package/build/post-template/edit.js +11 -10
- package/build/post-template/edit.js.map +1 -1
- package/build/post-template/save.js +2 -2
- package/build/post-template/save.js.map +1 -1
- package/build/post-terms/edit.js +9 -9
- package/build/post-terms/edit.js.map +1 -1
- package/build/post-time-to-read/edit.js +5 -4
- package/build/post-time-to-read/edit.js.map +1 -1
- package/build/post-time-to-read/icon.js +3 -3
- package/build/post-time-to-read/icon.js.map +1 -1
- package/build/post-title/edit.js +15 -15
- package/build/post-title/edit.js.map +1 -1
- package/build/preformatted/edit.js +2 -2
- package/build/preformatted/edit.js.map +1 -1
- package/build/preformatted/edit.native.js +3 -3
- package/build/preformatted/edit.native.js.map +1 -1
- package/build/preformatted/save.js +3 -3
- package/build/preformatted/save.js.map +1 -1
- package/build/pullquote/blockquote.native.js +3 -2
- package/build/pullquote/blockquote.native.js.map +1 -1
- package/build/pullquote/deprecated.js +21 -21
- package/build/pullquote/deprecated.js.map +1 -1
- package/build/pullquote/edit.js +7 -6
- package/build/pullquote/edit.js.map +1 -1
- package/build/pullquote/edit.native.js +7 -7
- package/build/pullquote/edit.native.js.map +1 -1
- package/build/pullquote/figure.native.js +2 -2
- package/build/pullquote/figure.native.js.map +1 -1
- package/build/pullquote/save.js +4 -4
- package/build/pullquote/save.js.map +1 -1
- package/build/query/deprecated.js +6 -6
- package/build/query/deprecated.js.map +1 -1
- package/build/query/edit/enhanced-pagination-modal.js +6 -5
- package/build/query/edit/enhanced-pagination-modal.js.map +1 -1
- package/build/query/edit/index.js +4 -3
- package/build/query/edit/index.js.map +1 -1
- package/build/query/edit/inspector-controls/author-control.js +2 -2
- package/build/query/edit/inspector-controls/author-control.js.map +1 -1
- package/build/query/edit/inspector-controls/create-new-post-link.js +4 -3
- package/build/query/edit/inspector-controls/create-new-post-link.js.map +1 -1
- package/build/query/edit/inspector-controls/enhanced-pagination-control.js +3 -3
- package/build/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
- package/build/query/edit/inspector-controls/index.js +20 -19
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/edit/inspector-controls/order-control.js +2 -2
- package/build/query/edit/inspector-controls/order-control.js.map +1 -1
- package/build/query/edit/inspector-controls/parent-control.js +3 -2
- package/build/query/edit/inspector-controls/parent-control.js.map +1 -1
- package/build/query/edit/inspector-controls/sticky-control.js +2 -2
- package/build/query/edit/inspector-controls/sticky-control.js.map +1 -1
- package/build/query/edit/inspector-controls/taxonomy-controls.js +6 -5
- package/build/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
- package/build/query/edit/pattern-selection-modal.js +7 -6
- package/build/query/edit/pattern-selection-modal.js.map +1 -1
- package/build/query/edit/query-content.js +8 -7
- package/build/query/edit/query-content.js.map +1 -1
- package/build/query/edit/query-placeholder.js +9 -8
- package/build/query/edit/query-placeholder.js.map +1 -1
- package/build/query/edit/query-toolbar.js +9 -9
- package/build/query/edit/query-toolbar.js.map +1 -1
- package/build/query/icons.js +9 -9
- package/build/query/icons.js.map +1 -1
- package/build/query/save.js +2 -2
- package/build/query/save.js.map +1 -1
- package/build/query/view.js +5 -5
- package/build/query/view.js.map +1 -1
- package/build/query-no-results/edit.js +2 -2
- package/build/query-no-results/edit.js.map +1 -1
- package/build/query-no-results/save.js +2 -2
- package/build/query-no-results/save.js.map +1 -1
- package/build/query-pagination/deprecated.js +3 -3
- package/build/query-pagination/deprecated.js.map +1 -1
- package/build/query-pagination/edit.js +6 -5
- package/build/query-pagination/edit.js.map +1 -1
- package/build/query-pagination/query-pagination-arrow-controls.js +5 -5
- package/build/query-pagination/query-pagination-arrow-controls.js.map +1 -1
- package/build/query-pagination/query-pagination-label-control.js +2 -2
- package/build/query-pagination/query-pagination-label-control.js.map +1 -1
- package/build/query-pagination/save.js +2 -2
- package/build/query-pagination/save.js.map +1 -1
- package/build/query-pagination-next/edit.js +4 -4
- package/build/query-pagination-next/edit.js.map +1 -1
- package/build/query-pagination-numbers/edit.js +6 -6
- package/build/query-pagination-numbers/edit.js.map +1 -1
- package/build/query-pagination-previous/edit.js +4 -4
- package/build/query-pagination-previous/edit.js.map +1 -1
- package/build/query-title/edit.js +12 -12
- package/build/query-title/edit.js.map +1 -1
- package/build/quote/deprecated.js +13 -13
- package/build/quote/deprecated.js.map +1 -1
- package/build/quote/edit.js +6 -5
- package/build/quote/edit.js.map +1 -1
- package/build/quote/save.js +3 -3
- package/build/quote/save.js.map +1 -1
- package/build/read-more/edit.js +4 -4
- package/build/read-more/edit.js.map +1 -1
- package/build/rss/edit.js +20 -18
- package/build/rss/edit.js.map +1 -1
- package/build/search/edit.js +30 -27
- package/build/search/edit.js.map +1 -1
- package/build/search/edit.native.js +16 -15
- package/build/search/edit.native.js.map +1 -1
- package/build/search/icons.js +17 -17
- package/build/search/icons.js.map +1 -1
- package/build/separator/deprecated.js +2 -2
- package/build/separator/deprecated.js.map +1 -1
- package/build/separator/edit.js +2 -2
- package/build/separator/edit.js.map +1 -1
- package/build/separator/save.js +2 -2
- package/build/separator/save.js.map +1 -1
- package/build/shortcode/edit.js +5 -5
- package/build/shortcode/edit.js.map +1 -1
- package/build/shortcode/edit.native.js +5 -4
- package/build/shortcode/edit.native.js.map +1 -1
- package/build/shortcode/save.js +2 -1
- package/build/shortcode/save.js.map +1 -1
- package/build/site-logo/edit.js +41 -40
- package/build/site-logo/edit.js.map +1 -1
- package/build/site-tagline/edit.js +5 -5
- package/build/site-tagline/edit.js.map +1 -1
- package/build/site-tagline/icon.js +3 -3
- package/build/site-tagline/icon.js.map +1 -1
- package/build/site-title/edit/index.js +12 -12
- package/build/site-title/edit/index.js.map +1 -1
- package/build/social-link/edit.js +15 -14
- package/build/social-link/edit.js.map +1 -1
- package/build/social-link/edit.native.js +8 -7
- package/build/social-link/edit.native.js.map +1 -1
- package/build/social-link/icons/amazon.js +3 -3
- package/build/social-link/icons/amazon.js.map +1 -1
- package/build/social-link/icons/bandcamp.js +3 -3
- package/build/social-link/icons/bandcamp.js.map +1 -1
- package/build/social-link/icons/behance.js +3 -3
- package/build/social-link/icons/behance.js.map +1 -1
- package/build/social-link/icons/chain.js +3 -3
- package/build/social-link/icons/chain.js.map +1 -1
- package/build/social-link/icons/codepen.js +3 -3
- package/build/social-link/icons/codepen.js.map +1 -1
- package/build/social-link/icons/deviantart.js +3 -3
- package/build/social-link/icons/deviantart.js.map +1 -1
- package/build/social-link/icons/dribbble.js +3 -3
- package/build/social-link/icons/dribbble.js.map +1 -1
- package/build/social-link/icons/dropbox.js +3 -3
- package/build/social-link/icons/dropbox.js.map +1 -1
- package/build/social-link/icons/etsy.js +3 -3
- package/build/social-link/icons/etsy.js.map +1 -1
- package/build/social-link/icons/facebook.js +3 -3
- package/build/social-link/icons/facebook.js.map +1 -1
- package/build/social-link/icons/feed.js +3 -3
- package/build/social-link/icons/feed.js.map +1 -1
- package/build/social-link/icons/fivehundredpx.js +3 -3
- package/build/social-link/icons/fivehundredpx.js.map +1 -1
- package/build/social-link/icons/flickr.js +3 -3
- package/build/social-link/icons/flickr.js.map +1 -1
- package/build/social-link/icons/foursquare.js +3 -3
- package/build/social-link/icons/foursquare.js.map +1 -1
- package/build/social-link/icons/github.js +3 -3
- package/build/social-link/icons/github.js.map +1 -1
- package/build/social-link/icons/goodreads.js +3 -3
- package/build/social-link/icons/goodreads.js.map +1 -1
- package/build/social-link/icons/google.js +3 -3
- package/build/social-link/icons/google.js.map +1 -1
- package/build/social-link/icons/instagram.js +3 -3
- package/build/social-link/icons/instagram.js.map +1 -1
- package/build/social-link/icons/lastfm.js +3 -3
- package/build/social-link/icons/lastfm.js.map +1 -1
- package/build/social-link/icons/linkedin.js +3 -3
- package/build/social-link/icons/linkedin.js.map +1 -1
- package/build/social-link/icons/mail.js +3 -3
- package/build/social-link/icons/mail.js.map +1 -1
- package/build/social-link/icons/mastodon.js +3 -3
- package/build/social-link/icons/mastodon.js.map +1 -1
- package/build/social-link/icons/medium.js +3 -3
- package/build/social-link/icons/medium.js.map +1 -1
- package/build/social-link/icons/meetup.js +3 -3
- package/build/social-link/icons/meetup.js.map +1 -1
- package/build/social-link/icons/patreon.js +4 -4
- package/build/social-link/icons/patreon.js.map +1 -1
- package/build/social-link/icons/pinterest.js +3 -3
- package/build/social-link/icons/pinterest.js.map +1 -1
- package/build/social-link/icons/pocket.js +3 -3
- package/build/social-link/icons/pocket.js.map +1 -1
- package/build/social-link/icons/reddit.js +3 -3
- package/build/social-link/icons/reddit.js.map +1 -1
- package/build/social-link/icons/skype.js +3 -3
- package/build/social-link/icons/skype.js.map +1 -1
- package/build/social-link/icons/snapchat.js +3 -3
- package/build/social-link/icons/snapchat.js.map +1 -1
- package/build/social-link/icons/soundcloud.js +3 -3
- package/build/social-link/icons/soundcloud.js.map +1 -1
- package/build/social-link/icons/spotify.js +3 -3
- package/build/social-link/icons/spotify.js.map +1 -1
- package/build/social-link/icons/telegram.js +3 -3
- package/build/social-link/icons/telegram.js.map +1 -1
- package/build/social-link/icons/threads.js +3 -3
- package/build/social-link/icons/threads.js.map +1 -1
- package/build/social-link/icons/tiktok.js +3 -3
- package/build/social-link/icons/tiktok.js.map +1 -1
- package/build/social-link/icons/tumblr.js +3 -3
- package/build/social-link/icons/tumblr.js.map +1 -1
- package/build/social-link/icons/twitch.js +3 -3
- package/build/social-link/icons/twitch.js.map +1 -1
- package/build/social-link/icons/twitter.js +3 -3
- package/build/social-link/icons/twitter.js.map +1 -1
- package/build/social-link/icons/vimeo.js +3 -3
- package/build/social-link/icons/vimeo.js.map +1 -1
- package/build/social-link/icons/vk.js +3 -3
- package/build/social-link/icons/vk.js.map +1 -1
- package/build/social-link/icons/whatsapp.js +3 -3
- package/build/social-link/icons/whatsapp.js.map +1 -1
- package/build/social-link/icons/wordpress.js +3 -3
- package/build/social-link/icons/wordpress.js.map +1 -1
- package/build/social-link/icons/x.js +3 -3
- package/build/social-link/icons/x.js.map +1 -1
- package/build/social-link/icons/yelp.js +3 -3
- package/build/social-link/icons/yelp.js.map +1 -1
- package/build/social-link/icons/youtube.js +3 -3
- package/build/social-link/icons/youtube.js.map +1 -1
- package/build/social-link/social-list.js +1 -1
- package/build/social-link/social-list.js.map +1 -1
- package/build/social-links/deprecated.js +3 -3
- package/build/social-links/deprecated.js.map +1 -1
- package/build/social-links/edit.js +19 -18
- package/build/social-links/edit.js.map +1 -1
- package/build/social-links/edit.native.js +7 -6
- package/build/social-links/edit.native.js.map +1 -1
- package/build/social-links/save.js +2 -2
- package/build/social-links/save.js.map +1 -1
- package/build/spacer/controls.js +8 -8
- package/build/spacer/controls.js.map +1 -1
- package/build/spacer/controls.native.js +4 -3
- package/build/spacer/controls.native.js.map +1 -1
- package/build/spacer/deprecated.js +2 -2
- package/build/spacer/deprecated.js.map +1 -1
- package/build/spacer/edit.js +7 -6
- package/build/spacer/edit.js.map +1 -1
- package/build/spacer/edit.native.js +4 -3
- package/build/spacer/edit.native.js.map +1 -1
- package/build/spacer/save.js +2 -2
- package/build/spacer/save.js.map +1 -1
- package/build/spacer/save.native.js +2 -2
- package/build/spacer/save.native.js.map +1 -1
- package/build/table/deprecated.js +26 -26
- package/build/table/deprecated.js.map +1 -1
- package/build/table/edit.js +24 -23
- package/build/table/edit.js.map +1 -1
- package/build/table/save.js +10 -10
- package/build/table/save.js.map +1 -1
- package/build/table-of-contents/edit.js +35 -14
- package/build/table-of-contents/edit.js.map +1 -1
- package/build/table-of-contents/icon.js +3 -3
- package/build/table-of-contents/icon.js.map +1 -1
- package/build/table-of-contents/list.js +16 -10
- package/build/table-of-contents/list.js.map +1 -1
- package/build/table-of-contents/save.js +3 -3
- package/build/table-of-contents/save.js.map +1 -1
- package/build/tag-cloud/edit.js +11 -11
- package/build/tag-cloud/edit.js.map +1 -1
- package/build/template-part/edit/advanced-controls.js +6 -6
- package/build/template-part/edit/advanced-controls.js.map +1 -1
- package/build/template-part/edit/import-controls.js +10 -8
- package/build/template-part/edit/import-controls.js.map +1 -1
- package/build/template-part/edit/index.js +17 -16
- package/build/template-part/edit/index.js.map +1 -1
- package/build/template-part/edit/inner-blocks.js +2 -2
- package/build/template-part/edit/inner-blocks.js.map +1 -1
- package/build/template-part/edit/placeholder.js +6 -5
- package/build/template-part/edit/placeholder.js.map +1 -1
- package/build/template-part/edit/selection-modal.js +8 -7
- package/build/template-part/edit/selection-modal.js.map +1 -1
- package/build/template-part/edit/title-modal.js +7 -6
- package/build/template-part/edit/title-modal.js.map +1 -1
- package/build/term-description/edit.js +6 -6
- package/build/term-description/edit.js.map +1 -1
- package/build/text-columns/edit.js +6 -6
- package/build/text-columns/edit.js.map +1 -1
- package/build/text-columns/save.js +4 -4
- package/build/text-columns/save.js.map +1 -1
- package/build/verse/deprecated.js +4 -4
- package/build/verse/deprecated.js.map +1 -1
- package/build/verse/edit.js +3 -3
- package/build/verse/edit.js.map +1 -1
- package/build/verse/save.js +3 -3
- package/build/verse/save.js.map +1 -1
- package/build/video/deprecated.js +5 -5
- package/build/video/deprecated.js.map +1 -1
- package/build/video/edit-common-settings.js +8 -7
- package/build/video/edit-common-settings.js.map +1 -1
- package/build/video/edit.js +23 -22
- package/build/video/edit.js.map +1 -1
- package/build/video/edit.native.js +21 -20
- package/build/video/edit.native.js.map +1 -1
- package/build/video/icon-retry.native.js +4 -4
- package/build/video/icon-retry.native.js.map +1 -1
- package/build/video/save.js +5 -5
- package/build/video/save.js.map +1 -1
- package/build/video/tracks-editor.js +25 -24
- package/build/video/tracks-editor.js.map +1 -1
- package/build/video/tracks.js +2 -2
- package/build/video/tracks.js.map +1 -1
- package/build-module/archives/edit.js +1 -1
- package/build-module/audio/deprecated.js +1 -1
- package/build-module/audio/edit.js +1 -1
- package/build-module/audio/edit.native.js +3 -3
- package/build-module/audio/edit.native.js.map +1 -1
- package/build-module/audio/save.js +1 -1
- package/build-module/avatar/edit.js +1 -1
- package/build-module/avatar/user-control.js +1 -1
- package/build-module/block/edit-title.native.js +1 -1
- package/build-module/block/edit.js +1 -1
- package/build-module/block/edit.native.js +1 -1
- package/build-module/button/color-background.native.js +1 -1
- package/build-module/button/constants.js +4 -0
- package/build-module/button/constants.js.map +1 -0
- package/build-module/button/deprecated.js +1 -1
- package/build-module/button/edit.js +27 -30
- package/build-module/button/edit.js.map +1 -1
- package/build-module/button/edit.native.js +1 -1
- package/build-module/button/get-updated-link-attributes.js +48 -0
- package/build-module/button/get-updated-link-attributes.js.map +1 -0
- package/build-module/button/save.js +1 -1
- package/build-module/buttons/deprecated.js +1 -1
- package/build-module/buttons/edit.js +1 -1
- package/build-module/buttons/edit.native.js +1 -1
- package/build-module/buttons/save.js +1 -1
- package/build-module/calendar/edit.js +1 -1
- package/build-module/categories/edit.js +1 -1
- package/build-module/code/edit.js +1 -1
- package/build-module/code/edit.native.js +1 -1
- package/build-module/code/save.js +1 -1
- package/build-module/column/column-preview.native.js +1 -1
- package/build-module/column/deprecated.js +1 -1
- package/build-module/column/edit.js +1 -1
- package/build-module/column/edit.native.js +1 -1
- package/build-module/column/save.js +1 -1
- package/build-module/columns/deprecated.js +1 -1
- package/build-module/columns/edit.js +1 -1
- package/build-module/columns/edit.native.js +1 -1
- package/build-module/columns/save.js +1 -1
- package/build-module/columns/variations.js +1 -1
- package/build-module/comment-author-avatar/edit.js +1 -1
- package/build-module/comment-author-name/edit.js +1 -1
- package/build-module/comment-content/edit.js +1 -1
- package/build-module/comment-date/edit.js +1 -1
- package/build-module/comment-edit-link/edit.js +1 -1
- package/build-module/comment-reply-link/edit.js +1 -1
- package/build-module/comment-template/edit.js +3 -3
- package/build-module/comment-template/edit.js.map +1 -1
- package/build-module/comment-template/save.js +1 -1
- package/build-module/comments/deprecated.js +1 -1
- package/build-module/comments/edit/comments-inspector-controls.js +1 -1
- package/build-module/comments/edit/comments-legacy.js +1 -1
- package/build-module/comments/edit/index.js +1 -1
- package/build-module/comments/edit/placeholder.js +1 -1
- package/build-module/comments/save.js +1 -1
- package/build-module/comments-pagination/comments-pagination-arrow-controls.js +1 -1
- package/build-module/comments-pagination/edit.js +1 -1
- package/build-module/comments-pagination/save.js +1 -1
- package/build-module/comments-pagination-next/edit.js +1 -1
- package/build-module/comments-pagination-numbers/edit.js +1 -1
- package/build-module/comments-pagination-previous/edit.js +1 -1
- package/build-module/comments-title/edit.js +1 -1
- package/build-module/cover/controls.native.js +1 -1
- package/build-module/cover/deprecated.js +190 -13
- package/build-module/cover/deprecated.js.map +1 -1
- package/build-module/cover/edit/block-controls.js +1 -1
- package/build-module/cover/edit/color-utils.js +121 -0
- package/build-module/cover/edit/color-utils.js.map +1 -0
- package/build-module/cover/edit/cover-placeholder.js +1 -1
- package/build-module/cover/edit/index.js +90 -37
- package/build-module/cover/edit/index.js.map +1 -1
- package/build-module/cover/edit/inspector-controls.js +2 -2
- package/build-module/cover/edit/inspector-controls.js.map +1 -1
- package/build-module/cover/edit/resizable-cover-popover.js +1 -1
- package/build-module/cover/edit.native.js +9 -3
- package/build-module/cover/edit.native.js.map +1 -1
- package/build-module/cover/focal-point-settings-button.native.js +1 -1
- package/build-module/cover/index.js +3 -0
- package/build-module/cover/index.js.map +1 -1
- package/build-module/cover/overlay-color-settings.native.js +1 -1
- package/build-module/cover/save.js +1 -1
- package/build-module/cover/shared.js +33 -132
- package/build-module/cover/shared.js.map +1 -1
- package/build-module/details/edit.js +1 -1
- package/build-module/details/save.js +1 -1
- package/build-module/embed/deprecated.js +1 -1
- package/build-module/embed/edit.js +18 -1
- package/build-module/embed/edit.js.map +1 -1
- package/build-module/embed/edit.native.js +18 -1
- package/build-module/embed/edit.native.js.map +1 -1
- package/build-module/embed/embed-controls.js +1 -1
- package/build-module/embed/embed-controls.native.js +1 -1
- package/build-module/embed/embed-link-settings.native.js +1 -1
- package/build-module/embed/embed-loading.js +1 -1
- package/build-module/embed/embed-loading.native.js +1 -1
- package/build-module/embed/embed-no-preview.native.js +1 -1
- package/build-module/embed/embed-placeholder.js +1 -1
- package/build-module/embed/embed-placeholder.native.js +1 -1
- package/build-module/embed/embed-preview.js +1 -1
- package/build-module/embed/embed-preview.native.js +1 -1
- package/build-module/embed/icons.js +1 -1
- package/build-module/embed/save.js +1 -1
- package/build-module/embed/util.js +1 -1
- package/build-module/embed/wp-embed-preview.js +2 -2
- package/build-module/embed/wp-embed-preview.js.map +1 -1
- package/build-module/embed/wp-embed-preview.native.js +1 -1
- package/build-module/file/deprecated.js +1 -1
- package/build-module/file/edit.js +1 -1
- package/build-module/file/edit.native.js +1 -1
- package/build-module/file/inspector.js +1 -1
- package/build-module/file/save.js +1 -1
- package/build-module/footnotes/edit.js +1 -1
- package/build-module/footnotes/format.js +1 -1
- package/build-module/footnotes/index.js +1 -1
- package/build-module/freeform/convert-to-blocks-button.js +1 -1
- package/build-module/freeform/edit.js +1 -1
- package/build-module/freeform/edit.native.js +1 -1
- package/build-module/freeform/modal.js +1 -1
- package/build-module/freeform/save.js +1 -1
- package/build-module/gallery/deprecated.js +1 -1
- package/build-module/gallery/edit-wrapper.js +1 -1
- package/build-module/gallery/edit.js +1 -1
- package/build-module/gallery/gallery.js +1 -1
- package/build-module/gallery/gallery.native.js +1 -1
- package/build-module/gallery/gap-styles.js +1 -1
- package/build-module/gallery/save.js +1 -1
- package/build-module/gallery/shared-icon.js +1 -1
- package/build-module/gallery/v1/edit.js +1 -1
- package/build-module/gallery/v1/gallery-button.native.js +1 -1
- package/build-module/gallery/v1/gallery-image.js +1 -1
- package/build-module/gallery/v1/gallery-image.native.js +1 -1
- package/build-module/gallery/v1/gallery.js +1 -1
- package/build-module/gallery/v1/gallery.native.js +1 -1
- package/build-module/gallery/v1/save.js +1 -1
- package/build-module/gallery/v1/tiles.native.js +1 -1
- package/build-module/group/deprecated.js +1 -1
- package/build-module/group/edit.js +1 -1
- package/build-module/group/edit.native.js +1 -1
- package/build-module/group/placeholder.js +1 -1
- package/build-module/group/save.js +1 -1
- package/build-module/heading/deprecated.js +1 -1
- package/build-module/heading/edit.js +1 -1
- package/build-module/heading/save.js +1 -1
- package/build-module/home-link/edit.js +1 -1
- package/build-module/home-link/save.js +1 -1
- package/build-module/html/edit.js +13 -7
- package/build-module/html/edit.js.map +1 -1
- package/build-module/html/preview.js +5 -2
- package/build-module/html/preview.js.map +1 -1
- package/build-module/html/save.js +1 -1
- package/build-module/image/deprecated.js +1 -1
- package/build-module/image/edit.js +1 -1
- package/build-module/image/edit.native.js +1 -1
- package/build-module/image/image.js +3 -3
- package/build-module/image/image.js.map +1 -1
- package/build-module/image/save.js +1 -1
- package/build-module/image/view.js +128 -27
- package/build-module/image/view.js.map +1 -1
- package/build-module/latest-comments/edit.js +1 -1
- package/build-module/latest-posts/edit.js +1 -1
- package/build-module/latest-posts/edit.native.js +1 -1
- package/build-module/list/deprecated.js +1 -1
- package/build-module/list/edit.js +1 -1
- package/build-module/list/ordered-list-settings.js +1 -1
- package/build-module/list/save.js +1 -1
- package/build-module/list/tag-name.js +1 -1
- package/build-module/list/tag-name.native.js +1 -1
- package/build-module/list-item/edit.js +1 -1
- package/build-module/list-item/edit.native.js +1 -1
- package/build-module/list-item/icons.native.js +1 -1
- package/build-module/list-item/list-style-type.native.js +1 -1
- package/build-module/list-item/save.js +1 -1
- package/build-module/loginout/edit.js +1 -1
- package/build-module/loginout/index.js +8 -0
- package/build-module/loginout/index.js.map +1 -1
- package/build-module/media-text/deprecated.js +1 -1
- package/build-module/media-text/edit.js +2 -2
- package/build-module/media-text/edit.js.map +1 -1
- package/build-module/media-text/edit.native.js +1 -1
- package/build-module/media-text/icon-retry.native.js +1 -1
- package/build-module/media-text/media-container.js +1 -1
- package/build-module/media-text/media-container.native.js +1 -1
- package/build-module/media-text/save.js +1 -1
- package/build-module/missing/edit.js +1 -1
- package/build-module/missing/edit.native.js +1 -1
- package/build-module/missing/save.js +1 -1
- package/build-module/more/edit.js +1 -1
- package/build-module/more/edit.native.js +1 -1
- package/build-module/more/save.js +1 -1
- package/build-module/navigation/deprecated.js +1 -1
- package/build-module/navigation/edit/accessible-description.js +1 -1
- package/build-module/navigation/edit/accessible-menu-description.js +1 -1
- package/build-module/navigation/edit/deleted-navigation-warning.js +8 -5
- package/build-module/navigation/edit/deleted-navigation-warning.js.map +1 -1
- package/build-module/navigation/edit/index.js +4 -3
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/inner-blocks.js +3 -2
- package/build-module/navigation/edit/inner-blocks.js.map +1 -1
- package/build-module/navigation/edit/leaf-more-menu.js +1 -1
- package/build-module/navigation/edit/manage-menus-button.js +1 -1
- package/build-module/navigation/edit/menu-inspector-controls.js +1 -1
- package/build-module/navigation/edit/navigation-menu-delete-control.js +1 -1
- package/build-module/navigation/edit/navigation-menu-name-control.js +1 -1
- package/build-module/navigation/edit/navigation-menu-selector.js +1 -1
- package/build-module/navigation/edit/overlay-menu-icon.js +1 -1
- package/build-module/navigation/edit/overlay-menu-preview.js +1 -1
- package/build-module/navigation/edit/placeholder/index.js +1 -1
- package/build-module/navigation/edit/placeholder/placeholder-preview.js +1 -1
- package/build-module/navigation/edit/responsive-wrapper.js +1 -1
- package/build-module/navigation/edit/unsaved-inner-blocks.js +1 -1
- package/build-module/navigation/save.js +1 -1
- package/build-module/navigation-link/edit.js +1 -1
- package/build-module/navigation-link/icons.js +1 -1
- package/build-module/navigation-link/index.js +1 -1
- package/build-module/navigation-link/link-ui.js +10 -2
- package/build-module/navigation-link/link-ui.js.map +1 -1
- package/build-module/navigation-link/save.js +1 -1
- package/build-module/navigation-submenu/edit.js +1 -1
- package/build-module/navigation-submenu/icons.js +1 -1
- package/build-module/navigation-submenu/save.js +1 -1
- package/build-module/nextpage/edit.js +1 -1
- package/build-module/nextpage/edit.native.js +1 -1
- package/build-module/nextpage/save.js +1 -1
- package/build-module/page-list/convert-to-links-modal.js +1 -1
- package/build-module/page-list/edit.js +1 -1
- package/build-module/page-list-item/edit.js +1 -1
- package/build-module/paragraph/deprecated.js +1 -1
- package/build-module/paragraph/edit.js +2 -2
- package/build-module/paragraph/edit.js.map +1 -1
- package/build-module/paragraph/edit.native.js +1 -1
- package/build-module/paragraph/save.js +1 -1
- package/build-module/pattern/edit.js +1 -1
- package/build-module/post-author/edit.js +1 -1
- package/build-module/post-author-biography/edit.js +1 -1
- package/build-module/post-author-name/edit.js +1 -1
- package/build-module/post-comment/edit.js +1 -1
- package/build-module/post-comment/save.js +1 -1
- package/build-module/post-comments-count/edit.js +1 -1
- package/build-module/post-comments-form/edit.js +1 -1
- package/build-module/post-comments-form/form.js +1 -1
- package/build-module/post-comments-link/edit.js +1 -1
- package/build-module/post-content/edit.js +1 -1
- package/build-module/post-date/edit.js +1 -1
- package/build-module/post-excerpt/edit.js +1 -1
- package/build-module/post-featured-image/dimension-controls.js +1 -1
- package/build-module/post-featured-image/edit.js +1 -1
- package/build-module/post-featured-image/overlay.js +1 -1
- package/build-module/post-navigation-link/edit.js +1 -1
- package/build-module/post-template/edit.js +1 -1
- package/build-module/post-template/save.js +1 -1
- package/build-module/post-terms/edit.js +1 -1
- package/build-module/post-time-to-read/edit.js +1 -1
- package/build-module/post-time-to-read/icon.js +1 -1
- package/build-module/post-title/edit.js +1 -1
- package/build-module/preformatted/edit.js +1 -1
- package/build-module/preformatted/edit.native.js +1 -1
- package/build-module/preformatted/save.js +1 -1
- package/build-module/pullquote/blockquote.native.js +1 -1
- package/build-module/pullquote/deprecated.js +1 -1
- package/build-module/pullquote/edit.js +1 -1
- package/build-module/pullquote/edit.native.js +1 -1
- package/build-module/pullquote/figure.native.js +1 -1
- package/build-module/pullquote/save.js +1 -1
- package/build-module/query/deprecated.js +1 -1
- package/build-module/query/edit/enhanced-pagination-modal.js +1 -1
- package/build-module/query/edit/index.js +1 -1
- package/build-module/query/edit/inspector-controls/author-control.js +1 -1
- package/build-module/query/edit/inspector-controls/create-new-post-link.js +1 -1
- package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js +1 -1
- package/build-module/query/edit/inspector-controls/index.js +1 -1
- package/build-module/query/edit/inspector-controls/order-control.js +1 -1
- package/build-module/query/edit/inspector-controls/parent-control.js +1 -1
- package/build-module/query/edit/inspector-controls/sticky-control.js +1 -1
- package/build-module/query/edit/inspector-controls/taxonomy-controls.js +1 -1
- package/build-module/query/edit/pattern-selection-modal.js +1 -1
- package/build-module/query/edit/query-content.js +1 -1
- package/build-module/query/edit/query-placeholder.js +1 -1
- package/build-module/query/edit/query-toolbar.js +1 -1
- package/build-module/query/icons.js +1 -1
- package/build-module/query/save.js +1 -1
- package/build-module/query/view.js +5 -5
- package/build-module/query/view.js.map +1 -1
- package/build-module/query-no-results/edit.js +1 -1
- package/build-module/query-no-results/save.js +1 -1
- package/build-module/query-pagination/deprecated.js +1 -1
- package/build-module/query-pagination/edit.js +1 -1
- package/build-module/query-pagination/query-pagination-arrow-controls.js +1 -1
- package/build-module/query-pagination/query-pagination-label-control.js +1 -1
- package/build-module/query-pagination/save.js +1 -1
- package/build-module/query-pagination-next/edit.js +1 -1
- package/build-module/query-pagination-numbers/edit.js +1 -1
- package/build-module/query-pagination-previous/edit.js +1 -1
- package/build-module/query-title/edit.js +1 -1
- package/build-module/quote/deprecated.js +1 -1
- package/build-module/quote/edit.js +1 -1
- package/build-module/quote/save.js +1 -1
- package/build-module/read-more/edit.js +1 -1
- package/build-module/rss/edit.js +3 -2
- package/build-module/rss/edit.js.map +1 -1
- package/build-module/search/edit.js +13 -11
- package/build-module/search/edit.js.map +1 -1
- package/build-module/search/edit.native.js +1 -1
- package/build-module/search/icons.js +1 -1
- package/build-module/separator/deprecated.js +1 -1
- package/build-module/separator/edit.js +1 -1
- package/build-module/separator/save.js +1 -1
- package/build-module/shortcode/edit.js +1 -1
- package/build-module/shortcode/edit.native.js +1 -1
- package/build-module/shortcode/save.js +1 -1
- package/build-module/site-logo/edit.js +1 -1
- package/build-module/site-tagline/edit.js +1 -1
- package/build-module/site-tagline/icon.js +1 -1
- package/build-module/site-title/edit/index.js +1 -1
- package/build-module/social-link/edit.js +1 -1
- package/build-module/social-link/edit.native.js +1 -1
- package/build-module/social-link/icons/amazon.js +1 -1
- package/build-module/social-link/icons/bandcamp.js +1 -1
- package/build-module/social-link/icons/behance.js +1 -1
- package/build-module/social-link/icons/chain.js +1 -1
- package/build-module/social-link/icons/codepen.js +1 -1
- package/build-module/social-link/icons/deviantart.js +1 -1
- package/build-module/social-link/icons/dribbble.js +1 -1
- package/build-module/social-link/icons/dropbox.js +1 -1
- package/build-module/social-link/icons/etsy.js +1 -1
- package/build-module/social-link/icons/facebook.js +1 -1
- package/build-module/social-link/icons/feed.js +1 -1
- package/build-module/social-link/icons/fivehundredpx.js +1 -1
- package/build-module/social-link/icons/flickr.js +1 -1
- package/build-module/social-link/icons/foursquare.js +1 -1
- package/build-module/social-link/icons/github.js +1 -1
- package/build-module/social-link/icons/goodreads.js +1 -1
- package/build-module/social-link/icons/google.js +1 -1
- package/build-module/social-link/icons/instagram.js +1 -1
- package/build-module/social-link/icons/lastfm.js +1 -1
- package/build-module/social-link/icons/linkedin.js +1 -1
- package/build-module/social-link/icons/mail.js +1 -1
- package/build-module/social-link/icons/mastodon.js +1 -1
- package/build-module/social-link/icons/medium.js +1 -1
- package/build-module/social-link/icons/meetup.js +1 -1
- package/build-module/social-link/icons/patreon.js +1 -1
- package/build-module/social-link/icons/pinterest.js +1 -1
- package/build-module/social-link/icons/pocket.js +1 -1
- package/build-module/social-link/icons/reddit.js +1 -1
- package/build-module/social-link/icons/skype.js +1 -1
- package/build-module/social-link/icons/snapchat.js +1 -1
- package/build-module/social-link/icons/soundcloud.js +1 -1
- package/build-module/social-link/icons/spotify.js +1 -1
- package/build-module/social-link/icons/telegram.js +1 -1
- package/build-module/social-link/icons/threads.js +1 -1
- package/build-module/social-link/icons/tiktok.js +1 -1
- package/build-module/social-link/icons/tumblr.js +1 -1
- package/build-module/social-link/icons/twitch.js +1 -1
- package/build-module/social-link/icons/twitter.js +1 -1
- package/build-module/social-link/icons/vimeo.js +1 -1
- package/build-module/social-link/icons/vk.js +1 -1
- package/build-module/social-link/icons/whatsapp.js +1 -1
- package/build-module/social-link/icons/wordpress.js +1 -1
- package/build-module/social-link/icons/x.js +1 -1
- package/build-module/social-link/icons/yelp.js +1 -1
- package/build-module/social-link/icons/youtube.js +1 -1
- package/build-module/social-link/social-list.js +1 -1
- package/build-module/social-link/social-list.js.map +1 -1
- package/build-module/social-links/deprecated.js +1 -1
- package/build-module/social-links/edit.js +1 -1
- package/build-module/social-links/edit.native.js +1 -1
- package/build-module/social-links/save.js +1 -1
- package/build-module/spacer/controls.js +1 -1
- package/build-module/spacer/controls.native.js +1 -1
- package/build-module/spacer/deprecated.js +1 -1
- package/build-module/spacer/edit.js +1 -1
- package/build-module/spacer/edit.native.js +1 -1
- package/build-module/spacer/save.js +1 -1
- package/build-module/spacer/save.native.js +1 -1
- package/build-module/table/deprecated.js +1 -1
- package/build-module/table/edit.js +1 -1
- package/build-module/table/save.js +1 -1
- package/build-module/table-of-contents/edit.js +26 -6
- package/build-module/table-of-contents/edit.js.map +1 -1
- package/build-module/table-of-contents/icon.js +1 -1
- package/build-module/table-of-contents/list.js +11 -5
- package/build-module/table-of-contents/list.js.map +1 -1
- package/build-module/table-of-contents/save.js +1 -1
- package/build-module/tag-cloud/edit.js +1 -1
- package/build-module/template-part/edit/advanced-controls.js +1 -1
- package/build-module/template-part/edit/import-controls.js +3 -2
- package/build-module/template-part/edit/import-controls.js.map +1 -1
- package/build-module/template-part/edit/index.js +1 -1
- package/build-module/template-part/edit/inner-blocks.js +1 -1
- package/build-module/template-part/edit/placeholder.js +1 -1
- package/build-module/template-part/edit/selection-modal.js +1 -1
- package/build-module/template-part/edit/title-modal.js +1 -1
- package/build-module/term-description/edit.js +1 -1
- package/build-module/text-columns/edit.js +1 -1
- package/build-module/text-columns/save.js +1 -1
- package/build-module/verse/deprecated.js +1 -1
- package/build-module/verse/edit.js +1 -1
- package/build-module/verse/save.js +1 -1
- package/build-module/video/deprecated.js +1 -1
- package/build-module/video/edit-common-settings.js +1 -1
- package/build-module/video/edit.js +1 -1
- package/build-module/video/edit.native.js +2 -2
- package/build-module/video/edit.native.js.map +1 -1
- package/build-module/video/icon-retry.native.js +1 -1
- package/build-module/video/save.js +1 -1
- package/build-module/video/tracks-editor.js +1 -1
- package/build-module/video/tracks.js +1 -1
- package/build-style/common-rtl.css +2 -4
- package/build-style/common.css +2 -4
- package/build-style/cover/style-rtl.css +2 -1
- package/build-style/cover/style.css +2 -1
- package/build-style/editor-rtl.css +1 -0
- package/build-style/editor.css +1 -0
- package/build-style/gallery/style-rtl.css +4 -2
- package/build-style/gallery/style.css +4 -2
- package/build-style/image/style-rtl.css +2 -6
- package/build-style/image/style.css +2 -6
- package/build-style/navigation-link/style-rtl.css +0 -1
- package/build-style/navigation-link/style.css +0 -1
- package/build-style/post-featured-image/style-rtl.css +3 -0
- package/build-style/post-featured-image/style.css +3 -0
- package/build-style/post-template/style-rtl.css +19 -0
- package/build-style/post-template/style.css +19 -0
- package/build-style/query-pagination/style-rtl.css +2 -4
- package/build-style/query-pagination/style.css +2 -4
- package/build-style/search/editor-rtl.css +1 -0
- package/build-style/search/editor.css +1 -0
- package/build-style/search/style-rtl.css +4 -2
- package/build-style/search/style.css +4 -2
- package/build-style/style-rtl.css +40 -20
- package/build-style/style.css +40 -20
- package/build-style/video/style-rtl.css +2 -1
- package/build-style/video/style.css +2 -1
- package/build-types/table-of-contents/list.d.ts +6 -4
- package/build-types/table-of-contents/list.d.ts.map +1 -1
- package/package.json +32 -32
- package/src/audio/edit.native.js +2 -2
- package/src/audio/test/edit.native.js +28 -14
- package/src/button/constants.js +3 -0
- package/src/button/edit.js +30 -29
- package/src/button/get-updated-link-attributes.js +54 -0
- package/src/button/test/get-updated-link-attributes.js +113 -0
- package/src/categories/index.php +2 -4
- package/src/comment-template/edit.js +2 -2
- package/src/cover/block.json +3 -0
- package/src/cover/deprecated.js +236 -12
- package/src/cover/edit/color-utils.js +122 -0
- package/src/cover/edit/index.js +132 -51
- package/src/cover/edit/inspector-controls.js +1 -1
- package/src/cover/edit.native.js +9 -2
- package/src/cover/shared.js +36 -129
- package/src/cover/test/__snapshots__/edit.native.js.snap +18 -10
- package/src/cover/test/__snapshots__/transforms.native.js.snap +4 -4
- package/src/cover/test/edit.js +1 -1
- package/src/cover/test/edit.native.js +38 -0
- package/src/embed/edit.js +15 -0
- package/src/embed/edit.native.js +15 -0
- package/src/embed/test/index.native.js +6 -1
- package/src/embed/wp-embed-preview.js +1 -1
- package/src/footnotes/block.json +1 -1
- package/src/footnotes/index.php +13 -179
- package/src/html/edit.js +26 -6
- package/src/html/preview.js +7 -1
- package/src/image/image.js +2 -2
- package/src/image/index.php +9 -2
- package/src/image/style.scss +2 -6
- package/src/image/view.js +137 -44
- package/src/loginout/block.json +8 -0
- package/src/media-text/edit.js +1 -1
- package/src/navigation/edit/deleted-navigation-warning.js +9 -4
- package/src/navigation/edit/index.js +26 -17
- package/src/navigation/edit/inner-blocks.js +1 -0
- package/src/navigation-link/link-ui.js +9 -1
- package/src/navigation-link/style.scss +0 -1
- package/src/paragraph/edit.js +1 -1
- package/src/post-featured-image/style.scss +4 -0
- package/src/post-template/style.scss +20 -0
- package/src/post-title/index.php +1 -1
- package/src/query/view.js +5 -5
- package/src/rss/edit.js +6 -2
- package/src/search/edit.js +16 -10
- package/src/search/editor.scss +1 -0
- package/src/search/style.scss +5 -1
- package/src/social-link/social-list.js +1 -1
- package/src/table-of-contents/edit.js +27 -3
- package/src/table-of-contents/list.tsx +27 -4
- package/src/template-part/edit/import-controls.js +2 -1
- package/src/video/edit.native.js +1 -1
- package/src/video/test/edit.native.js +29 -0
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -3,6 +3,66 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { store } from '@wordpress/interactivity';
|
|
5
5
|
const focusableSelectors = ['a[href]', 'area[href]', 'input:not([disabled]):not([type="hidden"]):not([aria-hidden])', 'select:not([disabled]):not([aria-hidden])', 'textarea:not([disabled]):not([aria-hidden])', 'button:not([disabled]):not([aria-hidden])', 'iframe', 'object', 'embed', '[contenteditable]', '[tabindex]:not([tabindex^="-"])'];
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
* Stores a context-bound scroll handler.
|
|
9
|
+
*
|
|
10
|
+
* This callback could be defined inline inside of the store
|
|
11
|
+
* object but it's created externally to avoid confusion about
|
|
12
|
+
* how its logic is called. This logic is not referenced directly
|
|
13
|
+
* by the directives in the markup because the scroll event we
|
|
14
|
+
* need to listen to is triggered on the window; so by defining it
|
|
15
|
+
* outside of the store, we signal that the behavior here is different.
|
|
16
|
+
* If we find a compelling reason to move it to the store, feel free.
|
|
17
|
+
*
|
|
18
|
+
* @type {Function}
|
|
19
|
+
*/
|
|
20
|
+
let scrollCallback;
|
|
21
|
+
|
|
22
|
+
/*
|
|
23
|
+
* Tracks whether user is touching screen; used to
|
|
24
|
+
* differentiate behavior for touch and mouse input.
|
|
25
|
+
*
|
|
26
|
+
* @type {boolean}
|
|
27
|
+
*/
|
|
28
|
+
let isTouching = false;
|
|
29
|
+
|
|
30
|
+
/*
|
|
31
|
+
* Tracks the last time the screen was touched; used to
|
|
32
|
+
* differentiate behavior for touch and mouse input.
|
|
33
|
+
*
|
|
34
|
+
* @type {number}
|
|
35
|
+
*/
|
|
36
|
+
let lastTouchTime = 0;
|
|
37
|
+
|
|
38
|
+
/*
|
|
39
|
+
* Lightbox page-scroll handler: prevents scrolling.
|
|
40
|
+
*
|
|
41
|
+
* This handler is added to prevent scrolling behaviors that
|
|
42
|
+
* trigger content shift while the lightbox is open.
|
|
43
|
+
*
|
|
44
|
+
* It would be better to accomplish this through CSS alone, but
|
|
45
|
+
* using overflow: hidden is currently the only way to do so, and
|
|
46
|
+
* that causes the layout to shift and prevents the zoom animation
|
|
47
|
+
* from working in some cases because we're unable to account for
|
|
48
|
+
* the layout shift when doing the animation calculations. Instead,
|
|
49
|
+
* here we use JavaScript to prevent and reset the scrolling
|
|
50
|
+
* behavior. In the future, we may be able to use CSS or overflow: hidden
|
|
51
|
+
* instead to not rely on JavaScript, but this seems to be the best approach
|
|
52
|
+
* for now that provides the best visual experience.
|
|
53
|
+
*
|
|
54
|
+
* @param {Object} context Interactivity page context?
|
|
55
|
+
*/
|
|
56
|
+
function handleScroll(context) {
|
|
57
|
+
// We can't override the scroll behavior on mobile devices
|
|
58
|
+
// because doing so breaks the pinch to zoom functionality, and we
|
|
59
|
+
// want to allow users to zoom in further on the high-res image.
|
|
60
|
+
if (!isTouching && Date.now() - lastTouchTime > 450) {
|
|
61
|
+
// We are unable to use event.preventDefault() to prevent scrolling
|
|
62
|
+
// because the scroll event can't be canceled, so we reset the position instead.
|
|
63
|
+
window.scrollTo(context.core.image.scrollLeftReset, context.core.image.scrollTopReset);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
6
66
|
store({
|
|
7
67
|
state: {
|
|
8
68
|
core: {
|
|
@@ -29,38 +89,39 @@ store({
|
|
|
29
89
|
context.core.image.scrollDelta = 0;
|
|
30
90
|
context.core.image.lightboxEnabled = true;
|
|
31
91
|
setStyles(context, event);
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
//
|
|
35
|
-
|
|
92
|
+
context.core.image.scrollTopReset = window.pageYOffset || document.documentElement.scrollTop;
|
|
93
|
+
|
|
94
|
+
// In most cases, this value will be 0, but this is included
|
|
95
|
+
// in case a user has created a page with horizontal scrolling.
|
|
96
|
+
context.core.image.scrollLeftReset = window.pageXOffset || document.documentElement.scrollLeft;
|
|
97
|
+
|
|
98
|
+
// We define and bind the scroll callback here so
|
|
99
|
+
// that we can pass the context and as an argument.
|
|
100
|
+
// We may be able to change this in the future if we
|
|
101
|
+
// define the scroll callback in the store instead, but
|
|
102
|
+
// this approach seems to tbe clearest for now.
|
|
103
|
+
scrollCallback = handleScroll.bind(null, context);
|
|
104
|
+
|
|
105
|
+
// We need to add a scroll event listener to the window
|
|
106
|
+
// here because we are unable to otherwise access it via
|
|
107
|
+
// the Interactivity API directives. If we add a native way
|
|
108
|
+
// to access the window, we can remove this.
|
|
109
|
+
window.addEventListener('scroll', scrollCallback, false);
|
|
36
110
|
},
|
|
37
111
|
hideLightbox: async ({
|
|
38
|
-
context
|
|
39
|
-
event
|
|
112
|
+
context
|
|
40
113
|
}) => {
|
|
41
114
|
context.core.image.hideAnimationEnabled = true;
|
|
42
115
|
if (context.core.image.lightboxEnabled) {
|
|
43
|
-
//
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
|
|
53
|
-
const scrollLeft = window.pageXOffset || document.documentElement.scrollLeft;
|
|
54
|
-
// if any scroll is attempted, set this to the previous value.
|
|
55
|
-
window.onscroll = function () {
|
|
56
|
-
window.scrollTo(scrollLeft, scrollTop);
|
|
57
|
-
};
|
|
58
|
-
// Enable scrolling after the animation finishes
|
|
59
|
-
setTimeout(function () {
|
|
60
|
-
window.onscroll = function () {};
|
|
61
|
-
}, 400);
|
|
62
|
-
}
|
|
63
|
-
document.documentElement.classList.remove('wp-has-lightbox-open');
|
|
116
|
+
// We want to wait until the close animation is completed
|
|
117
|
+
// before allowing a user to scroll again. The duration of this
|
|
118
|
+
// animation is defined in the styles.scss and depends on if the
|
|
119
|
+
// animation is 'zoom' or 'fade', but in any case we should wait
|
|
120
|
+
// a few milliseconds longer than the duration, otherwise a user
|
|
121
|
+
// may scroll too soon and cause the animation to look sloppy.
|
|
122
|
+
setTimeout(function () {
|
|
123
|
+
window.removeEventListener('scroll', scrollCallback);
|
|
124
|
+
}, 450);
|
|
64
125
|
context.core.image.lightboxEnabled = false;
|
|
65
126
|
context.core.image.lastFocusedElement.focus({
|
|
66
127
|
preventScroll: true
|
|
@@ -104,6 +165,30 @@ store({
|
|
|
104
165
|
context,
|
|
105
166
|
ref
|
|
106
167
|
});
|
|
168
|
+
},
|
|
169
|
+
handleTouchStart: () => {
|
|
170
|
+
isTouching = true;
|
|
171
|
+
},
|
|
172
|
+
handleTouchMove: ({
|
|
173
|
+
context,
|
|
174
|
+
event
|
|
175
|
+
}) => {
|
|
176
|
+
// On mobile devices, we want to prevent triggering the
|
|
177
|
+
// scroll event because otherwise the page jumps around as
|
|
178
|
+
// we reset the scroll position. This also means that closing
|
|
179
|
+
// the lightbox requires that a user perform a simple tap. This
|
|
180
|
+
// may be changed in the future if we find a better alternative
|
|
181
|
+
// to override or reset the scroll position during swipe actions.
|
|
182
|
+
if (context.core.image.lightboxEnabled) {
|
|
183
|
+
event.preventDefault();
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
handleTouchEnd: () => {
|
|
187
|
+
// We need to wait a few milliseconds before resetting
|
|
188
|
+
// to ensure that pinch to zoom works consistently
|
|
189
|
+
// on mobile devices when the lightbox is open.
|
|
190
|
+
lastTouchTime = Date.now();
|
|
191
|
+
isTouching = false;
|
|
107
192
|
}
|
|
108
193
|
}
|
|
109
194
|
}
|
|
@@ -221,6 +306,14 @@ store({
|
|
|
221
306
|
}));
|
|
222
307
|
}
|
|
223
308
|
});
|
|
309
|
+
|
|
310
|
+
/*
|
|
311
|
+
* Computes styles for the lightbox and adds them to the document.
|
|
312
|
+
*
|
|
313
|
+
* @function
|
|
314
|
+
* @param {Object} context - An Interactivity API context
|
|
315
|
+
* @param {Object} event - A triggering event
|
|
316
|
+
*/
|
|
224
317
|
function setStyles(context, event) {
|
|
225
318
|
// The reference img element lies adjacent
|
|
226
319
|
// to the event target button in the DOM.
|
|
@@ -371,6 +464,14 @@ function setStyles(context, event) {
|
|
|
371
464
|
}
|
|
372
465
|
`;
|
|
373
466
|
}
|
|
467
|
+
|
|
468
|
+
/*
|
|
469
|
+
* Debounces a function call.
|
|
470
|
+
*
|
|
471
|
+
* @function
|
|
472
|
+
* @param {Function} func - A function to be called
|
|
473
|
+
* @param {number} wait - The time to wait before calling the function
|
|
474
|
+
*/
|
|
374
475
|
function debounce(func, wait = 50) {
|
|
375
476
|
let timeout;
|
|
376
477
|
return () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["store","focusableSelectors","state","core","image","windowWidth","window","innerWidth","windowHeight","innerHeight","actions","showLightbox","context","event","imageLoaded","initialized","lastFocusedElement","document","activeElement","scrollDelta","lightboxEnabled","setStyles","documentElement","classList","add","hideLightbox","hideAnimationEnabled","lightboxAnimation","deltaY","type","Math","abs","scrollY","scrollTop","pageYOffset","scrollLeft","pageXOffset","onscroll","scrollTo","setTimeout","remove","focus","preventScroll","handleKeydown","key","keyCode","shiftKey","firstFocusableElement","preventDefault","lastFocusableElement","handleLoad","effects","ref","imageCurrentSrc","currentSrc","setButtonStyles","selectors","roleAttribute","lightboxObjectFit","enlargedImgSrc","imageUploadedSrc","setCurrentSrc","complete","initLightbox","figureRef","querySelector","imageRef","focusableElements","querySelectorAll","length","naturalWidth","naturalHeight","offsetWidth","offsetHeight","scaleAttr","naturalRatio","offsetRatio","imageButtonWidth","buttonHeight","imageButtonHeight","imageButtonTop","buttonWidth","imageButtonLeft","afterLoad","addEventListener","debounce","originalWidth","originalHeight","target","nextElementSibling","x","screenPosX","y","screenPosY","getBoundingClientRect","originalRatio","heightWithoutSpace","widthWithoutSpace","imgMaxWidth","parseFloat","targetWidth","imgMaxHeight","targetHeight","imgRatio","containerMaxWidth","containerMaxHeight","containerWidth","containerHeight","toFixed","reducedHeight","reducedWidth","horizontalPadding","verticalPadding","targetMaxWidth","min","targetMaxHeight","targetContainerRatio","containerScale","lightboxImgWidth","lightboxImgHeight","styleTag","getElementById","createElement","id","head","appendChild","innerHTML","func","wait","timeout","later","clearTimeout"],"sources":["@wordpress/block-library/src/image/view.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store } from '@wordpress/interactivity';\n\nconst focusableSelectors = [\n\t'a[href]',\n\t'area[href]',\n\t'input:not([disabled]):not([type=\"hidden\"]):not([aria-hidden])',\n\t'select:not([disabled]):not([aria-hidden])',\n\t'textarea:not([disabled]):not([aria-hidden])',\n\t'button:not([disabled]):not([aria-hidden])',\n\t'iframe',\n\t'object',\n\t'embed',\n\t'[contenteditable]',\n\t'[tabindex]:not([tabindex^=\"-\"])',\n];\n\nstore(\n\t{\n\t\tstate: {\n\t\t\tcore: {\n\t\t\t\timage: {\n\t\t\t\t\twindowWidth: window.innerWidth,\n\t\t\t\t\twindowHeight: window.innerHeight,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tactions: {\n\t\t\tcore: {\n\t\t\t\timage: {\n\t\t\t\t\tshowLightbox: ( { context, event } ) => {\n\t\t\t\t\t\t// We can't initialize the lightbox until the reference\n\t\t\t\t\t\t// image is loaded, otherwise the UX is broken.\n\t\t\t\t\t\tif ( ! context.core.image.imageLoaded ) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontext.core.image.initialized = true;\n\t\t\t\t\t\tcontext.core.image.lastFocusedElement =\n\t\t\t\t\t\t\twindow.document.activeElement;\n\t\t\t\t\t\tcontext.core.image.scrollDelta = 0;\n\n\t\t\t\t\t\tcontext.core.image.lightboxEnabled = true;\n\t\t\t\t\t\tsetStyles( context, event );\n\t\t\t\t\t\t// Hide overflow only when the animation is in progress,\n\t\t\t\t\t\t// otherwise the removal of the scrollbars will draw attention\n\t\t\t\t\t\t// to itself and look like an error\n\t\t\t\t\t\tdocument.documentElement.classList.add(\n\t\t\t\t\t\t\t'wp-has-lightbox-open'\n\t\t\t\t\t\t);\n\t\t\t\t\t},\n\t\t\t\t\thideLightbox: async ( { context, event } ) => {\n\t\t\t\t\t\tcontext.core.image.hideAnimationEnabled = true;\n\t\t\t\t\t\tif ( context.core.image.lightboxEnabled ) {\n\t\t\t\t\t\t\t// If scrolling, wait a moment before closing the lightbox.\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tcontext.core.image.lightboxAnimation === 'fade'\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tcontext.core.image.scrollDelta += event.deltaY;\n\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\tevent.type === 'mousewheel' &&\n\t\t\t\t\t\t\t\t\tMath.abs(\n\t\t\t\t\t\t\t\t\t\twindow.scrollY -\n\t\t\t\t\t\t\t\t\t\t\tcontext.core.image.scrollDelta\n\t\t\t\t\t\t\t\t\t) < 10\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\t\tcontext.core.image.lightboxAnimation === 'zoom'\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t// Disable scroll until the zoom animation ends.\n\t\t\t\t\t\t\t\t// Get the current page scroll position\n\t\t\t\t\t\t\t\tconst scrollTop =\n\t\t\t\t\t\t\t\t\twindow.pageYOffset ||\n\t\t\t\t\t\t\t\t\tdocument.documentElement.scrollTop;\n\t\t\t\t\t\t\t\tconst scrollLeft =\n\t\t\t\t\t\t\t\t\twindow.pageXOffset ||\n\t\t\t\t\t\t\t\t\tdocument.documentElement.scrollLeft;\n\t\t\t\t\t\t\t\t// if any scroll is attempted, set this to the previous value.\n\t\t\t\t\t\t\t\twindow.onscroll = function () {\n\t\t\t\t\t\t\t\t\twindow.scrollTo( scrollLeft, scrollTop );\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t// Enable scrolling after the animation finishes\n\t\t\t\t\t\t\t\tsetTimeout( function () {\n\t\t\t\t\t\t\t\t\twindow.onscroll = function () {};\n\t\t\t\t\t\t\t\t}, 400 );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tdocument.documentElement.classList.remove(\n\t\t\t\t\t\t\t\t'wp-has-lightbox-open'\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tcontext.core.image.lightboxEnabled = false;\n\t\t\t\t\t\t\tcontext.core.image.lastFocusedElement.focus( {\n\t\t\t\t\t\t\t\tpreventScroll: true,\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\thandleKeydown: ( { context, actions, event } ) => {\n\t\t\t\t\t\tif ( context.core.image.lightboxEnabled ) {\n\t\t\t\t\t\t\tif ( event.key === 'Tab' || event.keyCode === 9 ) {\n\t\t\t\t\t\t\t\t// If shift + tab it change the direction\n\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\tevent.shiftKey &&\n\t\t\t\t\t\t\t\t\twindow.document.activeElement ===\n\t\t\t\t\t\t\t\t\t\tcontext.core.image.firstFocusableElement\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\tcontext.core.image.lastFocusableElement.focus();\n\t\t\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\t\t\t! event.shiftKey &&\n\t\t\t\t\t\t\t\t\twindow.document.activeElement ===\n\t\t\t\t\t\t\t\t\t\tcontext.core.image.lastFocusableElement\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\tcontext.core.image.firstFocusableElement.focus();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tevent.key === 'Escape' ||\n\t\t\t\t\t\t\t\tevent.keyCode === 27\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tactions.core.image.hideLightbox( {\n\t\t\t\t\t\t\t\t\tcontext,\n\t\t\t\t\t\t\t\t\tevent,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\thandleLoad: ( { state, context, effects, ref } ) => {\n\t\t\t\t\t\tcontext.core.image.imageLoaded = true;\n\t\t\t\t\t\tcontext.core.image.imageCurrentSrc = ref.currentSrc;\n\t\t\t\t\t\teffects.core.image.setButtonStyles( {\n\t\t\t\t\t\t\tstate,\n\t\t\t\t\t\t\tcontext,\n\t\t\t\t\t\t\tref,\n\t\t\t\t\t\t} );\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tselectors: {\n\t\t\tcore: {\n\t\t\t\timage: {\n\t\t\t\t\troleAttribute: ( { context } ) => {\n\t\t\t\t\t\treturn context.core.image.lightboxEnabled\n\t\t\t\t\t\t\t? 'dialog'\n\t\t\t\t\t\t\t: '';\n\t\t\t\t\t},\n\t\t\t\t\tlightboxObjectFit: ( { context } ) => {\n\t\t\t\t\t\tif ( context.core.image.initialized ) {\n\t\t\t\t\t\t\treturn 'cover';\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tenlargedImgSrc: ( { context } ) => {\n\t\t\t\t\t\treturn context.core.image.initialized\n\t\t\t\t\t\t\t? context.core.image.imageUploadedSrc\n\t\t\t\t\t\t\t: '';\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\teffects: {\n\t\t\tcore: {\n\t\t\t\timage: {\n\t\t\t\t\tsetCurrentSrc: ( { context, ref } ) => {\n\t\t\t\t\t\tif ( ref.complete ) {\n\t\t\t\t\t\t\tcontext.core.image.imageLoaded = true;\n\t\t\t\t\t\t\tcontext.core.image.imageCurrentSrc = ref.currentSrc;\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tinitLightbox: async ( { context, ref } ) => {\n\t\t\t\t\t\tcontext.core.image.figureRef =\n\t\t\t\t\t\t\tref.querySelector( 'figure' );\n\t\t\t\t\t\tcontext.core.image.imageRef =\n\t\t\t\t\t\t\tref.querySelector( 'img' );\n\t\t\t\t\t\tif ( context.core.image.lightboxEnabled ) {\n\t\t\t\t\t\t\tconst focusableElements =\n\t\t\t\t\t\t\t\tref.querySelectorAll( focusableSelectors );\n\t\t\t\t\t\t\tcontext.core.image.firstFocusableElement =\n\t\t\t\t\t\t\t\tfocusableElements[ 0 ];\n\t\t\t\t\t\t\tcontext.core.image.lastFocusableElement =\n\t\t\t\t\t\t\t\tfocusableElements[\n\t\t\t\t\t\t\t\t\tfocusableElements.length - 1\n\t\t\t\t\t\t\t\t];\n\n\t\t\t\t\t\t\tref.querySelector( '.close-button' ).focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tsetButtonStyles: ( { state, context, ref } ) => {\n\t\t\t\t\t\tconst {\n\t\t\t\t\t\t\tnaturalWidth,\n\t\t\t\t\t\t\tnaturalHeight,\n\t\t\t\t\t\t\toffsetWidth,\n\t\t\t\t\t\t\toffsetHeight,\n\t\t\t\t\t\t} = ref;\n\n\t\t\t\t\t\t// If the image isn't loaded yet, we can't\n\t\t\t\t\t\t// calculate how big the button should be.\n\t\t\t\t\t\tif ( naturalWidth === 0 || naturalHeight === 0 ) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Subscribe to the window dimensions so we can\n\t\t\t\t\t\t// recalculate the styles if the window is resized.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t( state.core.image.windowWidth ||\n\t\t\t\t\t\t\t\tstate.core.image.windowHeight ) &&\n\t\t\t\t\t\t\tcontext.core.image.scaleAttr === 'contain'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// In the case of an image with object-fit: contain, the\n\t\t\t\t\t\t\t// size of the img element can be larger than the image itself,\n\t\t\t\t\t\t\t// so we need to calculate the size of the button to match.\n\n\t\t\t\t\t\t\t// Natural ratio of the image.\n\t\t\t\t\t\t\tconst naturalRatio = naturalWidth / naturalHeight;\n\t\t\t\t\t\t\t// Offset ratio of the image.\n\t\t\t\t\t\t\tconst offsetRatio = offsetWidth / offsetHeight;\n\n\t\t\t\t\t\t\tif ( naturalRatio > offsetRatio ) {\n\t\t\t\t\t\t\t\t// If it reaches the width first, keep\n\t\t\t\t\t\t\t\t// the width and recalculate the height.\n\t\t\t\t\t\t\t\tcontext.core.image.imageButtonWidth =\n\t\t\t\t\t\t\t\t\toffsetWidth;\n\t\t\t\t\t\t\t\tconst buttonHeight = offsetWidth / naturalRatio;\n\t\t\t\t\t\t\t\tcontext.core.image.imageButtonHeight =\n\t\t\t\t\t\t\t\t\tbuttonHeight;\n\t\t\t\t\t\t\t\tcontext.core.image.imageButtonTop =\n\t\t\t\t\t\t\t\t\t( offsetHeight - buttonHeight ) / 2;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// If it reaches the height first, keep\n\t\t\t\t\t\t\t\t// the height and recalculate the width.\n\t\t\t\t\t\t\t\tcontext.core.image.imageButtonHeight =\n\t\t\t\t\t\t\t\t\toffsetHeight;\n\t\t\t\t\t\t\t\tconst buttonWidth = offsetHeight * naturalRatio;\n\t\t\t\t\t\t\t\tcontext.core.image.imageButtonWidth =\n\t\t\t\t\t\t\t\t\tbuttonWidth;\n\t\t\t\t\t\t\t\tcontext.core.image.imageButtonLeft =\n\t\t\t\t\t\t\t\t\t( offsetWidth - buttonWidth ) / 2;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// In all other cases, we can trust that the size of\n\t\t\t\t\t\t\t// the image is the right size for the button as well.\n\n\t\t\t\t\t\t\tcontext.core.image.imageButtonWidth = offsetWidth;\n\t\t\t\t\t\t\tcontext.core.image.imageButtonHeight = offsetHeight;\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tafterLoad: ( { state } ) => {\n\t\t\twindow.addEventListener(\n\t\t\t\t'resize',\n\t\t\t\tdebounce( () => {\n\t\t\t\t\tstate.core.image.windowWidth = window.innerWidth;\n\t\t\t\t\tstate.core.image.windowHeight = window.innerHeight;\n\t\t\t\t} )\n\t\t\t);\n\t\t},\n\t}\n);\n\nfunction setStyles( context, event ) {\n\t// The reference img element lies adjacent\n\t// to the event target button in the DOM.\n\tlet {\n\t\tnaturalWidth,\n\t\tnaturalHeight,\n\t\toffsetWidth: originalWidth,\n\t\toffsetHeight: originalHeight,\n\t} = event.target.nextElementSibling;\n\tlet { x: screenPosX, y: screenPosY } =\n\t\tevent.target.nextElementSibling.getBoundingClientRect();\n\n\t// Natural ratio of the image clicked to open the lightbox.\n\tconst naturalRatio = naturalWidth / naturalHeight;\n\t// Original ratio of the image clicked to open the lightbox.\n\tlet originalRatio = originalWidth / originalHeight;\n\n\t// If it has object-fit: contain, recalculate the original sizes\n\t// and the screen position without the blank spaces.\n\tif ( context.core.image.scaleAttr === 'contain' ) {\n\t\tif ( naturalRatio > originalRatio ) {\n\t\t\tconst heightWithoutSpace = originalWidth / naturalRatio;\n\t\t\t// Recalculate screen position without the top space.\n\t\t\tscreenPosY += ( originalHeight - heightWithoutSpace ) / 2;\n\t\t\toriginalHeight = heightWithoutSpace;\n\t\t} else {\n\t\t\tconst widthWithoutSpace = originalHeight * naturalRatio;\n\t\t\t// Recalculate screen position without the left space.\n\t\t\tscreenPosX += ( originalWidth - widthWithoutSpace ) / 2;\n\t\t\toriginalWidth = widthWithoutSpace;\n\t\t}\n\t}\n\toriginalRatio = originalWidth / originalHeight;\n\n\t// Typically, we use the image's full-sized dimensions. If those\n\t// dimensions have not been set (i.e. an external image with only one size),\n\t// the image's dimensions in the lightbox are the same\n\t// as those of the image in the content.\n\tlet imgMaxWidth = parseFloat(\n\t\tcontext.core.image.targetWidth !== 'none'\n\t\t\t? context.core.image.targetWidth\n\t\t\t: naturalWidth\n\t);\n\tlet imgMaxHeight = parseFloat(\n\t\tcontext.core.image.targetHeight !== 'none'\n\t\t\t? context.core.image.targetHeight\n\t\t\t: naturalHeight\n\t);\n\n\t// Ratio of the biggest image stored in the database.\n\tlet imgRatio = imgMaxWidth / imgMaxHeight;\n\tlet containerMaxWidth = imgMaxWidth;\n\tlet containerMaxHeight = imgMaxHeight;\n\tlet containerWidth = imgMaxWidth;\n\tlet containerHeight = imgMaxHeight;\n\t// Check if the target image has a different ratio than the original one (thumbnail).\n\t// Recalculate the width and height.\n\tif ( naturalRatio.toFixed( 2 ) !== imgRatio.toFixed( 2 ) ) {\n\t\tif ( naturalRatio > imgRatio ) {\n\t\t\t// If the width is reached before the height, we keep the maxWidth\n\t\t\t// and recalculate the height.\n\t\t\t// Unless the difference between the maxHeight and the reducedHeight\n\t\t\t// is higher than the maxWidth, where we keep the reducedHeight and\n\t\t\t// recalculate the width.\n\t\t\tconst reducedHeight = imgMaxWidth / naturalRatio;\n\t\t\tif ( imgMaxHeight - reducedHeight > imgMaxWidth ) {\n\t\t\t\timgMaxHeight = reducedHeight;\n\t\t\t\timgMaxWidth = reducedHeight * naturalRatio;\n\t\t\t} else {\n\t\t\t\timgMaxHeight = imgMaxWidth / naturalRatio;\n\t\t\t}\n\t\t} else {\n\t\t\t// If the height is reached before the width, we keep the maxHeight\n\t\t\t// and recalculate the width.\n\t\t\t// Unless the difference between the maxWidth and the reducedWidth\n\t\t\t// is higher than the maxHeight, where we keep the reducedWidth and\n\t\t\t// recalculate the height.\n\t\t\tconst reducedWidth = imgMaxHeight * naturalRatio;\n\t\t\tif ( imgMaxWidth - reducedWidth > imgMaxHeight ) {\n\t\t\t\timgMaxWidth = reducedWidth;\n\t\t\t\timgMaxHeight = reducedWidth / naturalRatio;\n\t\t\t} else {\n\t\t\t\timgMaxWidth = imgMaxHeight * naturalRatio;\n\t\t\t}\n\t\t}\n\t\tcontainerWidth = imgMaxWidth;\n\t\tcontainerHeight = imgMaxHeight;\n\t\timgRatio = imgMaxWidth / imgMaxHeight;\n\n\t\t// Calculate the max size of the container.\n\t\tif ( originalRatio > imgRatio ) {\n\t\t\tcontainerMaxWidth = imgMaxWidth;\n\t\t\tcontainerMaxHeight = containerMaxWidth / originalRatio;\n\t\t} else {\n\t\t\tcontainerMaxHeight = imgMaxHeight;\n\t\t\tcontainerMaxWidth = containerMaxHeight * originalRatio;\n\t\t}\n\t}\n\n\t// If the image has been pixelated on purpose, keep that size.\n\tif ( originalWidth > containerWidth || originalHeight > containerHeight ) {\n\t\tcontainerWidth = originalWidth;\n\t\tcontainerHeight = originalHeight;\n\t}\n\n\t// Calculate the final lightbox image size and the\n\t// scale factor. MaxWidth is either the window container\n\t// (accounting for padding) or the image resolution.\n\tlet horizontalPadding = 0;\n\tif ( window.innerWidth > 480 ) {\n\t\thorizontalPadding = 80;\n\t} else if ( window.innerWidth > 1920 ) {\n\t\thorizontalPadding = 160;\n\t}\n\tconst verticalPadding = 80;\n\n\tconst targetMaxWidth = Math.min(\n\t\twindow.innerWidth - horizontalPadding,\n\t\tcontainerWidth\n\t);\n\tconst targetMaxHeight = Math.min(\n\t\twindow.innerHeight - verticalPadding,\n\t\tcontainerHeight\n\t);\n\tconst targetContainerRatio = targetMaxWidth / targetMaxHeight;\n\n\tif ( originalRatio > targetContainerRatio ) {\n\t\t// If targetMaxWidth is reached before targetMaxHeight\n\t\tcontainerWidth = targetMaxWidth;\n\t\tcontainerHeight = containerWidth / originalRatio;\n\t} else {\n\t\t// If targetMaxHeight is reached before targetMaxWidth\n\t\tcontainerHeight = targetMaxHeight;\n\t\tcontainerWidth = containerHeight * originalRatio;\n\t}\n\n\tconst containerScale = originalWidth / containerWidth;\n\tconst lightboxImgWidth =\n\t\timgMaxWidth * ( containerWidth / containerMaxWidth );\n\tconst lightboxImgHeight =\n\t\timgMaxHeight * ( containerHeight / containerMaxHeight );\n\n\t// Add the CSS variables needed.\n\tlet styleTag = document.getElementById( 'wp-lightbox-styles' );\n\tif ( ! styleTag ) {\n\t\tstyleTag = document.createElement( 'style' );\n\t\tstyleTag.id = 'wp-lightbox-styles';\n\t\tdocument.head.appendChild( styleTag );\n\t}\n\n\t// As of this writing, using the calculations above will render the lightbox\n\t// with a small, erroneous whitespace on the left side of the image in iOS Safari,\n\t// perhaps due to an inconsistency in how browsers handle absolute positioning and CSS\n\t// transformation. In any case, adding 1 pixel to the container width and height solves\n\t// the problem, though this can be removed if the issue is fixed in the future.\n\tstyleTag.innerHTML = `\n\t\t:root {\n\t\t\t--wp--lightbox-initial-top-position: ${ screenPosY }px;\n\t\t\t--wp--lightbox-initial-left-position: ${ screenPosX }px;\n\t\t\t--wp--lightbox-container-width: ${ containerWidth + 1 }px;\n\t\t\t--wp--lightbox-container-height: ${ containerHeight + 1 }px;\n\t\t\t--wp--lightbox-image-width: ${ lightboxImgWidth }px;\n\t\t\t--wp--lightbox-image-height: ${ lightboxImgHeight }px;\n\t\t\t--wp--lightbox-scale: ${ containerScale };\n\t\t}\n\t`;\n}\n\nfunction debounce( func, wait = 50 ) {\n\tlet timeout;\n\treturn () => {\n\t\tconst later = () => {\n\t\t\ttimeout = null;\n\t\t\tfunc();\n\t\t};\n\t\tclearTimeout( timeout );\n\t\ttimeout = setTimeout( later, wait );\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,QAAQ,0BAA0B;AAEhD,MAAMC,kBAAkB,GAAG,CAC1B,SAAS,EACT,YAAY,EACZ,+DAA+D,EAC/D,2CAA2C,EAC3C,6CAA6C,EAC7C,2CAA2C,EAC3C,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,mBAAmB,E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AQ,CAAC;IACvBA,OAAO,GAAG1F,UAAU,CAAE2F,KAAK,EAAEF,IAAK,CAAC;EACpC,CAAC;AACF"}
|
|
1
|
+
{"version":3,"names":["store","focusableSelectors","scrollCallback","isTouching","lastTouchTime","handleScroll","context","Date","now","window","scrollTo","core","image","scrollLeftReset","scrollTopReset","state","windowWidth","innerWidth","windowHeight","innerHeight","actions","showLightbox","event","imageLoaded","initialized","lastFocusedElement","document","activeElement","scrollDelta","lightboxEnabled","setStyles","pageYOffset","documentElement","scrollTop","pageXOffset","scrollLeft","bind","addEventListener","hideLightbox","hideAnimationEnabled","setTimeout","removeEventListener","focus","preventScroll","handleKeydown","key","keyCode","shiftKey","firstFocusableElement","preventDefault","lastFocusableElement","handleLoad","effects","ref","imageCurrentSrc","currentSrc","setButtonStyles","handleTouchStart","handleTouchMove","handleTouchEnd","selectors","roleAttribute","lightboxObjectFit","enlargedImgSrc","imageUploadedSrc","setCurrentSrc","complete","initLightbox","figureRef","querySelector","imageRef","focusableElements","querySelectorAll","length","naturalWidth","naturalHeight","offsetWidth","offsetHeight","scaleAttr","naturalRatio","offsetRatio","imageButtonWidth","buttonHeight","imageButtonHeight","imageButtonTop","buttonWidth","imageButtonLeft","afterLoad","debounce","originalWidth","originalHeight","target","nextElementSibling","x","screenPosX","y","screenPosY","getBoundingClientRect","originalRatio","heightWithoutSpace","widthWithoutSpace","imgMaxWidth","parseFloat","targetWidth","imgMaxHeight","targetHeight","imgRatio","containerMaxWidth","containerMaxHeight","containerWidth","containerHeight","toFixed","reducedHeight","reducedWidth","horizontalPadding","verticalPadding","targetMaxWidth","Math","min","targetMaxHeight","targetContainerRatio","containerScale","lightboxImgWidth","lightboxImgHeight","styleTag","getElementById","createElement","id","head","appendChild","innerHTML","func","wait","timeout","later","clearTimeout"],"sources":["@wordpress/block-library/src/image/view.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store } from '@wordpress/interactivity';\n\nconst focusableSelectors = [\n\t'a[href]',\n\t'area[href]',\n\t'input:not([disabled]):not([type=\"hidden\"]):not([aria-hidden])',\n\t'select:not([disabled]):not([aria-hidden])',\n\t'textarea:not([disabled]):not([aria-hidden])',\n\t'button:not([disabled]):not([aria-hidden])',\n\t'iframe',\n\t'object',\n\t'embed',\n\t'[contenteditable]',\n\t'[tabindex]:not([tabindex^=\"-\"])',\n];\n\n/*\n * Stores a context-bound scroll handler.\n *\n * This callback could be defined inline inside of the store\n * object but it's created externally to avoid confusion about\n * how its logic is called. This logic is not referenced directly\n * by the directives in the markup because the scroll event we\n * need to listen to is triggered on the window; so by defining it\n * outside of the store, we signal that the behavior here is different.\n * If we find a compelling reason to move it to the store, feel free.\n *\n * @type {Function}\n */\nlet scrollCallback;\n\n/*\n * Tracks whether user is touching screen; used to\n * differentiate behavior for touch and mouse input.\n *\n * @type {boolean}\n */\nlet isTouching = false;\n\n/*\n * Tracks the last time the screen was touched; used to\n * differentiate behavior for touch and mouse input.\n *\n * @type {number}\n */\nlet lastTouchTime = 0;\n\n/*\n * Lightbox page-scroll handler: prevents scrolling.\n *\n * This handler is added to prevent scrolling behaviors that\n * trigger content shift while the lightbox is open.\n *\n * It would be better to accomplish this through CSS alone, but\n * using overflow: hidden is currently the only way to do so, and\n * that causes the layout to shift and prevents the zoom animation\n * from working in some cases because we're unable to account for\n * the layout shift when doing the animation calculations. Instead,\n * here we use JavaScript to prevent and reset the scrolling\n * behavior. In the future, we may be able to use CSS or overflow: hidden\n * instead to not rely on JavaScript, but this seems to be the best approach\n * for now that provides the best visual experience.\n *\n * @param {Object} context Interactivity page context?\n */\nfunction handleScroll( context ) {\n\t// We can't override the scroll behavior on mobile devices\n\t// because doing so breaks the pinch to zoom functionality, and we\n\t// want to allow users to zoom in further on the high-res image.\n\tif ( ! isTouching && Date.now() - lastTouchTime > 450 ) {\n\t\t// We are unable to use event.preventDefault() to prevent scrolling\n\t\t// because the scroll event can't be canceled, so we reset the position instead.\n\t\twindow.scrollTo(\n\t\t\tcontext.core.image.scrollLeftReset,\n\t\t\tcontext.core.image.scrollTopReset\n\t\t);\n\t}\n}\n\nstore(\n\t{\n\t\tstate: {\n\t\t\tcore: {\n\t\t\t\timage: {\n\t\t\t\t\twindowWidth: window.innerWidth,\n\t\t\t\t\twindowHeight: window.innerHeight,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tactions: {\n\t\t\tcore: {\n\t\t\t\timage: {\n\t\t\t\t\tshowLightbox: ( { context, event } ) => {\n\t\t\t\t\t\t// We can't initialize the lightbox until the reference\n\t\t\t\t\t\t// image is loaded, otherwise the UX is broken.\n\t\t\t\t\t\tif ( ! context.core.image.imageLoaded ) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontext.core.image.initialized = true;\n\t\t\t\t\t\tcontext.core.image.lastFocusedElement =\n\t\t\t\t\t\t\twindow.document.activeElement;\n\t\t\t\t\t\tcontext.core.image.scrollDelta = 0;\n\n\t\t\t\t\t\tcontext.core.image.lightboxEnabled = true;\n\t\t\t\t\t\tsetStyles( context, event );\n\n\t\t\t\t\t\tcontext.core.image.scrollTopReset =\n\t\t\t\t\t\t\twindow.pageYOffset ||\n\t\t\t\t\t\t\tdocument.documentElement.scrollTop;\n\n\t\t\t\t\t\t// In most cases, this value will be 0, but this is included\n\t\t\t\t\t\t// in case a user has created a page with horizontal scrolling.\n\t\t\t\t\t\tcontext.core.image.scrollLeftReset =\n\t\t\t\t\t\t\twindow.pageXOffset ||\n\t\t\t\t\t\t\tdocument.documentElement.scrollLeft;\n\n\t\t\t\t\t\t// We define and bind the scroll callback here so\n\t\t\t\t\t\t// that we can pass the context and as an argument.\n\t\t\t\t\t\t// We may be able to change this in the future if we\n\t\t\t\t\t\t// define the scroll callback in the store instead, but\n\t\t\t\t\t\t// this approach seems to tbe clearest for now.\n\t\t\t\t\t\tscrollCallback = handleScroll.bind( null, context );\n\n\t\t\t\t\t\t// We need to add a scroll event listener to the window\n\t\t\t\t\t\t// here because we are unable to otherwise access it via\n\t\t\t\t\t\t// the Interactivity API directives. If we add a native way\n\t\t\t\t\t\t// to access the window, we can remove this.\n\t\t\t\t\t\twindow.addEventListener(\n\t\t\t\t\t\t\t'scroll',\n\t\t\t\t\t\t\tscrollCallback,\n\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t);\n\t\t\t\t\t},\n\t\t\t\t\thideLightbox: async ( { context } ) => {\n\t\t\t\t\t\tcontext.core.image.hideAnimationEnabled = true;\n\t\t\t\t\t\tif ( context.core.image.lightboxEnabled ) {\n\t\t\t\t\t\t\t// We want to wait until the close animation is completed\n\t\t\t\t\t\t\t// before allowing a user to scroll again. The duration of this\n\t\t\t\t\t\t\t// animation is defined in the styles.scss and depends on if the\n\t\t\t\t\t\t\t// animation is 'zoom' or 'fade', but in any case we should wait\n\t\t\t\t\t\t\t// a few milliseconds longer than the duration, otherwise a user\n\t\t\t\t\t\t\t// may scroll too soon and cause the animation to look sloppy.\n\t\t\t\t\t\t\tsetTimeout( function () {\n\t\t\t\t\t\t\t\twindow.removeEventListener(\n\t\t\t\t\t\t\t\t\t'scroll',\n\t\t\t\t\t\t\t\t\tscrollCallback\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}, 450 );\n\n\t\t\t\t\t\t\tcontext.core.image.lightboxEnabled = false;\n\t\t\t\t\t\t\tcontext.core.image.lastFocusedElement.focus( {\n\t\t\t\t\t\t\t\tpreventScroll: true,\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\thandleKeydown: ( { context, actions, event } ) => {\n\t\t\t\t\t\tif ( context.core.image.lightboxEnabled ) {\n\t\t\t\t\t\t\tif ( event.key === 'Tab' || event.keyCode === 9 ) {\n\t\t\t\t\t\t\t\t// If shift + tab it change the direction\n\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\tevent.shiftKey &&\n\t\t\t\t\t\t\t\t\twindow.document.activeElement ===\n\t\t\t\t\t\t\t\t\t\tcontext.core.image.firstFocusableElement\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\tcontext.core.image.lastFocusableElement.focus();\n\t\t\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\t\t\t! event.shiftKey &&\n\t\t\t\t\t\t\t\t\twindow.document.activeElement ===\n\t\t\t\t\t\t\t\t\t\tcontext.core.image.lastFocusableElement\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\tcontext.core.image.firstFocusableElement.focus();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tevent.key === 'Escape' ||\n\t\t\t\t\t\t\t\tevent.keyCode === 27\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tactions.core.image.hideLightbox( {\n\t\t\t\t\t\t\t\t\tcontext,\n\t\t\t\t\t\t\t\t\tevent,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\thandleLoad: ( { state, context, effects, ref } ) => {\n\t\t\t\t\t\tcontext.core.image.imageLoaded = true;\n\t\t\t\t\t\tcontext.core.image.imageCurrentSrc = ref.currentSrc;\n\t\t\t\t\t\teffects.core.image.setButtonStyles( {\n\t\t\t\t\t\t\tstate,\n\t\t\t\t\t\t\tcontext,\n\t\t\t\t\t\t\tref,\n\t\t\t\t\t\t} );\n\t\t\t\t\t},\n\t\t\t\t\thandleTouchStart: () => {\n\t\t\t\t\t\tisTouching = true;\n\t\t\t\t\t},\n\t\t\t\t\thandleTouchMove: ( { context, event } ) => {\n\t\t\t\t\t\t// On mobile devices, we want to prevent triggering the\n\t\t\t\t\t\t// scroll event because otherwise the page jumps around as\n\t\t\t\t\t\t// we reset the scroll position. This also means that closing\n\t\t\t\t\t\t// the lightbox requires that a user perform a simple tap. This\n\t\t\t\t\t\t// may be changed in the future if we find a better alternative\n\t\t\t\t\t\t// to override or reset the scroll position during swipe actions.\n\t\t\t\t\t\tif ( context.core.image.lightboxEnabled ) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\thandleTouchEnd: () => {\n\t\t\t\t\t\t// We need to wait a few milliseconds before resetting\n\t\t\t\t\t\t// to ensure that pinch to zoom works consistently\n\t\t\t\t\t\t// on mobile devices when the lightbox is open.\n\t\t\t\t\t\tlastTouchTime = Date.now();\n\t\t\t\t\t\tisTouching = false;\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tselectors: {\n\t\t\tcore: {\n\t\t\t\timage: {\n\t\t\t\t\troleAttribute: ( { context } ) => {\n\t\t\t\t\t\treturn context.core.image.lightboxEnabled\n\t\t\t\t\t\t\t? 'dialog'\n\t\t\t\t\t\t\t: '';\n\t\t\t\t\t},\n\t\t\t\t\tlightboxObjectFit: ( { context } ) => {\n\t\t\t\t\t\tif ( context.core.image.initialized ) {\n\t\t\t\t\t\t\treturn 'cover';\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tenlargedImgSrc: ( { context } ) => {\n\t\t\t\t\t\treturn context.core.image.initialized\n\t\t\t\t\t\t\t? context.core.image.imageUploadedSrc\n\t\t\t\t\t\t\t: '';\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\teffects: {\n\t\t\tcore: {\n\t\t\t\timage: {\n\t\t\t\t\tsetCurrentSrc: ( { context, ref } ) => {\n\t\t\t\t\t\tif ( ref.complete ) {\n\t\t\t\t\t\t\tcontext.core.image.imageLoaded = true;\n\t\t\t\t\t\t\tcontext.core.image.imageCurrentSrc = ref.currentSrc;\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tinitLightbox: async ( { context, ref } ) => {\n\t\t\t\t\t\tcontext.core.image.figureRef =\n\t\t\t\t\t\t\tref.querySelector( 'figure' );\n\t\t\t\t\t\tcontext.core.image.imageRef =\n\t\t\t\t\t\t\tref.querySelector( 'img' );\n\t\t\t\t\t\tif ( context.core.image.lightboxEnabled ) {\n\t\t\t\t\t\t\tconst focusableElements =\n\t\t\t\t\t\t\t\tref.querySelectorAll( focusableSelectors );\n\t\t\t\t\t\t\tcontext.core.image.firstFocusableElement =\n\t\t\t\t\t\t\t\tfocusableElements[ 0 ];\n\t\t\t\t\t\t\tcontext.core.image.lastFocusableElement =\n\t\t\t\t\t\t\t\tfocusableElements[\n\t\t\t\t\t\t\t\t\tfocusableElements.length - 1\n\t\t\t\t\t\t\t\t];\n\n\t\t\t\t\t\t\tref.querySelector( '.close-button' ).focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tsetButtonStyles: ( { state, context, ref } ) => {\n\t\t\t\t\t\tconst {\n\t\t\t\t\t\t\tnaturalWidth,\n\t\t\t\t\t\t\tnaturalHeight,\n\t\t\t\t\t\t\toffsetWidth,\n\t\t\t\t\t\t\toffsetHeight,\n\t\t\t\t\t\t} = ref;\n\n\t\t\t\t\t\t// If the image isn't loaded yet, we can't\n\t\t\t\t\t\t// calculate how big the button should be.\n\t\t\t\t\t\tif ( naturalWidth === 0 || naturalHeight === 0 ) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Subscribe to the window dimensions so we can\n\t\t\t\t\t\t// recalculate the styles if the window is resized.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t( state.core.image.windowWidth ||\n\t\t\t\t\t\t\t\tstate.core.image.windowHeight ) &&\n\t\t\t\t\t\t\tcontext.core.image.scaleAttr === 'contain'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// In the case of an image with object-fit: contain, the\n\t\t\t\t\t\t\t// size of the img element can be larger than the image itself,\n\t\t\t\t\t\t\t// so we need to calculate the size of the button to match.\n\n\t\t\t\t\t\t\t// Natural ratio of the image.\n\t\t\t\t\t\t\tconst naturalRatio = naturalWidth / naturalHeight;\n\t\t\t\t\t\t\t// Offset ratio of the image.\n\t\t\t\t\t\t\tconst offsetRatio = offsetWidth / offsetHeight;\n\n\t\t\t\t\t\t\tif ( naturalRatio > offsetRatio ) {\n\t\t\t\t\t\t\t\t// If it reaches the width first, keep\n\t\t\t\t\t\t\t\t// the width and recalculate the height.\n\t\t\t\t\t\t\t\tcontext.core.image.imageButtonWidth =\n\t\t\t\t\t\t\t\t\toffsetWidth;\n\t\t\t\t\t\t\t\tconst buttonHeight = offsetWidth / naturalRatio;\n\t\t\t\t\t\t\t\tcontext.core.image.imageButtonHeight =\n\t\t\t\t\t\t\t\t\tbuttonHeight;\n\t\t\t\t\t\t\t\tcontext.core.image.imageButtonTop =\n\t\t\t\t\t\t\t\t\t( offsetHeight - buttonHeight ) / 2;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// If it reaches the height first, keep\n\t\t\t\t\t\t\t\t// the height and recalculate the width.\n\t\t\t\t\t\t\t\tcontext.core.image.imageButtonHeight =\n\t\t\t\t\t\t\t\t\toffsetHeight;\n\t\t\t\t\t\t\t\tconst buttonWidth = offsetHeight * naturalRatio;\n\t\t\t\t\t\t\t\tcontext.core.image.imageButtonWidth =\n\t\t\t\t\t\t\t\t\tbuttonWidth;\n\t\t\t\t\t\t\t\tcontext.core.image.imageButtonLeft =\n\t\t\t\t\t\t\t\t\t( offsetWidth - buttonWidth ) / 2;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// In all other cases, we can trust that the size of\n\t\t\t\t\t\t\t// the image is the right size for the button as well.\n\n\t\t\t\t\t\t\tcontext.core.image.imageButtonWidth = offsetWidth;\n\t\t\t\t\t\t\tcontext.core.image.imageButtonHeight = offsetHeight;\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tafterLoad: ( { state } ) => {\n\t\t\twindow.addEventListener(\n\t\t\t\t'resize',\n\t\t\t\tdebounce( () => {\n\t\t\t\t\tstate.core.image.windowWidth = window.innerWidth;\n\t\t\t\t\tstate.core.image.windowHeight = window.innerHeight;\n\t\t\t\t} )\n\t\t\t);\n\t\t},\n\t}\n);\n\n/*\n * Computes styles for the lightbox and adds them to the document.\n *\n * @function\n * @param {Object} context - An Interactivity API context\n * @param {Object} event - A triggering event\n */\nfunction setStyles( context, event ) {\n\t// The reference img element lies adjacent\n\t// to the event target button in the DOM.\n\tlet {\n\t\tnaturalWidth,\n\t\tnaturalHeight,\n\t\toffsetWidth: originalWidth,\n\t\toffsetHeight: originalHeight,\n\t} = event.target.nextElementSibling;\n\tlet { x: screenPosX, y: screenPosY } =\n\t\tevent.target.nextElementSibling.getBoundingClientRect();\n\n\t// Natural ratio of the image clicked to open the lightbox.\n\tconst naturalRatio = naturalWidth / naturalHeight;\n\t// Original ratio of the image clicked to open the lightbox.\n\tlet originalRatio = originalWidth / originalHeight;\n\n\t// If it has object-fit: contain, recalculate the original sizes\n\t// and the screen position without the blank spaces.\n\tif ( context.core.image.scaleAttr === 'contain' ) {\n\t\tif ( naturalRatio > originalRatio ) {\n\t\t\tconst heightWithoutSpace = originalWidth / naturalRatio;\n\t\t\t// Recalculate screen position without the top space.\n\t\t\tscreenPosY += ( originalHeight - heightWithoutSpace ) / 2;\n\t\t\toriginalHeight = heightWithoutSpace;\n\t\t} else {\n\t\t\tconst widthWithoutSpace = originalHeight * naturalRatio;\n\t\t\t// Recalculate screen position without the left space.\n\t\t\tscreenPosX += ( originalWidth - widthWithoutSpace ) / 2;\n\t\t\toriginalWidth = widthWithoutSpace;\n\t\t}\n\t}\n\toriginalRatio = originalWidth / originalHeight;\n\n\t// Typically, we use the image's full-sized dimensions. If those\n\t// dimensions have not been set (i.e. an external image with only one size),\n\t// the image's dimensions in the lightbox are the same\n\t// as those of the image in the content.\n\tlet imgMaxWidth = parseFloat(\n\t\tcontext.core.image.targetWidth !== 'none'\n\t\t\t? context.core.image.targetWidth\n\t\t\t: naturalWidth\n\t);\n\tlet imgMaxHeight = parseFloat(\n\t\tcontext.core.image.targetHeight !== 'none'\n\t\t\t? context.core.image.targetHeight\n\t\t\t: naturalHeight\n\t);\n\n\t// Ratio of the biggest image stored in the database.\n\tlet imgRatio = imgMaxWidth / imgMaxHeight;\n\tlet containerMaxWidth = imgMaxWidth;\n\tlet containerMaxHeight = imgMaxHeight;\n\tlet containerWidth = imgMaxWidth;\n\tlet containerHeight = imgMaxHeight;\n\t// Check if the target image has a different ratio than the original one (thumbnail).\n\t// Recalculate the width and height.\n\tif ( naturalRatio.toFixed( 2 ) !== imgRatio.toFixed( 2 ) ) {\n\t\tif ( naturalRatio > imgRatio ) {\n\t\t\t// If the width is reached before the height, we keep the maxWidth\n\t\t\t// and recalculate the height.\n\t\t\t// Unless the difference between the maxHeight and the reducedHeight\n\t\t\t// is higher than the maxWidth, where we keep the reducedHeight and\n\t\t\t// recalculate the width.\n\t\t\tconst reducedHeight = imgMaxWidth / naturalRatio;\n\t\t\tif ( imgMaxHeight - reducedHeight > imgMaxWidth ) {\n\t\t\t\timgMaxHeight = reducedHeight;\n\t\t\t\timgMaxWidth = reducedHeight * naturalRatio;\n\t\t\t} else {\n\t\t\t\timgMaxHeight = imgMaxWidth / naturalRatio;\n\t\t\t}\n\t\t} else {\n\t\t\t// If the height is reached before the width, we keep the maxHeight\n\t\t\t// and recalculate the width.\n\t\t\t// Unless the difference between the maxWidth and the reducedWidth\n\t\t\t// is higher than the maxHeight, where we keep the reducedWidth and\n\t\t\t// recalculate the height.\n\t\t\tconst reducedWidth = imgMaxHeight * naturalRatio;\n\t\t\tif ( imgMaxWidth - reducedWidth > imgMaxHeight ) {\n\t\t\t\timgMaxWidth = reducedWidth;\n\t\t\t\timgMaxHeight = reducedWidth / naturalRatio;\n\t\t\t} else {\n\t\t\t\timgMaxWidth = imgMaxHeight * naturalRatio;\n\t\t\t}\n\t\t}\n\t\tcontainerWidth = imgMaxWidth;\n\t\tcontainerHeight = imgMaxHeight;\n\t\timgRatio = imgMaxWidth / imgMaxHeight;\n\n\t\t// Calculate the max size of the container.\n\t\tif ( originalRatio > imgRatio ) {\n\t\t\tcontainerMaxWidth = imgMaxWidth;\n\t\t\tcontainerMaxHeight = containerMaxWidth / originalRatio;\n\t\t} else {\n\t\t\tcontainerMaxHeight = imgMaxHeight;\n\t\t\tcontainerMaxWidth = containerMaxHeight * originalRatio;\n\t\t}\n\t}\n\n\t// If the image has been pixelated on purpose, keep that size.\n\tif ( originalWidth > containerWidth || originalHeight > containerHeight ) {\n\t\tcontainerWidth = originalWidth;\n\t\tcontainerHeight = originalHeight;\n\t}\n\n\t// Calculate the final lightbox image size and the\n\t// scale factor. MaxWidth is either the window container\n\t// (accounting for padding) or the image resolution.\n\tlet horizontalPadding = 0;\n\tif ( window.innerWidth > 480 ) {\n\t\thorizontalPadding = 80;\n\t} else if ( window.innerWidth > 1920 ) {\n\t\thorizontalPadding = 160;\n\t}\n\tconst verticalPadding = 80;\n\n\tconst targetMaxWidth = Math.min(\n\t\twindow.innerWidth - horizontalPadding,\n\t\tcontainerWidth\n\t);\n\tconst targetMaxHeight = Math.min(\n\t\twindow.innerHeight - verticalPadding,\n\t\tcontainerHeight\n\t);\n\tconst targetContainerRatio = targetMaxWidth / targetMaxHeight;\n\n\tif ( originalRatio > targetContainerRatio ) {\n\t\t// If targetMaxWidth is reached before targetMaxHeight\n\t\tcontainerWidth = targetMaxWidth;\n\t\tcontainerHeight = containerWidth / originalRatio;\n\t} else {\n\t\t// If targetMaxHeight is reached before targetMaxWidth\n\t\tcontainerHeight = targetMaxHeight;\n\t\tcontainerWidth = containerHeight * originalRatio;\n\t}\n\n\tconst containerScale = originalWidth / containerWidth;\n\tconst lightboxImgWidth =\n\t\timgMaxWidth * ( containerWidth / containerMaxWidth );\n\tconst lightboxImgHeight =\n\t\timgMaxHeight * ( containerHeight / containerMaxHeight );\n\n\t// Add the CSS variables needed.\n\tlet styleTag = document.getElementById( 'wp-lightbox-styles' );\n\tif ( ! styleTag ) {\n\t\tstyleTag = document.createElement( 'style' );\n\t\tstyleTag.id = 'wp-lightbox-styles';\n\t\tdocument.head.appendChild( styleTag );\n\t}\n\n\t// As of this writing, using the calculations above will render the lightbox\n\t// with a small, erroneous whitespace on the left side of the image in iOS Safari,\n\t// perhaps due to an inconsistency in how browsers handle absolute positioning and CSS\n\t// transformation. In any case, adding 1 pixel to the container width and height solves\n\t// the problem, though this can be removed if the issue is fixed in the future.\n\tstyleTag.innerHTML = `\n\t\t:root {\n\t\t\t--wp--lightbox-initial-top-position: ${ screenPosY }px;\n\t\t\t--wp--lightbox-initial-left-position: ${ screenPosX }px;\n\t\t\t--wp--lightbox-container-width: ${ containerWidth + 1 }px;\n\t\t\t--wp--lightbox-container-height: ${ containerHeight + 1 }px;\n\t\t\t--wp--lightbox-image-width: ${ lightboxImgWidth }px;\n\t\t\t--wp--lightbox-image-height: ${ lightboxImgHeight }px;\n\t\t\t--wp--lightbox-scale: ${ containerScale };\n\t\t}\n\t`;\n}\n\n/*\n * Debounces a function call.\n *\n * @function\n * @param {Function} func - A function to be called\n * @param {number} wait - The time to wait before calling the function\n */\nfunction debounce( func, wait = 50 ) {\n\tlet timeout;\n\treturn () => {\n\t\tconst later = () => {\n\t\t\ttimeout = null;\n\t\t\tfunc();\n\t\t};\n\t\tclearTimeout( timeout );\n\t\ttimeout = setTimeout( later, wait );\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,QAAQ,0BAA0B;AAEhD,MAAMC,kBAAkB,GAAG,CAC1B,SAAS,EACT,YAAY,EACZ,+DAA+D,EAC/D,2CAA2C,EAC3C,6CAA6C,EAC7C,2CAA2C,EAC3C,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,mBAAmB,EACnB,iCAAiC,CACjC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAIC,cAAc;;AAElB;AAC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rG,QAAQ,CAACsG,IAAI,CAACC,WAAW,CAAEL,QAAS,CAAC;EACtC;;EAEA;EACA;EACA;EACA;EACA;EACAA,QAAQ,CAACM,SAAS,GAAI;AACvB;AACA,0CAA2ClC,UAAY;AACvD,2CAA4CF,UAAY;AACxD,qCAAsCe,cAAc,GAAG,CAAG;AAC1D,sCAAuCC,eAAe,GAAG,CAAG;AAC5D,iCAAkCY,gBAAkB;AACpD,kCAAmCC,iBAAmB;AACtD,2BAA4BF,cAAgB;AAC5C;AACA,EAAE;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASjC,QAAQA,CAAE2C,IAAI,EAAEC,IAAI,GAAG,EAAE,EAAG;EACpC,IAAIC,OAAO;EACX,OAAO,MAAM;IACZ,MAAMC,KAAK,GAAGA,CAAA,KAAM;MACnBD,OAAO,GAAG,IAAI;MACdF,IAAI,CAAC,CAAC;IACP,CAAC;IACDI,YAAY,CAAEF,OAAQ,CAAC;IACvBA,OAAO,GAAG7F,UAAU,CAAE8F,KAAK,EAAEF,IAAK,CAAC;EACpC,CAAC;AACF"}
|
|
@@ -29,6 +29,14 @@ const metadata = {
|
|
|
29
29
|
},
|
|
30
30
|
supports: {
|
|
31
31
|
className: true,
|
|
32
|
+
spacing: {
|
|
33
|
+
margin: true,
|
|
34
|
+
padding: true,
|
|
35
|
+
__experimentalDefaultControls: {
|
|
36
|
+
margin: false,
|
|
37
|
+
padding: false
|
|
38
|
+
}
|
|
39
|
+
},
|
|
32
40
|
typography: {
|
|
33
41
|
fontSize: true,
|
|
34
42
|
lineHeight: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["login","icon","initBlock","edit","metadata","$schema","apiVersion","name","title","category","description","keywords","textdomain","attributes","displayLoginAsForm","type","redirectToCurrent","supports","className","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","
|
|
1
|
+
{"version":3,"names":["login","icon","initBlock","edit","metadata","$schema","apiVersion","name","title","category","description","keywords","textdomain","attributes","displayLoginAsForm","type","redirectToCurrent","supports","className","spacing","margin","padding","__experimentalDefaultControls","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","settings","init"],"sources":["@wordpress/block-library/src/loginout/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { login as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport edit from './edit';\nimport metadata from './block.json';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,IAAI,QAAQ,kBAAkB;;AAEhD;AACA;AACA;AACA,OAAOC,SAAS,MAAM,qBAAqB;AAC3C,OAAOC,IAAI,MAAM,QAAQ;AAAC,MAAAC,QAAA;EAAAC,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,WAAA;EAAAC,QAAA;EAAAC,UAAA;EAAAC,UAAA;IAAAC,kBAAA;MAAAC,IAAA;MAAA;IAAA;IAAAC,iBAAA;MAAAD,IAAA;MAAA;IAAA;EAAA;EAAAE,QAAA;IAAAC,SAAA;IAAAC,OAAA;MAAAC,MAAA;MAAAC,OAAA;MAAAC,6BAAA;QAAAF,MAAA;QAAAC,OAAA;MAAA;IAAA;IAAAE,UAAA;MAAAC,QAAA;MAAAC,UAAA;MAAAC,wBAAA;MAAAC,wBAAA;MAAAC,uBAAA;MAAAC,2BAAA;MAAAC,4BAAA;MAAAC,2BAAA;MAAAT,6BAAA;QAAAE,QAAA;MAAA;IAAA;EAAA;AAAA;AAG1B,MAAM;EAAEjB;AAAK,CAAC,GAAGH,QAAQ;AACzB,SAASA,QAAQ,EAAEG,IAAI;AAEvB,OAAO,MAAMyB,QAAQ,GAAG;EACvB/B,IAAI;EACJE;AACD,CAAC;AAED,OAAO,MAAM8B,IAAI,GAAGA,CAAA,KAAM/B,SAAS,CAAE;EAAEK,IAAI;EAAEH,QAAQ;EAAE4B;AAAS,CAAE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createElement, Fragment } from "
|
|
1
|
+
import { createElement, Fragment } from "react";
|
|
2
2
|
/**
|
|
3
3
|
* External dependencies
|
|
4
4
|
*/
|
|
@@ -214,7 +214,7 @@ function MediaTextEdit({
|
|
|
214
214
|
}), mediaType === 'image' && createElement(ToggleControl, {
|
|
215
215
|
__nextHasNoMarginBottom: true,
|
|
216
216
|
label: __('Crop image to fill entire column'),
|
|
217
|
-
checked: imageFill,
|
|
217
|
+
checked: !!imageFill,
|
|
218
218
|
onChange: () => setAttributes({
|
|
219
219
|
imageFill: !imageFill
|
|
220
220
|
})
|