@wordpress/block-library 7.18.0 → 8.0.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 +8 -0
- package/build/audio/edit.native.js +1 -3
- package/build/audio/edit.native.js.map +1 -1
- package/build/audio/index.js +2 -1
- package/build/audio/index.js.map +1 -1
- package/build/avatar/edit.js +1 -0
- package/build/avatar/edit.js.map +1 -1
- package/build/avatar/user-control.js +1 -0
- package/build/avatar/user-control.js.map +1 -1
- package/build/block/edit.js +14 -2
- package/build/block/edit.js.map +1 -1
- package/build/block/edit.native.js +14 -6
- package/build/block/edit.native.js.map +1 -1
- package/build/block/index.js +1 -2
- package/build/block/index.js.map +1 -1
- package/build/button/deprecated.js +16 -2
- package/build/button/deprecated.js.map +1 -1
- package/build/button/edit.js +13 -7
- package/build/button/edit.js.map +1 -1
- package/build/button/edit.native.js.map +1 -1
- package/build/button/index.js +4 -1
- package/build/button/index.js.map +1 -1
- package/build/button/save.js +2 -0
- package/build/button/save.js.map +1 -1
- package/build/code/transforms.js +1 -1
- package/build/code/transforms.js.map +1 -1
- package/build/columns/edit.js +1 -0
- package/build/columns/edit.js.map +1 -1
- package/build/columns/edit.native.js +13 -30
- package/build/columns/edit.native.js.map +1 -1
- package/build/columns/transforms.js +5 -0
- package/build/columns/transforms.js.map +1 -1
- package/build/comment-author-avatar/edit.js +1 -0
- package/build/comment-author-avatar/edit.js.map +1 -1
- package/build/cover/edit/index.js +3 -1
- package/build/cover/edit/index.js.map +1 -1
- package/build/cover/edit/inspector-controls.js +2 -0
- package/build/cover/edit/inspector-controls.js.map +1 -1
- package/build/cover/edit.native.js +24 -16
- package/build/cover/edit.native.js.map +1 -1
- package/build/embed/embed-controls.native.js +1 -0
- package/build/embed/embed-controls.native.js.map +1 -1
- package/build/embed/embed-preview.native.js +1 -3
- package/build/embed/embed-preview.native.js.map +1 -1
- package/build/file/inspector.js +1 -0
- package/build/file/inspector.js.map +1 -1
- package/build/gallery/edit.js +25 -13
- package/build/gallery/edit.js.map +1 -1
- package/build/gallery/gallery.native.js +1 -3
- package/build/gallery/gallery.native.js.map +1 -1
- package/build/gallery/shared.js +4 -10
- package/build/gallery/shared.js.map +1 -1
- package/build/gallery/transforms.js +1 -7
- package/build/gallery/transforms.js.map +1 -1
- package/build/gallery/use-get-media.js +1 -1
- package/build/gallery/use-get-media.js.map +1 -1
- package/build/gallery/use-get-media.native.js +3 -1
- package/build/gallery/use-get-media.native.js.map +1 -1
- package/build/gallery/v1/edit.js +26 -17
- package/build/gallery/v1/edit.js.map +1 -1
- package/build/gallery/v1/gallery.native.js +1 -3
- package/build/gallery/v1/gallery.native.js.map +1 -1
- package/build/gallery/v1/shared.js +4 -1
- package/build/gallery/v1/shared.js.map +1 -1
- package/build/group/edit.js +97 -45
- package/build/group/edit.js.map +1 -1
- package/build/group/index.js +6 -1
- package/build/group/index.js.map +1 -1
- package/build/group/placeholder.js +147 -0
- package/build/group/placeholder.js.map +1 -0
- package/build/group/variations.js +3 -3
- package/build/group/variations.js.map +1 -1
- package/build/heading/deprecated.js +152 -69
- package/build/heading/deprecated.js.map +1 -1
- package/build/heading/index.js +1 -2
- package/build/heading/index.js.map +1 -1
- package/build/heading/transforms.js +1 -2
- package/build/heading/transforms.js.map +1 -1
- package/build/html/index.js +1 -1
- package/build/image/edit.js +8 -5
- package/build/image/edit.js.map +1 -1
- package/build/image/edit.native.js +3 -2
- package/build/image/edit.native.js.map +1 -1
- package/build/image/image.js +12 -8
- package/build/image/image.js.map +1 -1
- package/build/index.js +3 -1
- package/build/index.js.map +1 -1
- package/build/latest-comments/edit.js +3 -1
- package/build/latest-comments/edit.js.map +1 -1
- package/build/latest-comments/index.js +5 -1
- package/build/latest-comments/index.js.map +1 -1
- package/build/latest-posts/deprecated.js +13 -0
- package/build/latest-posts/deprecated.js.map +1 -1
- package/build/latest-posts/edit.js +2 -0
- package/build/latest-posts/edit.js.map +1 -1
- package/build/latest-posts/index.js +13 -0
- package/build/latest-posts/index.js.map +1 -1
- package/build/list/transforms.js +1 -9
- package/build/list/transforms.js.map +1 -1
- package/build/list/utils.js +5 -2
- package/build/list/utils.js.map +1 -1
- package/build/list-item/edit.js +2 -1
- package/build/list-item/edit.js.map +1 -1
- package/build/list-item/index.js +4 -1
- package/build/list-item/index.js.map +1 -1
- package/build/list-item/transforms.js +22 -0
- package/build/list-item/transforms.js.map +1 -0
- package/build/list-item/utils.js +77 -1
- package/build/list-item/utils.js.map +1 -1
- package/build/media-text/edit.js +4 -2
- package/build/media-text/edit.js.map +1 -1
- package/build/navigation/edit/are-blocks-dirty.js +52 -0
- package/build/navigation/edit/are-blocks-dirty.js.map +1 -0
- package/build/navigation/edit/index.js +112 -143
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/manage-menus-button.js +36 -0
- package/build/navigation/edit/manage-menus-button.js.map +1 -0
- package/build/navigation/edit/menu-inspector-controls.js +72 -0
- package/build/navigation/edit/menu-inspector-controls.js.map +1 -0
- package/build/navigation/edit/navigation-menu-selector.js +3 -1
- package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build/navigation/edit/responsive-wrapper.js +2 -6
- package/build/navigation/edit/responsive-wrapper.js.map +1 -1
- package/build/navigation/edit/unsaved-inner-blocks.js +15 -25
- package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build/navigation/view-modal.js +6 -2
- package/build/navigation/view-modal.js.map +1 -1
- package/build/navigation-link/edit.js +52 -299
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-link/link-ui.js +222 -0
- package/build/navigation-link/link-ui.js.map +1 -0
- package/build/navigation-link/transforms.js +12 -0
- package/build/navigation-link/transforms.js.map +1 -1
- package/build/navigation-link/update-attributes.js +108 -0
- package/build/navigation-link/update-attributes.js.map +1 -0
- package/build/navigation-submenu/edit.js +42 -173
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/page-list/constants.js +15 -0
- package/build/page-list/constants.js.map +1 -0
- package/build/page-list/convert-to-links-modal.js +22 -86
- package/build/page-list/convert-to-links-modal.js.map +1 -1
- package/build/page-list/convert-to-navigation-links.js +76 -0
- package/build/page-list/convert-to-navigation-links.js.map +1 -0
- package/build/page-list/edit.js +142 -78
- package/build/page-list/edit.js.map +1 -1
- package/build/page-list/index.js +6 -1
- package/build/page-list/index.js.map +1 -1
- package/build/page-list-item/edit.js +87 -0
- package/build/page-list-item/edit.js.map +1 -0
- package/build/page-list-item/index.js +85 -0
- package/build/page-list-item/index.js.map +1 -0
- package/build/page-list-item/init.js +16 -0
- package/build/page-list-item/init.js.map +1 -0
- package/build/paragraph/index.js +1 -7
- package/build/paragraph/index.js.map +1 -1
- package/build/post-author/edit.js +38 -22
- package/build/post-author/edit.js.map +1 -1
- package/build/post-content/index.js +3 -0
- package/build/post-content/index.js.map +1 -1
- package/build/post-featured-image/overlay.js +1 -0
- package/build/post-featured-image/overlay.js.map +1 -1
- package/build/post-template/index.js +8 -0
- package/build/post-template/index.js.map +1 -1
- package/build/preformatted/transforms.js +3 -1
- package/build/preformatted/transforms.js.map +1 -1
- package/build/query/deprecated.js +192 -21
- package/build/query/deprecated.js.map +1 -1
- package/build/query/edit/inspector-controls/index.js +1 -0
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/edit/query-placeholder.js +3 -19
- package/build/query/edit/query-placeholder.js.map +1 -1
- package/build/query/index.js +0 -8
- package/build/query/index.js.map +1 -1
- package/build/query/utils.js +0 -8
- package/build/query/utils.js.map +1 -1
- package/build/rss/edit.js +3 -0
- package/build/rss/edit.js.map +1 -1
- package/build/search/edit.native.js +22 -22
- package/build/search/edit.native.js.map +1 -1
- package/build/search/index.js +9 -1
- package/build/search/index.js.map +1 -1
- package/build/site-logo/edit.js +18 -10
- package/build/site-logo/edit.js.map +1 -1
- package/build/site-logo/index.js +1 -0
- package/build/site-logo/index.js.map +1 -1
- package/build/site-title/index.js +1 -0
- package/build/site-title/index.js.map +1 -1
- package/build/social-link/social-list.js +4 -12
- package/build/social-link/social-list.js.map +1 -1
- package/build/table/edit.js +3 -1
- package/build/table/edit.js.map +1 -1
- package/build/table/index.js +17 -1
- package/build/table/index.js.map +1 -1
- package/build/table/save.js +4 -2
- package/build/table/save.js.map +1 -1
- package/build/table/state.js +24 -12
- package/build/table/state.js.map +1 -1
- package/build/table/transforms.js +3 -2
- package/build/table/transforms.js.map +1 -1
- package/build/table-of-contents/edit.js +2 -2
- package/build/table-of-contents/edit.js.map +1 -1
- package/build/tag-cloud/edit.js +2 -1
- package/build/tag-cloud/edit.js.map +1 -1
- package/build/template-part/edit/selection-modal.js +5 -2
- package/build/template-part/edit/selection-modal.js.map +1 -1
- package/build/template-part/edit/utils/hooks.js +2 -6
- package/build/template-part/edit/utils/hooks.js.map +1 -1
- package/build/template-part/variations.js +5 -0
- package/build/template-part/variations.js.map +1 -1
- package/build/text-columns/edit.js +1 -0
- package/build/text-columns/edit.js.map +1 -1
- package/build/utils/transformation-categories.native.js +1 -1
- package/build/utils/transformation-categories.native.js.map +1 -1
- package/build/video/edit.js +1 -1
- package/build/video/edit.js.map +1 -1
- package/build/video/edit.native.js +1 -3
- package/build/video/edit.native.js.map +1 -1
- package/build-module/audio/edit.native.js +1 -2
- package/build-module/audio/edit.native.js.map +1 -1
- package/build-module/audio/index.js +2 -1
- package/build-module/audio/index.js.map +1 -1
- package/build-module/avatar/edit.js +1 -0
- package/build-module/avatar/edit.js.map +1 -1
- package/build-module/avatar/user-control.js +1 -0
- package/build-module/avatar/user-control.js.map +1 -1
- package/build-module/block/edit.js +14 -2
- package/build-module/block/edit.js.map +1 -1
- package/build-module/block/edit.native.js +14 -6
- package/build-module/block/edit.native.js.map +1 -1
- package/build-module/block/index.js +1 -2
- package/build-module/block/index.js.map +1 -1
- package/build-module/button/deprecated.js +16 -2
- package/build-module/button/deprecated.js.map +1 -1
- package/build-module/button/edit.js +15 -9
- package/build-module/button/edit.js.map +1 -1
- package/build-module/button/edit.native.js +2 -1
- package/build-module/button/edit.native.js.map +1 -1
- package/build-module/button/index.js +4 -1
- package/build-module/button/index.js.map +1 -1
- package/build-module/button/save.js +2 -0
- package/build-module/button/save.js.map +1 -1
- package/build-module/code/transforms.js +1 -1
- package/build-module/code/transforms.js.map +1 -1
- package/build-module/columns/edit.js +1 -0
- package/build-module/columns/edit.js.map +1 -1
- package/build-module/columns/edit.native.js +13 -29
- package/build-module/columns/edit.native.js.map +1 -1
- package/build-module/columns/transforms.js +5 -0
- package/build-module/columns/transforms.js.map +1 -1
- package/build-module/comment-author-avatar/edit.js +1 -0
- package/build-module/comment-author-avatar/edit.js.map +1 -1
- package/build-module/cover/edit/index.js +3 -1
- package/build-module/cover/edit/index.js.map +1 -1
- package/build-module/cover/edit/inspector-controls.js +2 -0
- package/build-module/cover/edit/inspector-controls.js.map +1 -1
- package/build-module/cover/edit.native.js +22 -14
- package/build-module/cover/edit.native.js.map +1 -1
- package/build-module/embed/embed-controls.native.js +2 -1
- package/build-module/embed/embed-controls.native.js.map +1 -1
- package/build-module/embed/embed-preview.native.js +1 -2
- package/build-module/embed/embed-preview.native.js.map +1 -1
- package/build-module/file/inspector.js +1 -0
- package/build-module/file/inspector.js.map +1 -1
- package/build-module/gallery/edit.js +25 -12
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/gallery/gallery.native.js +1 -2
- package/build-module/gallery/gallery.native.js.map +1 -1
- package/build-module/gallery/shared.js +5 -11
- package/build-module/gallery/shared.js.map +1 -1
- package/build-module/gallery/transforms.js +1 -6
- package/build-module/gallery/transforms.js.map +1 -1
- package/build-module/gallery/use-get-media.js +1 -1
- package/build-module/gallery/use-get-media.js.map +1 -1
- package/build-module/gallery/use-get-media.native.js +3 -1
- package/build-module/gallery/use-get-media.native.js.map +1 -1
- package/build-module/gallery/v1/edit.js +27 -18
- package/build-module/gallery/v1/edit.js.map +1 -1
- package/build-module/gallery/v1/gallery.native.js +1 -2
- package/build-module/gallery/v1/gallery.native.js.map +1 -1
- package/build-module/gallery/v1/shared.js +5 -2
- package/build-module/gallery/v1/shared.js.map +1 -1
- package/build-module/group/edit.js +92 -45
- package/build-module/group/edit.js.map +1 -1
- package/build-module/group/index.js +6 -1
- package/build-module/group/index.js.map +1 -1
- package/build-module/group/placeholder.js +133 -0
- package/build-module/group/placeholder.js.map +1 -0
- package/build-module/group/variations.js +3 -3
- package/build-module/group/variations.js.map +1 -1
- package/build-module/heading/deprecated.js +152 -69
- package/build-module/heading/deprecated.js.map +1 -1
- package/build-module/heading/index.js +1 -2
- package/build-module/heading/index.js.map +1 -1
- package/build-module/heading/transforms.js +1 -2
- package/build-module/heading/transforms.js.map +1 -1
- package/build-module/html/index.js +1 -1
- package/build-module/image/edit.js +9 -6
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/edit.native.js +2 -1
- package/build-module/image/edit.native.js.map +1 -1
- package/build-module/image/image.js +13 -9
- package/build-module/image/image.js.map +1 -1
- package/build-module/index.js +2 -1
- package/build-module/index.js.map +1 -1
- package/build-module/latest-comments/edit.js +3 -1
- package/build-module/latest-comments/edit.js.map +1 -1
- package/build-module/latest-comments/index.js +5 -1
- package/build-module/latest-comments/index.js.map +1 -1
- package/build-module/latest-posts/deprecated.js +13 -0
- package/build-module/latest-posts/deprecated.js.map +1 -1
- package/build-module/latest-posts/edit.js +2 -0
- package/build-module/latest-posts/edit.js.map +1 -1
- package/build-module/latest-posts/index.js +13 -0
- package/build-module/latest-posts/index.js.map +1 -1
- package/build-module/list/transforms.js +1 -9
- package/build-module/list/transforms.js.map +1 -1
- package/build-module/list/utils.js +5 -2
- package/build-module/list/utils.js.map +1 -1
- package/build-module/list-item/edit.js +2 -1
- package/build-module/list-item/edit.js.map +1 -1
- package/build-module/list-item/index.js +3 -1
- package/build-module/list-item/index.js.map +1 -1
- package/build-module/list-item/transforms.js +13 -0
- package/build-module/list-item/transforms.js.map +1 -0
- package/build-module/list-item/utils.js +78 -1
- package/build-module/list-item/utils.js.map +1 -1
- package/build-module/media-text/edit.js +5 -3
- package/build-module/media-text/edit.js.map +1 -1
- package/build-module/navigation/edit/are-blocks-dirty.js +44 -0
- package/build-module/navigation/edit/are-blocks-dirty.js.map +1 -0
- package/build-module/navigation/edit/index.js +111 -143
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/manage-menus-button.js +26 -0
- package/build-module/navigation/edit/manage-menus-button.js.map +1 -0
- package/build-module/navigation/edit/menu-inspector-controls.js +59 -0
- package/build-module/navigation/edit/menu-inspector-controls.js.map +1 -0
- package/build-module/navigation/edit/navigation-menu-selector.js +3 -1
- package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build-module/navigation/edit/responsive-wrapper.js +2 -6
- package/build-module/navigation/edit/responsive-wrapper.js.map +1 -1
- package/build-module/navigation/edit/unsaved-inner-blocks.js +16 -26
- package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build-module/navigation/view-modal.js +6 -2
- package/build-module/navigation/view-modal.js.map +1 -1
- package/build-module/navigation-link/edit.js +56 -300
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-link/link-ui.js +206 -0
- package/build-module/navigation-link/link-ui.js.map +1 -0
- package/build-module/navigation-link/transforms.js +12 -0
- package/build-module/navigation-link/transforms.js.map +1 -1
- package/build-module/navigation-link/update-attributes.js +97 -0
- package/build-module/navigation-link/update-attributes.js.map +1 -0
- package/build-module/navigation-submenu/edit.js +47 -175
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/page-list/constants.js +6 -0
- package/build-module/page-list/constants.js.map +1 -0
- package/build-module/page-list/convert-to-links-modal.js +20 -81
- package/build-module/page-list/convert-to-links-modal.js.map +1 -1
- package/build-module/page-list/convert-to-navigation-links.js +66 -0
- package/build-module/page-list/convert-to-navigation-links.js.map +1 -0
- package/build-module/page-list/edit.js +144 -82
- package/build-module/page-list/edit.js.map +1 -1
- package/build-module/page-list/index.js +6 -1
- package/build-module/page-list/index.js.map +1 -1
- package/build-module/page-list-item/edit.js +74 -0
- package/build-module/page-list-item/edit.js.map +1 -0
- package/build-module/page-list-item/index.js +68 -0
- package/build-module/page-list-item/index.js.map +1 -0
- package/build-module/page-list-item/init.js +6 -0
- package/build-module/page-list-item/init.js.map +1 -0
- package/build-module/paragraph/index.js +1 -7
- package/build-module/paragraph/index.js.map +1 -1
- package/build-module/post-author/edit.js +38 -23
- package/build-module/post-author/edit.js.map +1 -1
- package/build-module/post-content/index.js +3 -0
- package/build-module/post-content/index.js.map +1 -1
- package/build-module/post-featured-image/overlay.js +1 -0
- package/build-module/post-featured-image/overlay.js.map +1 -1
- package/build-module/post-template/index.js +8 -0
- package/build-module/post-template/index.js.map +1 -1
- package/build-module/preformatted/transforms.js +3 -1
- package/build-module/preformatted/transforms.js.map +1 -1
- package/build-module/query/deprecated.js +185 -21
- package/build-module/query/deprecated.js.map +1 -1
- package/build-module/query/edit/inspector-controls/index.js +1 -0
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/query/edit/query-placeholder.js +3 -19
- package/build-module/query/edit/query-placeholder.js.map +1 -1
- package/build-module/query/index.js +0 -8
- package/build-module/query/index.js.map +1 -1
- package/build-module/query/utils.js +0 -8
- package/build-module/query/utils.js.map +1 -1
- package/build-module/rss/edit.js +3 -0
- package/build-module/rss/edit.js.map +1 -1
- package/build-module/search/edit.native.js +20 -20
- package/build-module/search/edit.native.js.map +1 -1
- package/build-module/search/index.js +8 -1
- package/build-module/search/index.js.map +1 -1
- package/build-module/site-logo/edit.js +18 -9
- package/build-module/site-logo/edit.js.map +1 -1
- package/build-module/site-logo/index.js +1 -0
- package/build-module/site-logo/index.js.map +1 -1
- package/build-module/site-title/index.js +1 -0
- package/build-module/site-title/index.js.map +1 -1
- package/build-module/social-link/social-list.js +2 -11
- package/build-module/social-link/social-list.js.map +1 -1
- package/build-module/table/edit.js +3 -1
- package/build-module/table/edit.js.map +1 -1
- package/build-module/table/index.js +17 -1
- package/build-module/table/index.js.map +1 -1
- package/build-module/table/save.js +4 -2
- package/build-module/table/save.js.map +1 -1
- package/build-module/table/state.js +25 -13
- package/build-module/table/state.js.map +1 -1
- package/build-module/table/transforms.js +3 -2
- package/build-module/table/transforms.js.map +1 -1
- package/build-module/table-of-contents/edit.js +2 -2
- package/build-module/table-of-contents/edit.js.map +1 -1
- package/build-module/tag-cloud/edit.js +3 -2
- package/build-module/tag-cloud/edit.js.map +1 -1
- package/build-module/template-part/edit/selection-modal.js +6 -3
- package/build-module/template-part/edit/selection-modal.js.map +1 -1
- package/build-module/template-part/edit/utils/hooks.js +3 -7
- package/build-module/template-part/edit/utils/hooks.js.map +1 -1
- package/build-module/template-part/variations.js +5 -0
- package/build-module/template-part/variations.js.map +1 -1
- package/build-module/text-columns/edit.js +1 -0
- package/build-module/text-columns/edit.js.map +1 -1
- package/build-module/utils/transformation-categories.native.js +1 -1
- package/build-module/utils/transformation-categories.native.js.map +1 -1
- package/build-module/video/edit.js +1 -1
- package/build-module/video/edit.js.map +1 -1
- package/build-module/video/edit.native.js +1 -2
- package/build-module/video/edit.native.js.map +1 -1
- package/build-style/archives/editor-rtl.css +12 -0
- package/build-style/archives/editor.css +12 -0
- package/build-style/archives/style-rtl.css +12 -0
- package/build-style/archives/style.css +12 -0
- package/build-style/audio/editor-rtl.css +12 -0
- package/build-style/audio/editor.css +12 -0
- package/build-style/audio/style-rtl.css +12 -0
- package/build-style/audio/style.css +12 -0
- package/build-style/audio/theme-rtl.css +12 -0
- package/build-style/audio/theme.css +12 -0
- package/build-style/avatar/editor-rtl.css +12 -0
- package/build-style/avatar/editor.css +12 -0
- package/build-style/avatar/style-rtl.css +12 -0
- package/build-style/avatar/style.css +12 -0
- package/build-style/block/editor-rtl.css +22 -0
- package/build-style/block/editor.css +22 -0
- package/build-style/button/editor-rtl.css +12 -0
- package/build-style/button/editor.css +12 -0
- package/build-style/button/style-rtl.css +12 -0
- package/build-style/button/style.css +12 -0
- package/build-style/buttons/editor-rtl.css +12 -0
- package/build-style/buttons/editor.css +12 -0
- package/build-style/buttons/style-rtl.css +12 -0
- package/build-style/buttons/style.css +12 -0
- package/build-style/calendar/style-rtl.css +12 -0
- package/build-style/calendar/style.css +12 -0
- package/build-style/categories/editor-rtl.css +12 -0
- package/build-style/categories/editor.css +12 -0
- package/build-style/categories/style-rtl.css +12 -0
- package/build-style/categories/style.css +12 -0
- package/build-style/classic-rtl.css +12 -0
- package/build-style/classic.css +12 -0
- package/build-style/code/editor-rtl.css +12 -0
- package/build-style/code/editor.css +12 -0
- package/build-style/code/style-rtl.css +12 -0
- package/build-style/code/style.css +12 -0
- package/build-style/code/theme-rtl.css +12 -0
- package/build-style/code/theme.css +12 -0
- package/build-style/columns/editor-rtl.css +12 -0
- package/build-style/columns/editor.css +12 -0
- package/build-style/columns/style-rtl.css +12 -0
- package/build-style/columns/style.css +12 -0
- package/build-style/comment-author-avatar/editor-rtl.css +12 -0
- package/build-style/comment-author-avatar/editor.css +12 -0
- package/build-style/comment-content/style-rtl.css +12 -0
- package/build-style/comment-content/style.css +12 -0
- package/build-style/comment-template/style-rtl.css +12 -0
- package/build-style/comment-template/style.css +12 -0
- package/build-style/comments/editor-rtl.css +12 -0
- package/build-style/comments/editor.css +12 -0
- package/build-style/comments/style-rtl.css +12 -0
- package/build-style/comments/style.css +12 -0
- package/build-style/comments-pagination/editor-rtl.css +12 -0
- package/build-style/comments-pagination/editor.css +12 -0
- package/build-style/comments-pagination/style-rtl.css +12 -0
- package/build-style/comments-pagination/style.css +12 -0
- package/build-style/comments-pagination-numbers/editor-rtl.css +12 -0
- package/build-style/comments-pagination-numbers/editor.css +12 -0
- package/build-style/comments-title/editor-rtl.css +12 -0
- package/build-style/comments-title/editor.css +12 -0
- package/build-style/common-rtl.css +17 -1
- package/build-style/common.css +17 -1
- package/build-style/cover/editor-rtl.css +12 -0
- package/build-style/cover/editor.css +12 -0
- package/build-style/cover/style-rtl.css +14 -1
- package/build-style/cover/style.css +14 -1
- package/build-style/editor-elements-rtl.css +12 -0
- package/build-style/editor-elements.css +12 -0
- package/build-style/editor-rtl.css +115 -21
- package/build-style/editor.css +115 -21
- package/build-style/elements-rtl.css +12 -0
- package/build-style/elements.css +12 -0
- package/build-style/embed/editor-rtl.css +12 -0
- package/build-style/embed/editor.css +12 -0
- package/build-style/embed/style-rtl.css +12 -0
- package/build-style/embed/style.css +12 -0
- package/build-style/embed/theme-rtl.css +12 -0
- package/build-style/embed/theme.css +12 -0
- package/build-style/file/editor-rtl.css +12 -0
- package/build-style/file/editor.css +12 -0
- package/build-style/file/style-rtl.css +12 -0
- package/build-style/file/style.css +12 -0
- package/build-style/freeform/editor-rtl.css +12 -0
- package/build-style/freeform/editor.css +12 -0
- package/build-style/gallery/editor-rtl.css +13 -1
- package/build-style/gallery/editor.css +13 -1
- package/build-style/gallery/style-rtl.css +16 -2
- package/build-style/gallery/style.css +16 -2
- package/build-style/gallery/theme-rtl.css +12 -0
- package/build-style/gallery/theme.css +12 -0
- package/build-style/group/editor-rtl.css +56 -0
- package/build-style/group/editor.css +56 -0
- package/build-style/group/style-rtl.css +12 -0
- package/build-style/group/style.css +12 -0
- package/build-style/group/theme-rtl.css +12 -0
- package/build-style/group/theme.css +12 -0
- package/build-style/heading/style-rtl.css +12 -0
- package/build-style/heading/style.css +12 -0
- package/build-style/html/editor-rtl.css +12 -0
- package/build-style/html/editor.css +12 -0
- package/build-style/image/editor-rtl.css +12 -9
- package/build-style/image/editor.css +12 -9
- package/build-style/image/style-rtl.css +12 -0
- package/build-style/image/style.css +12 -0
- package/build-style/image/theme-rtl.css +12 -0
- package/build-style/image/theme.css +12 -0
- package/build-style/latest-comments/style-rtl.css +13 -0
- package/build-style/latest-comments/style.css +13 -0
- package/build-style/latest-posts/editor-rtl.css +12 -0
- package/build-style/latest-posts/editor.css +12 -0
- package/build-style/latest-posts/style-rtl.css +15 -0
- package/build-style/latest-posts/style.css +15 -0
- package/build-style/list/style-rtl.css +12 -0
- package/build-style/list/style.css +12 -0
- package/build-style/media-text/editor-rtl.css +12 -0
- package/build-style/media-text/editor.css +12 -0
- package/build-style/media-text/style-rtl.css +12 -0
- package/build-style/media-text/style.css +12 -0
- package/build-style/more/editor-rtl.css +12 -0
- package/build-style/more/editor.css +12 -0
- package/build-style/navigation/editor-rtl.css +35 -0
- package/build-style/navigation/editor.css +35 -0
- package/build-style/navigation/style-rtl.css +22 -0
- package/build-style/navigation/style.css +22 -0
- package/build-style/navigation-link/editor-rtl.css +20 -1
- package/build-style/navigation-link/editor.css +20 -1
- package/build-style/navigation-link/style-rtl.css +12 -0
- package/build-style/navigation-link/style.css +12 -0
- package/build-style/navigation-submenu/editor-rtl.css +12 -0
- package/build-style/navigation-submenu/editor.css +12 -0
- package/build-style/nextpage/editor-rtl.css +12 -0
- package/build-style/nextpage/editor.css +12 -0
- package/build-style/page-list/editor-rtl.css +12 -0
- package/build-style/page-list/editor.css +12 -0
- package/build-style/page-list/style-rtl.css +12 -0
- package/build-style/page-list/style.css +12 -0
- package/build-style/paragraph/editor-rtl.css +12 -0
- package/build-style/paragraph/editor.css +12 -0
- package/build-style/paragraph/style-rtl.css +12 -0
- package/build-style/paragraph/style.css +12 -0
- package/build-style/post-author/style-rtl.css +12 -0
- package/build-style/post-author/style.css +12 -0
- package/build-style/post-comments-form/editor-rtl.css +12 -0
- package/build-style/post-comments-form/editor.css +12 -0
- package/build-style/post-comments-form/style-rtl.css +12 -0
- package/build-style/post-comments-form/style.css +12 -0
- package/build-style/post-date/style-rtl.css +12 -0
- package/build-style/post-date/style.css +12 -0
- package/build-style/post-excerpt/editor-rtl.css +12 -0
- package/build-style/post-excerpt/editor.css +12 -0
- package/build-style/post-excerpt/style-rtl.css +12 -0
- package/build-style/post-excerpt/style.css +12 -0
- package/build-style/post-featured-image/editor-rtl.css +12 -0
- package/build-style/post-featured-image/editor.css +12 -0
- package/build-style/post-featured-image/style-rtl.css +12 -0
- package/build-style/post-featured-image/style.css +12 -0
- package/build-style/post-navigation-link/style-rtl.css +12 -0
- package/build-style/post-navigation-link/style.css +12 -0
- package/build-style/post-template/editor-rtl.css +12 -0
- package/build-style/post-template/editor.css +12 -0
- package/build-style/post-template/style-rtl.css +12 -0
- package/build-style/post-template/style.css +12 -0
- package/build-style/post-terms/style-rtl.css +12 -0
- package/build-style/post-terms/style.css +12 -0
- package/build-style/post-title/style-rtl.css +12 -0
- package/build-style/post-title/style.css +12 -0
- package/build-style/preformatted/style-rtl.css +12 -0
- package/build-style/preformatted/style.css +12 -0
- package/build-style/pullquote/editor-rtl.css +12 -0
- package/build-style/pullquote/editor.css +12 -0
- package/build-style/pullquote/style-rtl.css +12 -0
- package/build-style/pullquote/style.css +12 -0
- package/build-style/pullquote/theme-rtl.css +12 -0
- package/build-style/pullquote/theme.css +12 -0
- package/build-style/query/editor-rtl.css +13 -1
- package/build-style/query/editor.css +13 -1
- package/build-style/query-pagination/editor-rtl.css +12 -0
- package/build-style/query-pagination/editor.css +12 -0
- package/build-style/query-pagination/style-rtl.css +13 -1
- package/build-style/query-pagination/style.css +13 -1
- package/build-style/query-pagination-numbers/editor-rtl.css +12 -0
- package/build-style/query-pagination-numbers/editor.css +12 -0
- package/build-style/query-title/style-rtl.css +12 -0
- package/build-style/query-title/style.css +12 -0
- package/build-style/quote/style-rtl.css +12 -0
- package/build-style/quote/style.css +12 -0
- package/build-style/quote/theme-rtl.css +12 -0
- package/build-style/quote/theme.css +12 -0
- package/build-style/read-more/style-rtl.css +12 -0
- package/build-style/read-more/style.css +12 -0
- package/build-style/reset-rtl.css +12 -0
- package/build-style/reset.css +12 -0
- package/build-style/rss/editor-rtl.css +12 -0
- package/build-style/rss/editor.css +12 -0
- package/build-style/rss/style-rtl.css +12 -0
- package/build-style/rss/style.css +12 -0
- package/build-style/search/editor-rtl.css +12 -0
- package/build-style/search/editor.css +12 -0
- package/build-style/search/style-rtl.css +12 -0
- package/build-style/search/style.css +12 -0
- package/build-style/search/theme-rtl.css +12 -0
- package/build-style/search/theme.css +12 -0
- package/build-style/separator/editor-rtl.css +12 -0
- package/build-style/separator/editor.css +12 -0
- package/build-style/separator/style-rtl.css +12 -0
- package/build-style/separator/style.css +12 -0
- package/build-style/separator/theme-rtl.css +12 -0
- package/build-style/separator/theme.css +12 -0
- package/build-style/shortcode/editor-rtl.css +13 -1
- package/build-style/shortcode/editor.css +13 -1
- package/build-style/site-logo/editor-rtl.css +12 -0
- package/build-style/site-logo/editor.css +12 -0
- package/build-style/site-logo/style-rtl.css +12 -0
- package/build-style/site-logo/style.css +12 -0
- package/build-style/site-tagline/editor-rtl.css +12 -0
- package/build-style/site-tagline/editor.css +12 -0
- package/build-style/site-title/editor-rtl.css +12 -0
- package/build-style/site-title/editor.css +12 -0
- package/build-style/site-title/style-rtl.css +12 -0
- package/build-style/site-title/style.css +12 -0
- package/build-style/social-link/editor-rtl.css +12 -0
- package/build-style/social-link/editor.css +12 -0
- package/build-style/social-links/editor-rtl.css +12 -0
- package/build-style/social-links/editor.css +12 -0
- package/build-style/social-links/style-rtl.css +12 -0
- package/build-style/social-links/style.css +12 -0
- package/build-style/spacer/editor-rtl.css +12 -0
- package/build-style/spacer/editor.css +12 -0
- package/build-style/spacer/style-rtl.css +12 -0
- package/build-style/spacer/style.css +12 -0
- package/build-style/style-rtl.css +43 -6
- package/build-style/style.css +43 -6
- package/build-style/table/editor-rtl.css +13 -8
- package/build-style/table/editor.css +13 -8
- package/build-style/table/style-rtl.css +17 -0
- package/build-style/table/style.css +17 -0
- package/build-style/table/theme-rtl.css +13 -3
- package/build-style/table/theme.css +13 -3
- package/build-style/tag-cloud/style-rtl.css +12 -0
- package/build-style/tag-cloud/style.css +12 -0
- package/build-style/template-part/editor-rtl.css +27 -1
- package/build-style/template-part/editor.css +27 -1
- package/build-style/template-part/theme-rtl.css +12 -0
- package/build-style/template-part/theme.css +12 -0
- package/build-style/text-columns/editor-rtl.css +12 -0
- package/build-style/text-columns/editor.css +12 -0
- package/build-style/text-columns/style-rtl.css +12 -0
- package/build-style/text-columns/style.css +12 -0
- package/build-style/theme-rtl.css +13 -3
- package/build-style/theme.css +13 -3
- package/build-style/verse/style-rtl.css +12 -0
- package/build-style/verse/style.css +12 -0
- package/build-style/video/editor-rtl.css +12 -0
- package/build-style/video/editor.css +12 -0
- package/build-style/video/style-rtl.css +14 -1
- package/build-style/video/style.css +14 -1
- package/build-style/video/theme-rtl.css +12 -0
- package/build-style/video/theme.css +12 -0
- package/package.json +32 -30
- package/src/audio/edit.native.js +1 -2
- package/src/audio/index.js +1 -0
- package/src/avatar/edit.js +1 -0
- package/src/avatar/index.php +1 -1
- package/src/avatar/user-control.js +1 -0
- package/src/block/block.json +1 -2
- package/src/block/edit.js +14 -3
- package/src/block/edit.native.js +24 -12
- package/src/block/editor.scss +17 -0
- package/src/block/index.php +1 -2
- package/src/block/test/edit.native.js +28 -32
- package/src/button/block.json +4 -1
- package/src/button/deprecated.js +18 -2
- package/src/button/edit.js +11 -9
- package/src/button/edit.native.js +1 -0
- package/src/button/save.js +12 -2
- package/src/buttons/test/edit.native.js +41 -52
- package/src/code/transforms.js +3 -1
- package/src/columns/edit.js +1 -0
- package/src/columns/edit.native.js +18 -26
- package/src/columns/test/edit.native.js +32 -32
- package/src/columns/transforms.js +8 -0
- package/src/comment-author-avatar/edit.js +1 -0
- package/src/cover/edit/index.js +3 -1
- package/src/cover/edit/inspector-controls.js +2 -0
- package/src/cover/edit.native.js +32 -19
- package/src/cover/test/edit.native.js +77 -130
- package/src/embed/embed-controls.native.js +1 -0
- package/src/embed/embed-preview.native.js +1 -2
- package/src/embed/test/index.native.js +251 -245
- package/src/file/inspector.js +1 -0
- package/src/file/test/__snapshots__/edit.native.js.snap +2 -6
- package/src/gallery/edit.js +15 -5
- package/src/gallery/gallery.native.js +1 -2
- package/src/gallery/shared.js +7 -11
- package/src/gallery/test/index.native.js +11 -11
- package/src/gallery/transforms.js +1 -6
- package/src/gallery/use-get-media.js +1 -1
- package/src/gallery/use-get-media.native.js +2 -1
- package/src/gallery/v1/edit.js +26 -30
- package/src/gallery/v1/gallery.native.js +1 -2
- package/src/gallery/v1/shared.js +7 -2
- package/src/group/block.json +6 -1
- package/src/group/edit.js +91 -44
- package/src/group/editor.scss +48 -0
- package/src/group/placeholder.js +168 -0
- package/src/group/test/__snapshots__/edit.native.js.snap +1 -1
- package/src/group/test/edit.native.js +3 -3
- package/src/group/test/placeholder.js +78 -0
- package/src/group/variations.js +3 -3
- package/src/heading/block.json +1 -2
- package/src/heading/deprecated.js +209 -136
- package/src/heading/index.php +52 -0
- package/src/heading/test/__snapshots__/index.native.js.snap +7 -0
- package/src/heading/test/index.native.js +44 -0
- package/src/home-link/index.php +1 -1
- package/src/html/block.json +1 -1
- package/src/image/edit.js +7 -2
- package/src/image/edit.native.js +2 -1
- package/src/image/editor.scss +0 -11
- package/src/image/image.js +13 -8
- package/src/image/test/edit.native.js +24 -20
- package/src/index.js +2 -0
- package/src/latest-comments/block.json +5 -1
- package/src/latest-comments/edit.js +2 -0
- package/src/latest-comments/style.scss +3 -0
- package/src/latest-posts/block.json +13 -0
- package/src/latest-posts/edit.js +2 -0
- package/src/latest-posts/style.scss +3 -0
- package/src/list/test/edit.native.js +55 -47
- package/src/list/transforms.js +0 -11
- package/src/list/utils.js +6 -2
- package/src/list-item/edit.js +1 -0
- package/src/list-item/index.js +2 -0
- package/src/list-item/transforms.js +17 -0
- package/src/list-item/utils.js +10 -1
- package/src/media-text/edit.js +5 -3
- package/src/missing/test/edit-integration.native.js +10 -12
- package/src/navigation/edit/are-blocks-dirty.js +51 -0
- package/src/navigation/edit/index.js +269 -310
- package/src/navigation/edit/manage-menus-button.js +21 -0
- package/src/navigation/edit/menu-inspector-controls.js +78 -0
- package/src/navigation/edit/navigation-menu-selector.js +5 -1
- package/src/navigation/edit/responsive-wrapper.js +2 -10
- package/src/navigation/edit/test/are-blocks-dirty.js +121 -0
- package/src/navigation/edit/unsaved-inner-blocks.js +17 -36
- package/src/navigation/editor.scss +25 -0
- package/src/navigation/index.php +57 -10
- package/src/navigation/style.scss +16 -0
- package/src/navigation/view-modal.js +11 -1
- package/src/navigation-link/edit.js +66 -329
- package/src/navigation-link/editor.scss +8 -0
- package/src/navigation-link/index.php +32 -0
- package/src/navigation-link/link-ui.js +213 -0
- package/src/navigation-link/test/edit.js +23 -82
- package/src/navigation-link/transforms.js +14 -0
- package/src/navigation-link/update-attributes.js +99 -0
- package/src/navigation-submenu/edit.js +57 -177
- package/src/navigation-submenu/index.php +40 -0
- package/src/page-list/block.json +6 -1
- package/src/page-list/constants.js +8 -0
- package/src/page-list/convert-to-links-modal.js +19 -76
- package/src/page-list/convert-to-navigation-links.js +60 -0
- package/src/page-list/edit.js +179 -118
- package/src/page-list/index.php +9 -0
- package/src/page-list/test/convert-to-links-modal.js +28 -34
- package/src/page-list-item/block.json +51 -0
- package/src/page-list-item/edit.js +94 -0
- package/src/page-list-item/index.js +24 -0
- package/src/page-list-item/init.js +6 -0
- package/src/paragraph/index.js +0 -6
- package/src/post-author/edit.js +47 -22
- package/src/post-content/block.json +3 -0
- package/src/post-content/index.php +1 -2
- package/src/post-featured-image/index.php +7 -2
- package/src/post-featured-image/overlay.js +1 -0
- package/src/post-template/block.json +8 -0
- package/src/preformatted/transforms.js +4 -1
- package/src/query/block.json +0 -8
- package/src/query/deprecated.js +257 -86
- package/src/query/edit/inspector-controls/index.js +1 -0
- package/src/query/edit/query-placeholder.js +4 -16
- package/src/query/editor.scss +1 -1
- package/src/query-pagination/style.scss +1 -1
- package/src/read-more/index.php +9 -2
- package/src/rss/edit.js +3 -0
- package/src/search/edit.native.js +31 -27
- package/src/search/index.js +5 -1
- package/src/shortcode/test/edit.native.js +15 -18
- package/src/site-logo/edit.js +14 -6
- package/src/site-logo/index.js +1 -0
- package/src/site-title/index.js +1 -0
- package/src/social-link/social-list.js +2 -7
- package/src/social-link/test/index.native.js +16 -22
- package/src/social-links/test/edit.native.js +8 -7
- package/src/spacer/test/index.native.js +39 -36
- package/src/table/block.json +15 -0
- package/src/table/edit.js +2 -1
- package/src/table/editor.scss +1 -4
- package/src/table/index.js +1 -0
- package/src/table/save.js +5 -1
- package/src/table/state.js +22 -7
- package/src/table/style.scss +7 -0
- package/src/table/theme.scss +1 -3
- package/src/table/transforms.js +2 -1
- package/src/table-of-contents/edit.js +2 -2
- package/src/tag-cloud/edit.js +3 -2
- package/src/template-part/edit/selection-modal.js +4 -3
- package/src/template-part/edit/utils/hooks.js +7 -3
- package/src/template-part/editor.scss +20 -2
- package/src/template-part/index.php +6 -2
- package/src/template-part/variations.js +4 -0
- package/src/text-columns/edit.js +1 -0
- package/src/utils/transformation-categories.native.js +1 -0
- package/src/video/edit.js +1 -1
- package/src/video/edit.native.js +1 -2
- package/test/babel-plugin.js +35 -35
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/gallery/v1/edit.js"],"names":["MAX_COLUMNS","linkOptions","value","LINK_DESTINATION_ATTACHMENT","label","LINK_DESTINATION_MEDIA","LINK_DESTINATION_NONE","ALLOWED_MEDIA_TYPES","PLACEHOLDER_TEXT","Platform","select","web","native","MOBILE_CONTROL_PROPS_RANGE_CONTROL","type","GalleryEdit","props","attributes","clientId","isSelected","noticeUI","noticeOperations","onFocus","columns","imageCrop","images","linkTo","sizeSlug","selectedImage","setSelectedImage","attachmentCaptions","setAttachmentCaptions","__unstableMarkNextChangeAsNotPersistent","blockEditorStore","imageSizes","mediaUpload","getMedia","wasBlockJustInserted","settings","getSettings","coreStore","resizedImages","ids","currentResizedImages","id","image","sizes","currentSizes","size","defaultUrl","slug","mediaDetailsUrl","parseInt","onFocusGalleryCaption","setAttributes","newAttrs","Error","onSelectImage","index","onDeselectImage","onMove","oldIndex","newIndex","newImages","splice","onMoveForward","length","onMoveBackward","onRemoveImage","img","i","Math","min","selectCaption","newImage","newImageId","toString","currentImage","currentImageCaption","caption","attachment","onSelectImages","map","onUploadError","message","removeAllNotices","createErrorNotice","setLinkTo","setColumnsNumber","toggleImageCrop","getImageCropHelp","checked","setImageAttributes","newAttributes","slice","getImagesSizeOptions","resizedImageSizes","Object","values","some","name","updateImagesSize","newSizeSlug","updatedImages","url","OS","every","filesList","forEach","onFileChange","allowedTypes","window","wp","media","view","defaultProps","link","hasImages","hasImageIds","mediaPlaceholder","sharedIcon","title","instructions","undefined","blockProps","imageSizeOptions","shouldShowSizeOptions","withNotices","isNarrow"],"mappings":";;;;;;;;;AAsBA;;;;AAnBA;;AAKA;;AACA;;AAOA;;AAOA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AArCA;AACA;AACA;;AAGA;AACA;AACA;;AAuBA;AACA;AACA;AAWA,MAAMA,WAAW,GAAG,CAApB;AACA,MAAMC,WAAW,GAAG,CACnB;AAAEC,EAAAA,KAAK,EAAEC,sCAAT;AAAsCC,EAAAA,KAAK,EAAE,cAAI,iBAAJ;AAA7C,CADmB,EAEnB;AAAEF,EAAAA,KAAK,EAAEG,iCAAT;AAAiCD,EAAAA,KAAK,EAAE,cAAI,YAAJ;AAAxC,CAFmB,EAGnB;AAAEF,EAAAA,KAAK,EAAEI,gCAAT;AAAgCF,EAAAA,KAAK,EAAE,cAAI,MAAJ;AAAvC,CAHmB,CAApB;AAKA,MAAMG,mBAAmB,GAAG,CAAE,OAAF,CAA5B;;AAEA,MAAMC,gBAAgB,GAAGC,kBAASC,MAAT,CAAiB;AACzCC,EAAAA,GAAG,EAAE,cACJ,iEADI,CADoC;AAIzCC,EAAAA,MAAM,EAAE,cAAI,WAAJ;AAJiC,CAAjB,CAAzB;;AAOA,MAAMC,kCAAkC,GAAGJ,kBAASC,MAAT,CAAiB;AAC3DC,EAAAA,GAAG,EAAE,EADsD;AAE3DC,EAAAA,MAAM,EAAE;AAAEE,IAAAA,IAAI,EAAE;AAAR;AAFmD,CAAjB,CAA3C;;AAKA,SAASC,WAAT,CAAsBC,KAAtB,EAA8B;AAC7B,QAAM;AACLC,IAAAA,UADK;AAELC,IAAAA,QAFK;AAGLC,IAAAA,UAHK;AAILC,IAAAA,QAJK;AAKLC,IAAA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zB,KAvCD,CADD;AAwDA;;eAEc,sBAAS,CACvB0E,uBADuB,EAEvB,iCAAmB;AAAEC,EAAAA,QAAQ,EAAE;AAAZ,CAAnB,CAFuB,CAAT,EAGVjH,WAHU,C","sourcesContent":["/**\n * External dependencies\n */\nimport { filter, find, get, isEmpty, map, reduce } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { compose } from '@wordpress/compose';\nimport {\n\tPanelBody,\n\tSelectControl,\n\tToggleControl,\n\twithNotices,\n\tRangeControl,\n} from '@wordpress/components';\nimport {\n\tMediaPlaceholder,\n\tInspectorControls,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { Platform, useEffect, useState, useMemo } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { getBlobByURL, isBlobURL, revokeBlobURL } from '@wordpress/blob';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { withViewportMatch } from '@wordpress/viewport';\nimport { View } from '@wordpress/primitives';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { sharedIcon } from '../shared-icon';\nimport { pickRelevantMediaFiles } from './shared';\nimport { defaultColumnsNumberV1 } from '../deprecated';\nimport Gallery from './gallery';\nimport {\n\tLINK_DESTINATION_ATTACHMENT,\n\tLINK_DESTINATION_MEDIA,\n\tLINK_DESTINATION_NONE,\n} from './constants';\n\nconst MAX_COLUMNS = 8;\nconst linkOptions = [\n\t{ value: LINK_DESTINATION_ATTACHMENT, label: __( 'Attachment Page' ) },\n\t{ value: LINK_DESTINATION_MEDIA, label: __( 'Media File' ) },\n\t{ value: LINK_DESTINATION_NONE, label: __( 'None' ) },\n];\nconst ALLOWED_MEDIA_TYPES = [ 'image' ];\n\nconst PLACEHOLDER_TEXT = Platform.select( {\n\tweb: __(\n\t\t'Drag images, upload new ones or select files from your library.'\n\t),\n\tnative: __( 'ADD MEDIA' ),\n} );\n\nconst MOBILE_CONTROL_PROPS_RANGE_CONTROL = Platform.select( {\n\tweb: {},\n\tnative: { type: 'stepper' },\n} );\n\nfunction GalleryEdit( props ) {\n\tconst {\n\t\tattributes,\n\t\tclientId,\n\t\tisSelected,\n\t\tnoticeUI,\n\t\tnoticeOperations,\n\t\tonFocus,\n\t} = props;\n\tconst {\n\t\tcolumns = defaultColumnsNumberV1( attributes ),\n\t\timageCrop,\n\t\timages,\n\t\tlinkTo,\n\t\tsizeSlug,\n\t} = attributes;\n\tconst [ selectedImage, setSelectedImage ] = useState();\n\tconst [ attachmentCaptions, setAttachmentCaptions ] = useState();\n\tconst { __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\n\tconst { imageSizes, mediaUpload, getMedia, wasBlockJustInserted } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst settings = select( blockEditorStore ).getSettings();\n\n\t\t\treturn {\n\t\t\t\timageSizes: settings.imageSizes,\n\t\t\t\tmediaUpload: settings.mediaUpload,\n\t\t\t\tgetMedia: select( coreStore ).getMedia,\n\t\t\t\twasBlockJustInserted: select(\n\t\t\t\t\tblockEditorStore\n\t\t\t\t).wasBlockJustInserted( clientId, 'inserter_menu' ),\n\t\t\t};\n\t\t} );\n\n\tconst resizedImages = useMemo( () => {\n\t\tif ( isSelected ) {\n\t\t\treturn reduce(\n\t\t\t\tattributes.ids,\n\t\t\t\t( currentResizedImages, id ) => {\n\t\t\t\t\tif ( ! id ) {\n\t\t\t\t\t\treturn currentResizedImages;\n\t\t\t\t\t}\n\t\t\t\t\tconst image = getMedia( id );\n\t\t\t\t\tconst sizes = reduce(\n\t\t\t\t\t\timageSizes,\n\t\t\t\t\t\t( currentSizes, size ) => {\n\t\t\t\t\t\t\tconst defaultUrl = get( image, [\n\t\t\t\t\t\t\t\t'sizes',\n\t\t\t\t\t\t\t\tsize.slug,\n\t\t\t\t\t\t\t\t'url',\n\t\t\t\t\t\t\t] );\n\t\t\t\t\t\t\tconst mediaDetailsUrl = get( image, [\n\t\t\t\t\t\t\t\t'media_details',\n\t\t\t\t\t\t\t\t'sizes',\n\t\t\t\t\t\t\t\tsize.slug,\n\t\t\t\t\t\t\t\t'source_url',\n\t\t\t\t\t\t\t] );\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t...currentSizes,\n\t\t\t\t\t\t\t\t[ size.slug ]: defaultUrl || mediaDetailsUrl,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{}\n\t\t\t\t\t);\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...currentResizedImages,\n\t\t\t\t\t\t[ parseInt( id, 10 ) ]: sizes,\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t\t{}\n\t\t\t);\n\t\t}\n\t\treturn {};\n\t}, [ isSelected, attributes.ids, imageSizes ] );\n\n\tfunction onFocusGalleryCaption() {\n\t\tsetSelectedImage();\n\t}\n\n\tfunction setAttributes( newAttrs ) {\n\t\tif ( newAttrs.ids ) {\n\t\t\tthrow new Error(\n\t\t\t\t'The \"ids\" attribute should not be changed directly. It is managed automatically when \"images\" attribute changes'\n\t\t\t);\n\t\t}\n\n\t\tif ( newAttrs.images ) {\n\t\t\tnewAttrs = {\n\t\t\t\t...newAttrs,\n\t\t\t\t// Unlike images[ n ].id which is a string, always ensure the\n\t\t\t\t// ids array contains numbers as per its attribute type.\n\t\t\t\tids: map( newAttrs.images, ( { id } ) => parseInt( id, 10 ) ),\n\t\t\t};\n\t\t}\n\n\t\tprops.setAttributes( newAttrs );\n\t}\n\n\tfunction onSelectImage( index ) {\n\t\treturn () => {\n\t\t\tsetSelectedImage( index );\n\t\t};\n\t}\n\n\tfunction onDeselectImage() {\n\t\treturn () => {\n\t\t\tsetSelectedImage();\n\t\t};\n\t}\n\n\tfunction onMove( oldIndex, newIndex ) {\n\t\tconst newImages = [ ...images ];\n\t\tnewImages.splice( newIndex, 1, images[ oldIndex ] );\n\t\tnewImages.splice( oldIndex, 1, images[ newIndex ] );\n\t\tsetSelectedImage( newIndex );\n\t\tsetAttributes( { images: newImages } );\n\t}\n\n\tfunction onMoveForward( oldIndex ) {\n\t\treturn () => {\n\t\t\tif ( oldIndex === images.length - 1 ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tonMove( oldIndex, oldIndex + 1 );\n\t\t};\n\t}\n\n\tfunction onMoveBackward( oldIndex ) {\n\t\treturn () => {\n\t\t\tif ( oldIndex === 0 ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tonMove( oldIndex, oldIndex - 1 );\n\t\t};\n\t}\n\n\tfunction onRemoveImage( index ) {\n\t\treturn () => {\n\t\t\tconst newImages = filter( images, ( img, i ) => index !== i );\n\t\t\tsetSelectedImage();\n\t\t\tsetAttributes( {\n\t\t\t\timages: newImages,\n\t\t\t\tcolumns: attributes.columns\n\t\t\t\t\t? Math.min( newImages.length, attributes.columns )\n\t\t\t\t\t: attributes.columns,\n\t\t\t} );\n\t\t};\n\t}\n\n\tfunction selectCaption( newImage ) {\n\t\t// The image id in both the images and attachmentCaptions arrays is a\n\t\t// string, so ensure comparison works correctly by converting the\n\t\t// newImage.id to a string.\n\t\tconst newImageId = newImage.id.toString();\n\t\tconst currentImage = find( images, { id: newImageId } );\n\t\tconst currentImageCaption = currentImage\n\t\t\t? currentImage.caption\n\t\t\t: newImage.caption;\n\n\t\tif ( ! attachmentCaptions ) {\n\t\t\treturn currentImageCaption;\n\t\t}\n\n\t\tconst attachment = find( attachmentCaptions, {\n\t\t\tid: newImageId,\n\t\t} );\n\n\t\t// If the attachment caption is updated.\n\t\tif ( attachment && attachment.caption !== newImage.caption ) {\n\t\t\treturn newImage.caption;\n\t\t}\n\n\t\treturn currentImageCaption;\n\t}\n\n\tfunction onSelectImages( newImages ) {\n\t\tsetAttachmentCaptions(\n\t\t\tnewImages.map( ( newImage ) => ( {\n\t\t\t\t// Store the attachmentCaption id as a string for consistency\n\t\t\t\t// with the type of the id in the images attribute.\n\t\t\t\tid: newImage.id.toString(),\n\t\t\t\tcaption: newImage.caption,\n\t\t\t} ) )\n\t\t);\n\t\tsetAttributes( {\n\t\t\timages: newImages.map( ( newImage ) => ( {\n\t\t\t\t...pickRelevantMediaFiles( newImage, sizeSlug ),\n\t\t\t\tcaption: selectCaption( newImage, images, attachmentCaptions ),\n\t\t\t\t// The id value is stored in a data attribute, so when the\n\t\t\t\t// block is parsed it's converted to a string. Converting\n\t\t\t\t// to a string here ensures it's type is consistent.\n\t\t\t\tid: newImage.id.toString(),\n\t\t\t} ) ),\n\t\t\tcolumns: attributes.columns\n\t\t\t\t? Math.min( newImages.length, attributes.columns )\n\t\t\t\t: attributes.columns,\n\t\t} );\n\t}\n\n\tfunction onUploadError( message ) {\n\t\tnoticeOperations.removeAllNotices();\n\t\tnoticeOperations.createErrorNotice( message );\n\t}\n\n\tfunction setLinkTo( value ) {\n\t\tsetAttributes( { linkTo: value } );\n\t}\n\n\tfunction setColumnsNumber( value ) {\n\t\tsetAttributes( { columns: value } );\n\t}\n\n\tfunction toggleImageCrop() {\n\t\tsetAttributes( { imageCrop: ! imageCrop } );\n\t}\n\n\tfunction getImageCropHelp( checked ) {\n\t\treturn checked\n\t\t\t? __( 'Thumbnails are cropped to align.' )\n\t\t\t: __( 'Thumbnails are not cropped.' );\n\t}\n\n\tfunction setImageAttributes( index, newAttributes ) {\n\t\tif ( ! images[ index ] ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetAttributes( {\n\t\t\timages: [\n\t\t\t\t...images.slice( 0, index ),\n\t\t\t\t{\n\t\t\t\t\t...images[ index ],\n\t\t\t\t\t...newAttributes,\n\t\t\t\t},\n\t\t\t\t...images.slice( index + 1 ),\n\t\t\t],\n\t\t} );\n\t}\n\n\tfunction getImagesSizeOptions() {\n\t\tconst resizedImageSizes = Object.values( resizedImages );\n\t\treturn map(\n\t\t\tfilter( imageSizes, ( { slug } ) =>\n\t\t\t\tresizedImageSizes.some( ( sizes ) => sizes[ slug ] )\n\t\t\t),\n\t\t\t( { name, slug } ) => ( { value: slug, label: name } )\n\t\t);\n\t}\n\n\tfunction updateImagesSize( newSizeSlug ) {\n\t\tconst updatedImages = map( images, ( image ) => {\n\t\t\tif ( ! image.id ) {\n\t\t\t\treturn image;\n\t\t\t}\n\t\t\tconst url = get( resizedImages, [\n\t\t\t\tparseInt( image.id, 10 ),\n\t\t\t\tnewSizeSlug,\n\t\t\t] );\n\t\t\treturn {\n\t\t\t\t...image,\n\t\t\t\t...( url && { url } ),\n\t\t\t};\n\t\t} );\n\n\t\tsetAttributes( { images: updatedImages, sizeSlug: newSizeSlug } );\n\t}\n\n\tuseEffect( () => {\n\t\tif (\n\t\t\tPlatform.OS === 'web' &&\n\t\t\timages &&\n\t\t\timages.length > 0 &&\n\t\t\timages.every( ( { url } ) => isBlobURL( url ) )\n\t\t) {\n\t\t\tconst filesList = map( images, ( { url } ) => getBlobByURL( url ) );\n\t\t\timages.forEach( ( { url } ) => revokeBlobURL( url ) );\n\t\t\tmediaUpload( {\n\t\t\t\tfilesList,\n\t\t\t\tonFileChange: onSelectImages,\n\t\t\t\tallowedTypes: [ 'image' ],\n\t\t\t} );\n\t\t}\n\t}, [] );\n\n\tuseEffect( () => {\n\t\t// Deselect images when deselecting the block.\n\t\tif ( ! isSelected ) {\n\t\t\tsetSelectedImage();\n\t\t}\n\t}, [ isSelected ] );\n\n\tuseEffect( () => {\n\t\t// linkTo attribute must be saved so blocks don't break when changing\n\t\t// image_default_link_type in options.php.\n\t\tif ( ! linkTo ) {\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( {\n\t\t\t\tlinkTo:\n\t\t\t\t\twindow?.wp?.media?.view?.settings?.defaultProps?.link ||\n\t\t\t\t\tLINK_DESTINATION_NONE,\n\t\t\t} );\n\t\t}\n\t}, [ linkTo ] );\n\n\tconst hasImages = !! images.length;\n\tconst hasImageIds = hasImages && images.some( ( image ) => !! image.id );\n\n\tconst mediaPlaceholder = (\n\t\t<MediaPlaceholder\n\t\t\taddToGallery={ hasImageIds }\n\t\t\tisAppender={ hasImages }\n\t\t\tdisableMediaButtons={ hasImages && ! isSelected }\n\t\t\ticon={ ! hasImages && sharedIcon }\n\t\t\tlabels={ {\n\t\t\t\ttitle: ! hasImages && __( 'Gallery' ),\n\t\t\t\tinstructions: ! hasImages && PLACEHOLDER_TEXT,\n\t\t\t} }\n\t\t\tonSelect={ onSelectImages }\n\t\t\taccept=\"image/*\"\n\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\tmultiple\n\t\t\tvalue={ hasImageIds ? images : {} }\n\t\t\tonError={ onUploadError }\n\t\t\tnotices={ hasImages ? undefined : noticeUI }\n\t\t\tonFocus={ onFocus }\n\t\t\tautoOpenMediaUpload={\n\t\t\t\t! hasImages && isSelected && wasBlockJustInserted\n\t\t\t}\n\t\t/>\n\t);\n\n\tconst blockProps = useBlockProps();\n\n\tif ( ! hasImages ) {\n\t\treturn <View { ...blockProps }>{ mediaPlaceholder }</View>;\n\t}\n\n\tconst imageSizeOptions = getImagesSizeOptions();\n\tconst shouldShowSizeOptions = hasImages && ! isEmpty( imageSizeOptions );\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t{ images.length > 1 && (\n\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\tlabel={ __( 'Columns' ) }\n\t\t\t\t\t\t\tvalue={ columns }\n\t\t\t\t\t\t\tonChange={ setColumnsNumber }\n\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\tmax={ Math.min( MAX_COLUMNS, images.length ) }\n\t\t\t\t\t\t\t{ ...MOBILE_CONTROL_PROPS_RANGE_CONTROL }\n\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\tlabel={ __( 'Crop images' ) }\n\t\t\t\t\t\tchecked={ !! imageCrop }\n\t\t\t\t\t\tonChange={ toggleImageCrop }\n\t\t\t\t\t\thelp={ getImageCropHelp }\n\t\t\t\t\t/>\n\t\t\t\t\t<SelectControl\n\t\t\t\t\t\tlabel={ __( 'Link to' ) }\n\t\t\t\t\t\tvalue={ linkTo }\n\t\t\t\t\t\tonChange={ setLinkTo }\n\t\t\t\t\t\toptions={ linkOptions }\n\t\t\t\t\t\thideCancelButton={ true }\n\t\t\t\t\t/>\n\t\t\t\t\t{ shouldShowSizeOptions && (\n\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\tlabel={ __( 'Image size' ) }\n\t\t\t\t\t\t\tvalue={ sizeSlug }\n\t\t\t\t\t\t\toptions={ imageSizeOptions }\n\t\t\t\t\t\t\tonChange={ updateImagesSize }\n\t\t\t\t\t\t\thideCancelButton={ true }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t{ noticeUI }\n\t\t\t<Gallery\n\t\t\t\t{ ...props }\n\t\t\t\tselectedImage={ selectedImage }\n\t\t\t\tmediaPlaceholder={ mediaPlaceholder }\n\t\t\t\tonMoveBackward={ onMoveBackward }\n\t\t\t\tonMoveForward={ onMoveForward }\n\t\t\t\tonRemoveImage={ onRemoveImage }\n\t\t\t\tonSelectImage={ onSelectImage }\n\t\t\t\tonDeselectImage={ onDeselectImage }\n\t\t\t\tonSetImageAttributes={ setImageAttributes }\n\t\t\t\tblockProps={ blockProps }\n\t\t\t\t// This prop is used by gallery.native.js.\n\t\t\t\tonFocusGalleryCaption={ onFocusGalleryCaption }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default compose( [\n\twithNotices,\n\twithViewportMatch( { isNarrow: '< small' } ),\n] )( GalleryEdit );\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/gallery/v1/edit.js"],"names":["MAX_COLUMNS","linkOptions","value","LINK_DESTINATION_ATTACHMENT","label","LINK_DESTINATION_MEDIA","LINK_DESTINATION_NONE","ALLOWED_MEDIA_TYPES","PLACEHOLDER_TEXT","Platform","select","web","native","MOBILE_CONTROL_PROPS_RANGE_CONTROL","type","GalleryEdit","props","attributes","clientId","isSelected","noticeUI","noticeOperations","onFocus","columns","imageCrop","images","linkTo","sizeSlug","selectedImage","setSelectedImage","attachmentCaptions","setAttachmentCaptions","__unstableMarkNextChangeAsNotPersistent","blockEditorStore","imageSizes","mediaUpload","getMedia","wasBlockJustInserted","settings","getSettings","coreStore","resizedImages","ids","reduce","currentResizedImages","id","image","sizes","currentSizes","size","defaultUrl","slug","mediaDetailsUrl","parseInt","onFocusGalleryCaption","setAttributes","newAttrs","Error","onSelectImage","index","onDeselectImage","onMove","oldIndex","newIndex","newImages","splice","onMoveForward","length","onMoveBackward","onRemoveImage","filter","img","i","Math","min","selectCaption","newImage","newImageId","toString","currentImage","find","currentImageCaption","caption","attachment","onSelectImages","map","onUploadError","message","removeAllNotices","createErrorNotice","setLinkTo","setColumnsNumber","toggleImageCrop","getImageCropHelp","checked","setImageAttributes","newAttributes","slice","getImagesSizeOptions","resizedImageSizes","Object","values","some","name","updateImagesSize","newSizeSlug","updatedImages","url","OS","every","filesList","forEach","onFileChange","allowedTypes","window","wp","media","view","defaultProps","link","hasImages","hasImageIds","mediaPlaceholder","sharedIcon","title","instructions","undefined","blockProps","imageSizeOptions","shouldShowSizeOptions","withNotices","isNarrow"],"mappings":";;;;;;;;;AAsBA;;;;AAnBA;;AAKA;;AACA;;AAOA;;AAOA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AArCA;AACA;AACA;;AAGA;AACA;AACA;;AAuBA;AACA;AACA;AAWA,MAAMA,WAAW,GAAG,CAApB;AACA,MAAMC,WAAW,GAAG,CACnB;AAAEC,EAAAA,KAAK,EAAEC,sCAAT;AAAsCC,EAAAA,KAAK,EAAE,cAAI,iBAAJ;AAA7C,CADmB,EAEnB;AAAEF,EAAAA,KAAK,EAAEG,iCAAT;AAAiCD,EAAAA,KAAK,EAAE,cAAI,YAAJ;AAA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C,yBAAD;AACC,IAAA,KAAK,EAAG,cAAI,SAAJ,CADT;AAEC,IAAA,KAAK,EAAGnE,MAFT;AAGC,IAAA,QAAQ,EAAGgE,SAHZ;AAIC,IAAA,OAAO,EAAGzF,WAJX;AAKC,IAAA,gBAAgB,EAAG;AALpB,IAnBD,EA0BGgI,qBAAqB,IACtB,4BAAC,yBAAD;AACC,IAAA,KAAK,EAAG,cAAI,YAAJ,CADT;AAEC,IAAA,KAAK,EAAGtG,QAFT;AAGC,IAAA,OAAO,EAAGqG,gBAHX;AAIC,IAAA,QAAQ,EAAGxB,gBAJZ;AAKC,IAAA,gBAAgB,EAAG;AALpB,IA3BF,CADD,CADD,EAuCGpF,QAvCH,EAwCC,4BAAC,gBAAD,6BACMJ,KADN;AAEC,IAAA,aAAa,EAAGY,aAFjB;AAGC,IAAA,gBAAgB,EAAG8F,gBAHpB;AAIC,IAAA,cAAc,EAAGtD,cAJlB;AAKC,IAAA,aAAa,EAAGF,aALjB;AAMC,IAAA,aAAa,EAAGG,aANjB;AAOC,IAAA,aAAa,EAAGX,aAPjB;AAQC,IAAA,eAAe,EAAGE,eARnB;AASC,IAAA,oBAAoB,EAAGmC,kBATxB;AAUC,IAAA,UAAU,EAAGgC,UAVd,CAWC;AAXD;AAYC,IAAA,qBAAqB,EAAGzE;AAZzB,KAxCD,CADD;AAyDA;;eAEc,sBAAS,CACvB4E,uBADuB,EAEvB,iCAAmB;AAAEC,EAAAA,QAAQ,EAAE;AAAZ,CAAnB,CAFuB,CAAT,EAGVpH,WAHU,C","sourcesContent":["/**\n * External dependencies\n */\nimport { get, isEmpty, map } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { compose } from '@wordpress/compose';\nimport {\n\tPanelBody,\n\tSelectControl,\n\tToggleControl,\n\twithNotices,\n\tRangeControl,\n} from '@wordpress/components';\nimport {\n\tMediaPlaceholder,\n\tInspectorControls,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { Platform, useEffect, useState, useMemo } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { getBlobByURL, isBlobURL, revokeBlobURL } from '@wordpress/blob';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { withViewportMatch } from '@wordpress/viewport';\nimport { View } from '@wordpress/primitives';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { sharedIcon } from '../shared-icon';\nimport { pickRelevantMediaFiles } from './shared';\nimport { defaultColumnsNumberV1 } from '../deprecated';\nimport Gallery from './gallery';\nimport {\n\tLINK_DESTINATION_ATTACHMENT,\n\tLINK_DESTINATION_MEDIA,\n\tLINK_DESTINATION_NONE,\n} from './constants';\n\nconst MAX_COLUMNS = 8;\nconst linkOptions = [\n\t{ value: LINK_DESTINATION_ATTACHMENT, label: __( 'Attachment Page' ) },\n\t{ value: LINK_DESTINATION_MEDIA, label: __( 'Media File' ) },\n\t{ value: LINK_DESTINATION_NONE, label: __( 'None' ) },\n];\nconst ALLOWED_MEDIA_TYPES = [ 'image' ];\n\nconst PLACEHOLDER_TEXT = Platform.select( {\n\tweb: __(\n\t\t'Drag images, upload new ones or select files from your library.'\n\t),\n\tnative: __( 'ADD MEDIA' ),\n} );\n\nconst MOBILE_CONTROL_PROPS_RANGE_CONTROL = Platform.select( {\n\tweb: {},\n\tnative: { type: 'stepper' },\n} );\n\nfunction GalleryEdit( props ) {\n\tconst {\n\t\tattributes,\n\t\tclientId,\n\t\tisSelected,\n\t\tnoticeUI,\n\t\tnoticeOperations,\n\t\tonFocus,\n\t} = props;\n\tconst {\n\t\tcolumns = defaultColumnsNumberV1( attributes ),\n\t\timageCrop,\n\t\timages,\n\t\tlinkTo,\n\t\tsizeSlug,\n\t} = attributes;\n\tconst [ selectedImage, setSelectedImage ] = useState();\n\tconst [ attachmentCaptions, setAttachmentCaptions ] = useState();\n\tconst { __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\n\tconst { imageSizes, mediaUpload, getMedia, wasBlockJustInserted } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst settings = select( blockEditorStore ).getSettings();\n\n\t\t\treturn {\n\t\t\t\timageSizes: settings.imageSizes,\n\t\t\t\tmediaUpload: settings.mediaUpload,\n\t\t\t\tgetMedia: select( coreStore ).getMedia,\n\t\t\t\twasBlockJustInserted: select(\n\t\t\t\t\tblockEditorStore\n\t\t\t\t).wasBlockJustInserted( clientId, 'inserter_menu' ),\n\t\t\t};\n\t\t} );\n\n\tconst resizedImages = useMemo( () => {\n\t\tif ( isSelected ) {\n\t\t\treturn ( attributes.ids ?? [] ).reduce(\n\t\t\t\t( currentResizedImages, id ) => {\n\t\t\t\t\tif ( ! id ) {\n\t\t\t\t\t\treturn currentResizedImages;\n\t\t\t\t\t}\n\t\t\t\t\tconst image = getMedia( id );\n\t\t\t\t\tconst sizes = imageSizes.reduce( ( currentSizes, size ) => {\n\t\t\t\t\t\tconst defaultUrl = get( image, [\n\t\t\t\t\t\t\t'sizes',\n\t\t\t\t\t\t\tsize.slug,\n\t\t\t\t\t\t\t'url',\n\t\t\t\t\t\t] );\n\t\t\t\t\t\tconst mediaDetailsUrl = get( image, [\n\t\t\t\t\t\t\t'media_details',\n\t\t\t\t\t\t\t'sizes',\n\t\t\t\t\t\t\tsize.slug,\n\t\t\t\t\t\t\t'source_url',\n\t\t\t\t\t\t] );\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t...currentSizes,\n\t\t\t\t\t\t\t[ size.slug ]: defaultUrl || mediaDetailsUrl,\n\t\t\t\t\t\t};\n\t\t\t\t\t}, {} );\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...currentResizedImages,\n\t\t\t\t\t\t[ parseInt( id, 10 ) ]: sizes,\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t\t{}\n\t\t\t);\n\t\t}\n\t\treturn {};\n\t}, [ isSelected, attributes.ids, imageSizes ] );\n\n\tfunction onFocusGalleryCaption() {\n\t\tsetSelectedImage();\n\t}\n\n\tfunction setAttributes( newAttrs ) {\n\t\tif ( newAttrs.ids ) {\n\t\t\tthrow new Error(\n\t\t\t\t'The \"ids\" attribute should not be changed directly. It is managed automatically when \"images\" attribute changes'\n\t\t\t);\n\t\t}\n\n\t\tif ( newAttrs.images ) {\n\t\t\tnewAttrs = {\n\t\t\t\t...newAttrs,\n\t\t\t\t// Unlike images[ n ].id which is a string, always ensure the\n\t\t\t\t// ids array contains numbers as per its attribute type.\n\t\t\t\tids: map( newAttrs.images, ( { id } ) => parseInt( id, 10 ) ),\n\t\t\t};\n\t\t}\n\n\t\tprops.setAttributes( newAttrs );\n\t}\n\n\tfunction onSelectImage( index ) {\n\t\treturn () => {\n\t\t\tsetSelectedImage( index );\n\t\t};\n\t}\n\n\tfunction onDeselectImage() {\n\t\treturn () => {\n\t\t\tsetSelectedImage();\n\t\t};\n\t}\n\n\tfunction onMove( oldIndex, newIndex ) {\n\t\tconst newImages = [ ...images ];\n\t\tnewImages.splice( newIndex, 1, images[ oldIndex ] );\n\t\tnewImages.splice( oldIndex, 1, images[ newIndex ] );\n\t\tsetSelectedImage( newIndex );\n\t\tsetAttributes( { images: newImages } );\n\t}\n\n\tfunction onMoveForward( oldIndex ) {\n\t\treturn () => {\n\t\t\tif ( oldIndex === images.length - 1 ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tonMove( oldIndex, oldIndex + 1 );\n\t\t};\n\t}\n\n\tfunction onMoveBackward( oldIndex ) {\n\t\treturn () => {\n\t\t\tif ( oldIndex === 0 ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tonMove( oldIndex, oldIndex - 1 );\n\t\t};\n\t}\n\n\tfunction onRemoveImage( index ) {\n\t\treturn () => {\n\t\t\tconst newImages = images.filter( ( img, i ) => index !== i );\n\t\t\tsetSelectedImage();\n\t\t\tsetAttributes( {\n\t\t\t\timages: newImages,\n\t\t\t\tcolumns: attributes.columns\n\t\t\t\t\t? Math.min( newImages.length, attributes.columns )\n\t\t\t\t\t: attributes.columns,\n\t\t\t} );\n\t\t};\n\t}\n\n\tfunction selectCaption( newImage ) {\n\t\t// The image id in both the images and attachmentCaptions arrays is a\n\t\t// string, so ensure comparison works correctly by converting the\n\t\t// newImage.id to a string.\n\t\tconst newImageId = newImage.id.toString();\n\t\tconst currentImage = images.find( ( { id } ) => id === newImageId );\n\t\tconst currentImageCaption = currentImage\n\t\t\t? currentImage.caption\n\t\t\t: newImage.caption;\n\n\t\tif ( ! attachmentCaptions ) {\n\t\t\treturn currentImageCaption;\n\t\t}\n\n\t\tconst attachment = attachmentCaptions.find(\n\t\t\t( { id } ) => id === newImageId\n\t\t);\n\n\t\t// If the attachment caption is updated.\n\t\tif ( attachment && attachment.caption !== newImage.caption ) {\n\t\t\treturn newImage.caption;\n\t\t}\n\n\t\treturn currentImageCaption;\n\t}\n\n\tfunction onSelectImages( newImages ) {\n\t\tsetAttachmentCaptions(\n\t\t\tnewImages.map( ( newImage ) => ( {\n\t\t\t\t// Store the attachmentCaption id as a string for consistency\n\t\t\t\t// with the type of the id in the images attribute.\n\t\t\t\tid: newImage.id.toString(),\n\t\t\t\tcaption: newImage.caption,\n\t\t\t} ) )\n\t\t);\n\t\tsetAttributes( {\n\t\t\timages: newImages.map( ( newImage ) => ( {\n\t\t\t\t...pickRelevantMediaFiles( newImage, sizeSlug ),\n\t\t\t\tcaption: selectCaption( newImage, images, attachmentCaptions ),\n\t\t\t\t// The id value is stored in a data attribute, so when the\n\t\t\t\t// block is parsed it's converted to a string. Converting\n\t\t\t\t// to a string here ensures it's type is consistent.\n\t\t\t\tid: newImage.id.toString(),\n\t\t\t} ) ),\n\t\t\tcolumns: attributes.columns\n\t\t\t\t? Math.min( newImages.length, attributes.columns )\n\t\t\t\t: attributes.columns,\n\t\t} );\n\t}\n\n\tfunction onUploadError( message ) {\n\t\tnoticeOperations.removeAllNotices();\n\t\tnoticeOperations.createErrorNotice( message );\n\t}\n\n\tfunction setLinkTo( value ) {\n\t\tsetAttributes( { linkTo: value } );\n\t}\n\n\tfunction setColumnsNumber( value ) {\n\t\tsetAttributes( { columns: value } );\n\t}\n\n\tfunction toggleImageCrop() {\n\t\tsetAttributes( { imageCrop: ! imageCrop } );\n\t}\n\n\tfunction getImageCropHelp( checked ) {\n\t\treturn checked\n\t\t\t? __( 'Thumbnails are cropped to align.' )\n\t\t\t: __( 'Thumbnails are not cropped.' );\n\t}\n\n\tfunction setImageAttributes( index, newAttributes ) {\n\t\tif ( ! images[ index ] ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetAttributes( {\n\t\t\timages: [\n\t\t\t\t...images.slice( 0, index ),\n\t\t\t\t{\n\t\t\t\t\t...images[ index ],\n\t\t\t\t\t...newAttributes,\n\t\t\t\t},\n\t\t\t\t...images.slice( index + 1 ),\n\t\t\t],\n\t\t} );\n\t}\n\n\tfunction getImagesSizeOptions() {\n\t\tconst resizedImageSizes = Object.values( resizedImages );\n\t\treturn map(\n\t\t\timageSizes.filter( ( { slug } ) =>\n\t\t\t\tresizedImageSizes.some( ( sizes ) => sizes[ slug ] )\n\t\t\t),\n\t\t\t( { name, slug } ) => ( { value: slug, label: name } )\n\t\t);\n\t}\n\n\tfunction updateImagesSize( newSizeSlug ) {\n\t\tconst updatedImages = map( images, ( image ) => {\n\t\t\tif ( ! image.id ) {\n\t\t\t\treturn image;\n\t\t\t}\n\t\t\tconst url = get( resizedImages, [\n\t\t\t\tparseInt( image.id, 10 ),\n\t\t\t\tnewSizeSlug,\n\t\t\t] );\n\t\t\treturn {\n\t\t\t\t...image,\n\t\t\t\t...( url && { url } ),\n\t\t\t};\n\t\t} );\n\n\t\tsetAttributes( { images: updatedImages, sizeSlug: newSizeSlug } );\n\t}\n\n\tuseEffect( () => {\n\t\tif (\n\t\t\tPlatform.OS === 'web' &&\n\t\t\timages &&\n\t\t\timages.length > 0 &&\n\t\t\timages.every( ( { url } ) => isBlobURL( url ) )\n\t\t) {\n\t\t\tconst filesList = map( images, ( { url } ) => getBlobByURL( url ) );\n\t\t\timages.forEach( ( { url } ) => revokeBlobURL( url ) );\n\t\t\tmediaUpload( {\n\t\t\t\tfilesList,\n\t\t\t\tonFileChange: onSelectImages,\n\t\t\t\tallowedTypes: [ 'image' ],\n\t\t\t} );\n\t\t}\n\t}, [] );\n\n\tuseEffect( () => {\n\t\t// Deselect images when deselecting the block.\n\t\tif ( ! isSelected ) {\n\t\t\tsetSelectedImage();\n\t\t}\n\t}, [ isSelected ] );\n\n\tuseEffect( () => {\n\t\t// linkTo attribute must be saved so blocks don't break when changing\n\t\t// image_default_link_type in options.php.\n\t\tif ( ! linkTo ) {\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( {\n\t\t\t\tlinkTo:\n\t\t\t\t\twindow?.wp?.media?.view?.settings?.defaultProps?.link ||\n\t\t\t\t\tLINK_DESTINATION_NONE,\n\t\t\t} );\n\t\t}\n\t}, [ linkTo ] );\n\n\tconst hasImages = !! images.length;\n\tconst hasImageIds = hasImages && images.some( ( image ) => !! image.id );\n\n\tconst mediaPlaceholder = (\n\t\t<MediaPlaceholder\n\t\t\taddToGallery={ hasImageIds }\n\t\t\tisAppender={ hasImages }\n\t\t\tdisableMediaButtons={ hasImages && ! isSelected }\n\t\t\ticon={ ! hasImages && sharedIcon }\n\t\t\tlabels={ {\n\t\t\t\ttitle: ! hasImages && __( 'Gallery' ),\n\t\t\t\tinstructions: ! hasImages && PLACEHOLDER_TEXT,\n\t\t\t} }\n\t\t\tonSelect={ onSelectImages }\n\t\t\taccept=\"image/*\"\n\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\tmultiple\n\t\t\tvalue={ hasImageIds ? images : {} }\n\t\t\tonError={ onUploadError }\n\t\t\tnotices={ hasImages ? undefined : noticeUI }\n\t\t\tonFocus={ onFocus }\n\t\t\tautoOpenMediaUpload={\n\t\t\t\t! hasImages && isSelected && wasBlockJustInserted\n\t\t\t}\n\t\t/>\n\t);\n\n\tconst blockProps = useBlockProps();\n\n\tif ( ! hasImages ) {\n\t\treturn <View { ...blockProps }>{ mediaPlaceholder }</View>;\n\t}\n\n\tconst imageSizeOptions = getImagesSizeOptions();\n\tconst shouldShowSizeOptions = hasImages && ! isEmpty( imageSizeOptions );\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t{ images.length > 1 && (\n\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Columns' ) }\n\t\t\t\t\t\t\tvalue={ columns }\n\t\t\t\t\t\t\tonChange={ setColumnsNumber }\n\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\tmax={ Math.min( MAX_COLUMNS, images.length ) }\n\t\t\t\t\t\t\t{ ...MOBILE_CONTROL_PROPS_RANGE_CONTROL }\n\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\tlabel={ __( 'Crop images' ) }\n\t\t\t\t\t\tchecked={ !! imageCrop }\n\t\t\t\t\t\tonChange={ toggleImageCrop }\n\t\t\t\t\t\thelp={ getImageCropHelp }\n\t\t\t\t\t/>\n\t\t\t\t\t<SelectControl\n\t\t\t\t\t\tlabel={ __( 'Link to' ) }\n\t\t\t\t\t\tvalue={ linkTo }\n\t\t\t\t\t\tonChange={ setLinkTo }\n\t\t\t\t\t\toptions={ linkOptions }\n\t\t\t\t\t\thideCancelButton={ true }\n\t\t\t\t\t/>\n\t\t\t\t\t{ shouldShowSizeOptions && (\n\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\tlabel={ __( 'Image size' ) }\n\t\t\t\t\t\t\tvalue={ sizeSlug }\n\t\t\t\t\t\t\toptions={ imageSizeOptions }\n\t\t\t\t\t\t\tonChange={ updateImagesSize }\n\t\t\t\t\t\t\thideCancelButton={ true }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t{ noticeUI }\n\t\t\t<Gallery\n\t\t\t\t{ ...props }\n\t\t\t\tselectedImage={ selectedImage }\n\t\t\t\tmediaPlaceholder={ mediaPlaceholder }\n\t\t\t\tonMoveBackward={ onMoveBackward }\n\t\t\t\tonMoveForward={ onMoveForward }\n\t\t\t\tonRemoveImage={ onRemoveImage }\n\t\t\t\tonSelectImage={ onSelectImage }\n\t\t\t\tonDeselectImage={ onDeselectImage }\n\t\t\t\tonSetImageAttributes={ setImageAttributes }\n\t\t\t\tblockProps={ blockProps }\n\t\t\t\t// This prop is used by gallery.native.js.\n\t\t\t\tonFocusGalleryCaption={ onFocusGalleryCaption }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default compose( [\n\twithNotices,\n\twithViewportMatch( { isNarrow: '< small' } ),\n] )( GalleryEdit );\n"]}
|
|
@@ -11,8 +11,6 @@ var _element = require("@wordpress/element");
|
|
|
11
11
|
|
|
12
12
|
var _reactNative = require("react-native");
|
|
13
13
|
|
|
14
|
-
var _lodash = require("lodash");
|
|
15
|
-
|
|
16
14
|
var _galleryImage = _interopRequireDefault(require("./gallery-image"));
|
|
17
15
|
|
|
18
16
|
var _deprecated = require("../deprecated");
|
|
@@ -141,7 +139,7 @@ const Gallery = props => {
|
|
|
141
139
|
clientId: clientId,
|
|
142
140
|
isSelected: isCaptionSelected,
|
|
143
141
|
accessible: true,
|
|
144
|
-
accessibilityLabelCreator: caption =>
|
|
142
|
+
accessibilityLabelCreator: caption => !caption ?
|
|
145
143
|
/* translators: accessibility text. Empty gallery caption. */
|
|
146
144
|
'Gallery caption. Empty' : (0, _i18n.sprintf)(
|
|
147
145
|
/* translators: accessibility text. %s: gallery caption. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/gallery/v1/gallery.native.js"],"names":["TILE_SPACING","MAX_DISPLAYED_COLUMNS","MAX_DISPLAYED_COLUMNS_NARROW","isFullWidth","alignmentHelpers","Gallery","props","isCaptionSelected","setIsCaptionSelected","mediaUploadSync","isRTL","select","blockEditorStore","getSettings","clientId","selectedImage","mediaPlaceholder","onBlur","onMoveBackward","onMoveForward","onRemoveImage","onSelectImage","onSetImageAttributes","onFocusGalleryCaption","attributes","isSelected","isNarrow","onFocus","insertBlocksAfter","align","columns","imageCrop","images","displayedColumns","Math","min","selectImage","index","focusGalleryCaption","flex","styles","galleryTilesContainerSelected","undefined","map","img","ariaLabel","length","id","url","alt","parseInt","attrs","caption","fullWidth"],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/gallery/v1/gallery.native.js"],"names":["TILE_SPACING","MAX_DISPLAYED_COLUMNS","MAX_DISPLAYED_COLUMNS_NARROW","isFullWidth","alignmentHelpers","Gallery","props","isCaptionSelected","setIsCaptionSelected","mediaUploadSync","isRTL","select","blockEditorStore","getSettings","clientId","selectedImage","mediaPlaceholder","onBlur","onMoveBackward","onMoveForward","onRemoveImage","onSelectImage","onSetImageAttributes","onFocusGalleryCaption","attributes","isSelected","isNarrow","onFocus","insertBlocksAfter","align","columns","imageCrop","images","displayedColumns","Math","min","selectImage","index","focusGalleryCaption","flex","styles","galleryTilesContainerSelected","undefined","map","img","ariaLabel","length","id","url","alt","parseInt","attrs","caption","fullWidth"],"mappings":";;;;;;;;;AAqBA;;AAlBA;;AAKA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAKA;;AACA;;AACA;;AAxBA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;AAWA,MAAMA,YAAY,GAAG,EAArB,C,CAEA;;AACA,MAAMC,qBAAqB,GAAG,CAA9B;AACA,MAAMC,4BAA4B,GAAG,CAArC;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAkBC,4BAAxB;;AAEO,MAAMC,OAAO,GAAKC,KAAF,IAAa;AACnC,QAAM,CAAEC,iBAAF,EAAqBC,oBAArB,IAA8C,uBAAU,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a,EAAKwB,KAAF,IACf7B,oBAAoB,CAAEe,KAAF,EAASc,KAAT,CAhBtB;AAkBC,MAAA,OAAO,EAAGP,GAAG,CAACQ,OAlBf;AAmBC,oBAAaP,SAnBd;AAoBC,MAAA,KAAK,EAAGnC;AApBT,MADD;AAwBA,GAhCC,CATH,CADD,EA4CC,4BAAC,iBAAD;AAAM,IAAA,KAAK,EAAGP,WAAW,CAAE0B,KAAF,CAAX,IAAwBW,uBAAOa;AAA7C,KACGrC,gBADH,CA5CD,EA+CC,4BAAC,yBAAD;AACC,IAAA,QAAQ,EAAGF,QADZ;AAEC,IAAA,UAAU,EAAGP,iBAFd;AAGC,IAAA,UAAU,EAAG,IAHd;AAIC,IAAA,yBAAyB,EAAK6C,OAAF,IAC3B,CAAEA,OAAF;AACG;AACA,4BAFH,GAGG;AACA;AACA,kBAAI,qBAAJ,CAFA,EAGAA,OAHA,CARL;AAcC,IAAA,OAAO,EAAGd,mBAdX;AAeC,IAAA,MAAM,EAAGrB,MAfV,CAemB;AAfnB;AAgBC,IAAA,iBAAiB,EAAGW;AAhBrB,IA/CD,CADD;AAoEA,CA5HM;;;eA8HQvB,O","sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\n/**\n * Internal dependencies\n */\nimport GalleryImage from './gallery-image';\nimport { defaultColumnsNumberV1 } from '../deprecated';\nimport styles from './gallery-styles.scss';\nimport Tiles from './tiles';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tBlockCaption,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useState, useEffect } from '@wordpress/element';\nimport { mediaUploadSync } from '@wordpress/react-native-bridge';\nimport { useSelect } from '@wordpress/data';\nimport { alignmentHelpers } from '@wordpress/components';\n\nconst TILE_SPACING = 15;\n\n// we must limit displayed columns since readable content max-width is 580px\nconst MAX_DISPLAYED_COLUMNS = 4;\nconst MAX_DISPLAYED_COLUMNS_NARROW = 2;\n\nconst { isFullWidth } = alignmentHelpers;\n\nexport const Gallery = ( props ) => {\n\tconst [ isCaptionSelected, setIsCaptionSelected ] = useState( false );\n\tuseEffect( mediaUploadSync, [] );\n\n\tconst isRTL = useSelect( ( select ) => {\n\t\treturn !! select( blockEditorStore ).getSettings().isRTL;\n\t}, [] );\n\n\tconst {\n\t\tclientId,\n\t\tselectedImage,\n\t\tmediaPlaceholder,\n\t\tonBlur,\n\t\tonMoveBackward,\n\t\tonMoveForward,\n\t\tonRemoveImage,\n\t\tonSelectImage,\n\t\tonSetImageAttributes,\n\t\tonFocusGalleryCaption,\n\t\tattributes,\n\t\tisSelected,\n\t\tisNarrow,\n\t\tonFocus,\n\t\tinsertBlocksAfter,\n\t} = props;\n\n\tconst {\n\t\talign,\n\t\tcolumns = defaultColumnsNumberV1( attributes ),\n\t\timageCrop,\n\t\timages,\n\t} = attributes;\n\n\t// limit displayed columns when isNarrow is true (i.e. when viewport width is\n\t// less than \"small\", where small = 600)\n\tconst displayedColumns = isNarrow\n\t\t? Math.min( columns, MAX_DISPLAYED_COLUMNS_NARROW )\n\t\t: Math.min( columns, MAX_DISPLAYED_COLUMNS );\n\n\tconst selectImage = ( index ) => {\n\t\treturn () => {\n\t\t\tif ( isCaptionSelected ) {\n\t\t\t\tsetIsCaptionSelected( false );\n\t\t\t}\n\t\t\t// We need to fully invoke the curried function here.\n\t\t\tonSelectImage( index )();\n\t\t};\n\t};\n\n\tconst focusGalleryCaption = () => {\n\t\tif ( ! isCaptionSelected ) {\n\t\t\tsetIsCaptionSelected( true );\n\t\t}\n\t\tonFocusGalleryCaption();\n\t};\n\n\treturn (\n\t\t<View style={ { flex: 1 } }>\n\t\t\t<Tiles\n\t\t\t\tcolumns={ displayedColumns }\n\t\t\t\tspacing={ TILE_SPACING }\n\t\t\t\tstyle={\n\t\t\t\t\tisSelected\n\t\t\t\t\t\t? styles.galleryTilesContainerSelected\n\t\t\t\t\t\t: undefined\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t{ images.map( ( img, index ) => {\n\t\t\t\t\tconst ariaLabel = sprintf(\n\t\t\t\t\t\t/* translators: 1: the order number of the image. 2: the total number of images. */\n\t\t\t\t\t\t__( 'image %1$d of %2$d in gallery' ),\n\t\t\t\t\t\tindex + 1,\n\t\t\t\t\t\timages.length\n\t\t\t\t\t);\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<GalleryImage\n\t\t\t\t\t\t\tkey={ img.id ? `${ img.id }-${ index }` : img.url }\n\t\t\t\t\t\t\turl={ img.url }\n\t\t\t\t\t\t\talt={ img.alt }\n\t\t\t\t\t\t\tid={ parseInt( img.id, 10 ) } // make id an integer explicitly\n\t\t\t\t\t\t\tisCropped={ imageCrop }\n\t\t\t\t\t\t\tisFirstItem={ index === 0 }\n\t\t\t\t\t\t\tisLastItem={ index + 1 === images.length }\n\t\t\t\t\t\t\tisSelected={ isSelected && selectedImage === index }\n\t\t\t\t\t\t\tisBlockSelected={ isSelected }\n\t\t\t\t\t\t\tonMoveBackward={ onMoveBackward( index ) }\n\t\t\t\t\t\t\tonMoveForward={ onMoveForward( index ) }\n\t\t\t\t\t\t\tonRemove={ onRemoveImage( index ) }\n\t\t\t\t\t\t\tonSelect={ selectImage( index ) }\n\t\t\t\t\t\t\tonSelectBlock={ onFocus }\n\t\t\t\t\t\t\tsetAttributes={ ( attrs ) =>\n\t\t\t\t\t\t\t\tonSetImageAttributes( index, attrs )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcaption={ img.caption }\n\t\t\t\t\t\t\taria-label={ ariaLabel }\n\t\t\t\t\t\t\tisRTL={ isRTL }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</Tiles>\n\t\t\t<View style={ isFullWidth( align ) && styles.fullWidth }>\n\t\t\t\t{ mediaPlaceholder }\n\t\t\t</View>\n\t\t\t<BlockCaption\n\t\t\t\tclientId={ clientId }\n\t\t\t\tisSelected={ isCaptionSelected }\n\t\t\t\taccessible={ true }\n\t\t\t\taccessibilityLabelCreator={ ( caption ) =>\n\t\t\t\t\t! caption\n\t\t\t\t\t\t? /* translators: accessibility text. Empty gallery caption. */\n\t\t\t\t\t\t 'Gallery caption. Empty'\n\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t/* translators: accessibility text. %s: gallery caption. */\n\t\t\t\t\t\t\t\t__( 'Gallery caption. %s' ),\n\t\t\t\t\t\t\t\tcaption\n\t\t\t\t\t\t )\n\t\t\t\t}\n\t\t\t\tonFocus={ focusGalleryCaption }\n\t\t\t\tonBlur={ onBlur } // Always assign onBlur as props.\n\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t/>\n\t\t</View>\n\t);\n};\n\nexport default Gallery;\n"]}
|
|
@@ -12,7 +12,10 @@ var _lodash = require("lodash");
|
|
|
12
12
|
*/
|
|
13
13
|
const pickRelevantMediaFiles = function (image) {
|
|
14
14
|
let sizeSlug = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'large';
|
|
15
|
-
const imageProps = (
|
|
15
|
+
const imageProps = Object.fromEntries(Object.entries(image !== null && image !== void 0 ? image : {}).filter(_ref => {
|
|
16
|
+
let [key] = _ref;
|
|
17
|
+
return ['alt', 'id', 'link', 'caption'].includes(key);
|
|
18
|
+
}));
|
|
16
19
|
imageProps.url = (0, _lodash.get)(image, ['sizes', sizeSlug, 'url']) || (0, _lodash.get)(image, ['media_details', 'sizes', sizeSlug, 'source_url']) || image.url;
|
|
17
20
|
const fullUrl = (0, _lodash.get)(image, ['sizes', 'full', 'url']) || (0, _lodash.get)(image, ['media_details', 'sizes', 'full', 'source_url']);
|
|
18
21
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/gallery/v1/shared.js"],"names":["pickRelevantMediaFiles","image","sizeSlug","imageProps","url","fullUrl"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;AAGO,MAAMA,sBAAsB,GAAG,UAAEC,KAAF,EAAiC;AAAA,MAAxBC,QAAwB,uEAAb,OAAa;AACtE,QAAMC,UAAU,
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/gallery/v1/shared.js"],"names":["pickRelevantMediaFiles","image","sizeSlug","imageProps","Object","fromEntries","entries","filter","key","includes","url","fullUrl"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;AAGO,MAAMA,sBAAsB,GAAG,UAAEC,KAAF,EAAiC;AAAA,MAAxBC,QAAwB,uEAAb,OAAa;AACtE,QAAMC,UAAU,GAAGC,MAAM,CAACC,WAAP,CAClBD,MAAM,CAACE,OAAP,CAAgBL,KAAhB,aAAgBA,KAAhB,cAAgBA,KAAhB,GAAyB,EAAzB,EAA8BM,MAA9B,CAAsC;AAAA,QAAE,CAAEC,GAAF,CAAF;AAAA,WACrC,CAAE,KAAF,EAAS,IAAT,EAAe,MAAf,EAAuB,SAAvB,EAAmCC,QAAnC,CAA6CD,GAA7C,CADqC;AAAA,GAAtC,CADkB,CAAnB;AAMAL,EAAAA,UAAU,CAACO,GAAX,GACC,iBAAKT,KAAL,EAAY,CAAE,OAAF,EAAWC,QAAX,EAAqB,KAArB,CAAZ,KACA,iBAAKD,KAAL,EAAY,CAAE,eAAF,EAAmB,OAAnB,EAA4BC,QAA5B,EAAsC,YAAtC,CAAZ,CADA,IAEAD,KAAK,CAACS,GAHP;AAIA,QAAMC,OAAO,GACZ,iBAAKV,KAAL,EAAY,CAAE,OAAF,EAAW,MAAX,EAAmB,KAAnB,CAAZ,KACA,iBAAKA,KAAL,EAAY,CAAE,eAAF,EAAmB,OAAnB,EAA4B,MAA5B,EAAoC,YAApC,CAAZ,CAFD;;AAGA,MAAKU,OAAL,EAAe;AACdR,IAAAA,UAAU,CAACQ,OAAX,GAAqBA,OAArB;AACA;;AACD,SAAOR,UAAP;AACA,CAlBM","sourcesContent":["/**\n * External dependencies\n */\nimport { get } from 'lodash';\n\nexport const pickRelevantMediaFiles = ( image, sizeSlug = 'large' ) => {\n\tconst imageProps = Object.fromEntries(\n\t\tObject.entries( image ?? {} ).filter( ( [ key ] ) =>\n\t\t\t[ 'alt', 'id', 'link', 'caption' ].includes( key )\n\t\t)\n\t);\n\n\timageProps.url =\n\t\tget( image, [ 'sizes', sizeSlug, 'url' ] ) ||\n\t\tget( image, [ 'media_details', 'sizes', sizeSlug, 'source_url' ] ) ||\n\t\timage.url;\n\tconst fullUrl =\n\t\tget( image, [ 'sizes', 'full', 'url' ] ) ||\n\t\tget( image, [ 'media_details', 'sizes', 'full', 'source_url' ] );\n\tif ( fullUrl ) {\n\t\timageProps.fullUrl = fullUrl;\n\t}\n\treturn imageProps;\n};\n"]}
|
package/build/group/edit.js
CHANGED
|
@@ -15,25 +15,82 @@ var _components = require("@wordpress/components");
|
|
|
15
15
|
|
|
16
16
|
var _i18n = require("@wordpress/i18n");
|
|
17
17
|
|
|
18
|
+
var _placeholder = _interopRequireWildcard(require("./placeholder"));
|
|
19
|
+
|
|
20
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
+
|
|
22
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
+
|
|
18
24
|
/**
|
|
19
25
|
* WordPress dependencies
|
|
20
26
|
*/
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Internal dependencies
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Render inspector controls for the Group block.
|
|
34
|
+
*
|
|
35
|
+
* @param {Object} props Component props.
|
|
36
|
+
* @param {string} props.tagName The HTML tag name.
|
|
37
|
+
* @param {Function} props.onSelectTagName onChange function for the SelectControl.
|
|
38
|
+
*
|
|
39
|
+
* @return {JSX.Element} The control group.
|
|
40
|
+
*/
|
|
41
|
+
function GroupEditControls(_ref) {
|
|
42
|
+
let {
|
|
43
|
+
tagName,
|
|
44
|
+
onSelectTagName
|
|
45
|
+
} = _ref;
|
|
46
|
+
const htmlElementMessages = {
|
|
47
|
+
header: (0, _i18n.__)('The <header> element should represent introductory content, typically a group of introductory or navigational aids.'),
|
|
48
|
+
main: (0, _i18n.__)('The <main> element should be used for the primary content of your document only. '),
|
|
49
|
+
section: (0, _i18n.__)("The <section> element should represent a standalone portion of the document that can't be better represented by another element."),
|
|
50
|
+
article: (0, _i18n.__)('The <article> element should represent a self-contained, syndicatable portion of the document.'),
|
|
51
|
+
aside: (0, _i18n.__)("The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content."),
|
|
52
|
+
footer: (0, _i18n.__)('The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.).')
|
|
53
|
+
};
|
|
54
|
+
return (0, _element.createElement)(_blockEditor.InspectorControls, {
|
|
55
|
+
__experimentalGroup: "advanced"
|
|
56
|
+
}, (0, _element.createElement)(_components.SelectControl, {
|
|
57
|
+
label: (0, _i18n.__)('HTML element'),
|
|
58
|
+
options: [{
|
|
59
|
+
label: (0, _i18n.__)('Default (<div>)'),
|
|
60
|
+
value: 'div'
|
|
61
|
+
}, {
|
|
62
|
+
label: '<header>',
|
|
63
|
+
value: 'header'
|
|
64
|
+
}, {
|
|
65
|
+
label: '<main>',
|
|
66
|
+
value: 'main'
|
|
67
|
+
}, {
|
|
68
|
+
label: '<section>',
|
|
69
|
+
value: 'section'
|
|
70
|
+
}, {
|
|
71
|
+
label: '<article>',
|
|
72
|
+
value: 'article'
|
|
73
|
+
}, {
|
|
74
|
+
label: '<aside>',
|
|
75
|
+
value: 'aside'
|
|
76
|
+
}, {
|
|
77
|
+
label: '<footer>',
|
|
78
|
+
value: 'footer'
|
|
79
|
+
}],
|
|
80
|
+
value: tagName,
|
|
81
|
+
onChange: onSelectTagName,
|
|
82
|
+
help: htmlElementMessages[tagName]
|
|
83
|
+
}));
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function GroupEdit(_ref2) {
|
|
31
87
|
let {
|
|
32
88
|
attributes,
|
|
89
|
+
name,
|
|
33
90
|
setAttributes,
|
|
34
91
|
clientId,
|
|
35
92
|
__unstableLayoutClassNames: layoutClassNames
|
|
36
|
-
} =
|
|
93
|
+
} = _ref2;
|
|
37
94
|
const {
|
|
38
95
|
hasInnerBlocks,
|
|
39
96
|
themeSupportsLayout
|
|
@@ -50,12 +107,13 @@ function GroupEdit(_ref) {
|
|
|
50
107
|
themeSupportsLayout: (_getSettings = getSettings()) === null || _getSettings === void 0 ? void 0 : _getSettings.supportsLayout
|
|
51
108
|
};
|
|
52
109
|
}, [clientId]);
|
|
53
|
-
const defaultLayout = (0, _blockEditor.useSetting)('layout') || {};
|
|
54
110
|
const {
|
|
55
111
|
tagName: TagName = 'div',
|
|
56
112
|
templateLock,
|
|
57
113
|
layout = {}
|
|
58
|
-
} = attributes;
|
|
114
|
+
} = attributes; // Layout settings.
|
|
115
|
+
|
|
116
|
+
const defaultLayout = (0, _blockEditor.useSetting)('layout') || {};
|
|
59
117
|
const usedLayout = !(layout !== null && layout !== void 0 && layout.type) ? { ...defaultLayout,
|
|
60
118
|
...layout,
|
|
61
119
|
type: 'default'
|
|
@@ -65,10 +123,16 @@ function GroupEdit(_ref) {
|
|
|
65
123
|
const {
|
|
66
124
|
type = 'default'
|
|
67
125
|
} = usedLayout;
|
|
68
|
-
const layoutSupportEnabled = themeSupportsLayout || type === 'flex';
|
|
126
|
+
const layoutSupportEnabled = themeSupportsLayout || type === 'flex'; // Hooks.
|
|
127
|
+
|
|
69
128
|
const blockProps = (0, _blockEditor.useBlockProps)({
|
|
70
129
|
className: !layoutSupportEnabled ? layoutClassNames : null
|
|
71
130
|
});
|
|
131
|
+
const [showPlaceholder, setShowPlaceholder] = (0, _placeholder.useShouldShowPlaceHolder)({
|
|
132
|
+
attributes,
|
|
133
|
+
usedLayoutType: usedLayout === null || usedLayout === void 0 ? void 0 : usedLayout.type,
|
|
134
|
+
hasInnerBlocks
|
|
135
|
+
});
|
|
72
136
|
const innerBlocksProps = (0, _blockEditor.useInnerBlocksProps)(layoutSupportEnabled ? blockProps : {
|
|
73
137
|
className: 'wp-block-group__inner-container'
|
|
74
138
|
}, {
|
|
@@ -77,38 +141,26 @@ function GroupEdit(_ref) {
|
|
|
77
141
|
__experimentalLayout: layoutSupportEnabled ? usedLayout : undefined,
|
|
78
142
|
__unstableDisableLayoutClassNames: !layoutSupportEnabled
|
|
79
143
|
});
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}, {
|
|
94
|
-
label: '<section>',
|
|
95
|
-
value: 'section'
|
|
96
|
-
}, {
|
|
97
|
-
label: '<article>',
|
|
98
|
-
value: 'article'
|
|
99
|
-
}, {
|
|
100
|
-
label: '<aside>',
|
|
101
|
-
value: 'aside'
|
|
102
|
-
}, {
|
|
103
|
-
label: '<footer>',
|
|
104
|
-
value: 'footer'
|
|
105
|
-
}],
|
|
106
|
-
value: TagName,
|
|
107
|
-
onChange: value => setAttributes({
|
|
144
|
+
const {
|
|
145
|
+
selectBlock
|
|
146
|
+
} = (0, _data.useDispatch)(_blockEditor.store);
|
|
147
|
+
|
|
148
|
+
const selectVariation = nextVariation => {
|
|
149
|
+
setAttributes(nextVariation.attributes);
|
|
150
|
+
selectBlock(clientId, -1);
|
|
151
|
+
setShowPlaceholder(false);
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(GroupEditControls, {
|
|
155
|
+
tagName: TagName,
|
|
156
|
+
onSelectTagName: value => setAttributes({
|
|
108
157
|
tagName: value
|
|
109
|
-
})
|
|
110
|
-
|
|
111
|
-
|
|
158
|
+
})
|
|
159
|
+
}), showPlaceholder && (0, _element.createElement)(_placeholder.default, {
|
|
160
|
+
clientId: clientId,
|
|
161
|
+
name: name,
|
|
162
|
+
onSelect: selectVariation
|
|
163
|
+
}), layoutSupportEnabled && !showPlaceholder && (0, _element.createElement)(TagName, innerBlocksProps), !layoutSupportEnabled && !showPlaceholder && (0, _element.createElement)(TagName, blockProps, (0, _element.createElement)("div", innerBlocksProps)));
|
|
112
164
|
}
|
|
113
165
|
|
|
114
166
|
var _default = GroupEdit;
|
package/build/group/edit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/group/edit.js"],"names":["htmlElementMessages","header","main","section","article","aside","footer","GroupEdit","attributes","setAttributes","clientId","__unstableLayoutClassNames","layoutClassNames","hasInnerBlocks","themeSupportsLayout","select","getBlock","getSettings","blockEditorStore","block","innerBlocks","length","supportsLayout","
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/group/edit.js"],"names":["GroupEditControls","tagName","onSelectTagName","htmlElementMessages","header","main","section","article","aside","footer","label","value","GroupEdit","attributes","name","setAttributes","clientId","__unstableLayoutClassNames","layoutClassNames","hasInnerBlocks","themeSupportsLayout","select","getBlock","getSettings","blockEditorStore","block","innerBlocks","length","supportsLayout","TagName","templateLock","layout","defaultLayout","usedLayout","type","layoutSupportEnabled","blockProps","className","showPlaceholder","setShowPlaceholder","usedLayoutType","innerBlocksProps","renderAppender","undefined","InnerBlocks","ButtonBlockAppender","__experimentalLayout","__unstableDisableLayoutClassNames","selectBlock","selectVariation","nextVariation"],"mappings":";;;;;;;;;AAGA;;AACA;;AAQA;;AACA;;AAKA;;;;;;AAlBA;AACA;AACA;;AAaA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,iBAAT,OAA2D;AAAA,MAA/B;AAAEC,IAAAA,OAAF;AAAWC,IAAAA;AAAX,GAA+B;AAC1D,QAAMC,mBAAmB,GAAG;AAC3BC,IAAAA,MAAM,EAAE,cACP,qHADO,CADmB;AAI3BC,IAAAA,IAAI,EAAE,cACL,mFADK,CAJqB;AAO3BC,IAAAA,OAAO,EAAE,cACR,kIADQ,CAPkB;AAU3BC,IAAAA,OAAO,EAAE,cACR,gGADQ,CAVkB;AAa3BC,IAAAA,KAAK,EAAE,cACN,uIADM,CAboB;AAgB3BC,IAAAA,MAAM,EAAE,cACP,8HADO;AAhBmB,GAA5B;AAoBA,SACC,4BAAC,8BAAD;AAAmB,IAAA,mBAAmB,EAAC;AAAvC,KACC,4BAAC,yBAAD;AACC,IAAA,KAAK,EAAG,cAAI,cAAJ,CADT;AAEC,IAAA,OAAO,EAAG,CACT;AAAEC,MAAAA,KAAK,EAAE,cAAI,iBAAJ,CAAT;AAAkCC,MAAAA,KAAK,EAAE;AAAzC,KADS,EAET;AAAED,MAAAA,KAAK,EAAE,UAAT;AAAqBC,MAAAA,KAAK,EAAE;AAA5B,KAFS,EAGT;AAAED,MAAAA,KAAK,EAAE,QAAT;AAAmBC,MAAAA,KAAK,EAAE;AAA1B,KAHS,EAIT;AAAED,MAAAA,KAAK,EAAE,WAAT;AAAsBC,MAAAA,KAAK,EAAE;AAA7B,K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A,GAJD;;AAMA,SACC,qDACC,4BAAC,iBAAD;AACC,IAAA,OAAO,EAAGV,OADX;AAEC,IAAA,eAAe,EAAKlB,KAAF,IACjBI,aAAa,CAAE;AAAEd,MAAAA,OAAO,EAAEU;AAAX,KAAF;AAHf,IADD,EAOG2B,eAAe,IAChB,4BAAC,oBAAD;AACC,IAAA,QAAQ,EAAGtB,QADZ;AAEC,IAAA,IAAI,EAAGF,IAFR;AAGC,IAAA,QAAQ,EAAGmC;AAHZ,IARF,EAcGd,oBAAoB,IAAI,CAAEG,eAA1B,IACD,4BAAC,OAAD,EAAcG,gBAAd,CAfF,EAmBG,CAAEN,oBAAF,IAA0B,CAAEG,eAA5B,IACD,4BAAC,OAAD,EAAcF,UAAd,EACC,mCAAUK,gBAAV,CADD,CApBF,CADD;AA2BA;;eAEc7B,S","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tInnerBlocks,\n\tuseBlockProps,\n\tInspectorControls,\n\tuseInnerBlocksProps,\n\tuseSetting,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { SelectControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport GroupPlaceHolder, { useShouldShowPlaceHolder } from './placeholder';\n\n/**\n * Render inspector controls for the Group block.\n *\n * @param {Object} props Component props.\n * @param {string} props.tagName The HTML tag name.\n * @param {Function} props.onSelectTagName onChange function for the SelectControl.\n *\n * @return {JSX.Element} The control group.\n */\nfunction GroupEditControls( { tagName, onSelectTagName } ) {\n\tconst htmlElementMessages = {\n\t\theader: __(\n\t\t\t'The <header> element should represent introductory content, typically a group of introductory or navigational aids.'\n\t\t),\n\t\tmain: __(\n\t\t\t'The <main> element should be used for the primary content of your document only. '\n\t\t),\n\t\tsection: __(\n\t\t\t\"The <section> element should represent a standalone portion of the document that can't be better represented by another element.\"\n\t\t),\n\t\tarticle: __(\n\t\t\t'The <article> element should represent a self-contained, syndicatable portion of the document.'\n\t\t),\n\t\taside: __(\n\t\t\t\"The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content.\"\n\t\t),\n\t\tfooter: __(\n\t\t\t'The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.).'\n\t\t),\n\t};\n\treturn (\n\t\t<InspectorControls __experimentalGroup=\"advanced\">\n\t\t\t<SelectControl\n\t\t\t\tlabel={ __( 'HTML element' ) }\n\t\t\t\toptions={ [\n\t\t\t\t\t{ label: __( 'Default (<div>)' ), value: 'div' },\n\t\t\t\t\t{ label: '<header>', value: 'header' },\n\t\t\t\t\t{ label: '<main>', value: 'main' },\n\t\t\t\t\t{ label: '<section>', value: 'section' },\n\t\t\t\t\t{ label: '<article>', value: 'article' },\n\t\t\t\t\t{ label: '<aside>', value: 'aside' },\n\t\t\t\t\t{ label: '<footer>', value: 'footer' },\n\t\t\t\t] }\n\t\t\t\tvalue={ tagName }\n\t\t\t\tonChange={ onSelectTagName }\n\t\t\t\thelp={ htmlElementMessages[ tagName ] }\n\t\t\t/>\n\t\t</InspectorControls>\n\t);\n}\n\nfunction GroupEdit( {\n\tattributes,\n\tname,\n\tsetAttributes,\n\tclientId,\n\t__unstableLayoutClassNames: layoutClassNames,\n} ) {\n\tconst { hasInnerBlocks, themeSupportsLayout } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlock, getSettings } = select( blockEditorStore );\n\t\t\tconst block = getBlock( clientId );\n\t\t\treturn {\n\t\t\t\thasInnerBlocks: !! ( block && block.innerBlocks.length ),\n\t\t\t\tthemeSupportsLayout: getSettings()?.supportsLayout,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst { tagName: TagName = 'div', templateLock, layout = {} } = attributes;\n\n\t// Layout settings.\n\tconst defaultLayout = useSetting( 'layout' ) || {};\n\tconst usedLayout = ! layout?.type\n\t\t? { ...defaultLayout, ...layout, type: 'default' }\n\t\t: { ...defaultLayout, ...layout };\n\tconst { type = 'default' } = usedLayout;\n\tconst layoutSupportEnabled = themeSupportsLayout || type === 'flex';\n\n\t// Hooks.\n\tconst blockProps = useBlockProps( {\n\t\tclassName: ! layoutSupportEnabled ? layoutClassNames : null,\n\t} );\n\tconst [ showPlaceholder, setShowPlaceholder ] = useShouldShowPlaceHolder( {\n\t\tattributes,\n\t\tusedLayoutType: usedLayout?.type,\n\t\thasInnerBlocks,\n\t} );\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\tlayoutSupportEnabled\n\t\t\t? blockProps\n\t\t\t: { className: 'wp-block-group__inner-container' },\n\t\t{\n\t\t\ttemplateLock,\n\t\t\trenderAppender: hasInnerBlocks\n\t\t\t\t? undefined\n\t\t\t\t: InnerBlocks.ButtonBlockAppender,\n\t\t\t__experimentalLayout: layoutSupportEnabled ? usedLayout : undefined,\n\t\t\t__unstableDisableLayoutClassNames: ! layoutSupportEnabled,\n\t\t}\n\t);\n\n\tconst { selectBlock } = useDispatch( blockEditorStore );\n\n\tconst selectVariation = ( nextVariation ) => {\n\t\tsetAttributes( nextVariation.attributes );\n\t\tselectBlock( clientId, -1 );\n\t\tsetShowPlaceholder( false );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<GroupEditControls\n\t\t\t\ttagName={ TagName }\n\t\t\t\tonSelectTagName={ ( value ) =>\n\t\t\t\t\tsetAttributes( { tagName: value } )\n\t\t\t\t}\n\t\t\t/>\n\t\t\t{ showPlaceholder && (\n\t\t\t\t<GroupPlaceHolder\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tname={ name }\n\t\t\t\t\tonSelect={ selectVariation }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ layoutSupportEnabled && ! showPlaceholder && (\n\t\t\t\t<TagName { ...innerBlocksProps } />\n\t\t\t) }\n\t\t\t{ /* Ideally this is not needed but it's there for backward compatibility reason\n\t\t\t\tto keep this div for themes that might rely on its presence */ }\n\t\t\t{ ! layoutSupportEnabled && ! showPlaceholder && (\n\t\t\t\t<TagName { ...blockProps }>\n\t\t\t\t\t<div { ...innerBlocksProps } />\n\t\t\t\t</TagName>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default GroupEdit;\n"]}
|
package/build/group/index.js
CHANGED
|
@@ -73,6 +73,9 @@ const metadata = {
|
|
|
73
73
|
blockGap: true
|
|
74
74
|
}
|
|
75
75
|
},
|
|
76
|
+
dimensions: {
|
|
77
|
+
minHeight: true
|
|
78
|
+
},
|
|
76
79
|
__experimentalBorder: {
|
|
77
80
|
color: true,
|
|
78
81
|
radius: true,
|
|
@@ -98,7 +101,9 @@ const metadata = {
|
|
|
98
101
|
fontSize: true
|
|
99
102
|
}
|
|
100
103
|
},
|
|
101
|
-
__experimentalLayout:
|
|
104
|
+
__experimentalLayout: {
|
|
105
|
+
allowSizingOnChildren: true
|
|
106
|
+
}
|
|
102
107
|
},
|
|
103
108
|
editorStyle: "wp-block-group-editor",
|
|
104
109
|
style: "wp-block-group"
|
package/build/group/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/group/index.js"],"names":["name","metadata","settings","icon","example","attributes","style","color","text","background","innerBlocks","customTextColor","fontSize","content","transforms","edit","save","deprecated","variations","init"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AAfA;AACA;AACA;;AAIA;AACA;AACA
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/group/index.js"],"names":["name","metadata","settings","icon","example","attributes","style","color","text","background","innerBlocks","customTextColor","fontSize","content","transforms","edit","save","deprecated","variations","init"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AAfA;AACA;AACA;;AAIA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,MAAM;AAAEA,EAAAA;AAAF,IAAW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,EAAE,gBADP;AAECK,MAAAA,UAAU,EAAE;AACXM,QAAAA,eAAe,EAAE,SADN;AAEXC,QAAAA,QAAQ,EAAE,OAFC;AAGXC,QAAAA,OAAO,EAAE,cAAI,MAAJ;AAHE;AAFb,KAzCY;AATL,GAFc;AA8DvBC,EAAAA,UAAU,EAAVA,mBA9DuB;AA+DvBC,EAAAA,IAAI,EAAJA,aA/DuB;AAgEvBC,EAAAA,IAAI,EAAJA,aAhEuB;AAiEvBC,EAAAA,UAAU,EAAVA,mBAjEuB;AAkEvBC,EAAAA,UAAU,EAAVA;AAlEuB,CAAjB;;;AAqEA,MAAMC,IAAI,GAAG,MAAM,wBAAW;AAAEnB,EAAAA,IAAF;AAAQC,EAAAA,QAAR;AAAkBC,EAAAA;AAAlB,CAAX,CAAnB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { group as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\nimport variations from './variations';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tstyle: {\n\t\t\t\tcolor: {\n\t\t\t\t\ttext: '#000000',\n\t\t\t\t\tbackground: '#ffffff',\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tinnerBlocks: [\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcustomTextColor: '#cf2e2e',\n\t\t\t\t\tfontSize: 'large',\n\t\t\t\t\tcontent: __( 'One.' ),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcustomTextColor: '#ff6900',\n\t\t\t\t\tfontSize: 'large',\n\t\t\t\t\tcontent: __( 'Two.' ),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcustomTextColor: '#fcb900',\n\t\t\t\t\tfontSize: 'large',\n\t\t\t\t\tcontent: __( 'Three.' ),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcustomTextColor: '#00d084',\n\t\t\t\t\tfontSize: 'large',\n\t\t\t\t\tcontent: __( 'Four.' ),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcustomTextColor: '#0693e3',\n\t\t\t\t\tfontSize: 'large',\n\t\t\t\t\tcontent: __( 'Five.' ),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcustomTextColor: '#9b51e0',\n\t\t\t\t\tfontSize: 'large',\n\t\t\t\t\tcontent: __( 'Six.' ),\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n\ttransforms,\n\tedit,\n\tsave,\n\tdeprecated,\n\tvariations,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"]}
|