@wordpress/block-library 7.0.2 → 7.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/audio/edit.js +4 -4
- package/build/audio/edit.js.map +1 -1
- package/build/audio/edit.native.js +4 -4
- package/build/audio/edit.native.js.map +1 -1
- package/build/audio/transforms.js +1 -1
- package/build/audio/transforms.js.map +1 -1
- package/build/block/edit.js +3 -9
- package/build/block/edit.js.map +1 -1
- package/build/button/edit.js +3 -2
- package/build/button/edit.js.map +1 -1
- package/build/button/edit.native.js +2 -2
- package/build/button/edit.native.js.map +1 -1
- package/build/buttons/transforms.js +8 -8
- package/build/buttons/transforms.js.map +1 -1
- package/build/categories/edit.js +15 -26
- package/build/categories/edit.js.map +1 -1
- package/build/code/index.js +0 -1
- package/build/code/index.js.map +1 -1
- package/build/columns/columnCalculations.native.js +1 -1
- package/build/columns/columnCalculations.native.js.map +1 -1
- package/build/columns/edit.js +1 -1
- package/build/columns/edit.js.map +1 -1
- package/build/columns/edit.native.js +3 -3
- package/build/columns/edit.native.js.map +1 -1
- package/build/cover/controls.native.js +5 -5
- package/build/cover/controls.native.js.map +1 -1
- package/build/cover/deprecated.js +188 -17
- package/build/cover/deprecated.js.map +1 -1
- package/build/cover/edit.js +8 -11
- package/build/cover/edit.js.map +1 -1
- package/build/cover/edit.native.js +8 -8
- package/build/cover/edit.native.js.map +1 -1
- package/build/cover/overlay-color-settings.native.js +3 -3
- package/build/cover/overlay-color-settings.native.js.map +1 -1
- package/build/cover/save.js +1 -1
- package/build/cover/save.js.map +1 -1
- package/build/cover/shared.js +2 -2
- package/build/cover/shared.js.map +1 -1
- package/build/embed/edit.js +1 -1
- package/build/embed/edit.js.map +1 -1
- package/build/embed/edit.native.js +1 -1
- package/build/embed/edit.native.js.map +1 -1
- package/build/embed/util.js +2 -2
- package/build/embed/util.js.map +1 -1
- package/build/embed/variations.js +1 -1
- package/build/embed/variations.js.map +1 -1
- package/build/file/edit.js +20 -17
- package/build/file/edit.js.map +1 -1
- package/build/file/edit.native.js +1 -1
- package/build/file/edit.native.js.map +1 -1
- package/build/file/save.js +7 -3
- package/build/file/save.js.map +1 -1
- package/build/freeform/edit.js +2 -2
- package/build/freeform/edit.js.map +1 -1
- package/build/gallery/edit.js +1 -1
- package/build/gallery/edit.js.map +1 -1
- package/build/gallery/gallery.native.js +1 -1
- package/build/gallery/gallery.native.js.map +1 -1
- package/build/gallery/v1/edit.js +3 -3
- package/build/gallery/v1/edit.js.map +1 -1
- package/build/gallery/v1/gallery-image.native.js +3 -3
- package/build/gallery/v1/gallery-image.native.js.map +1 -1
- package/build/gallery/v1/gallery.native.js +2 -2
- package/build/gallery/v1/gallery.native.js.map +1 -1
- package/build/group/index.js +3 -37
- package/build/group/index.js.map +1 -1
- package/build/group/transforms.js +45 -0
- package/build/group/transforms.js.map +1 -0
- package/build/home-link/edit.js +1 -1
- package/build/home-link/edit.js.map +1 -1
- package/build/image/edit.js +7 -6
- package/build/image/edit.js.map +1 -1
- package/build/image/edit.native.js +25 -10
- package/build/image/edit.native.js.map +1 -1
- package/build/image/transforms.js +1 -1
- package/build/image/transforms.js.map +1 -1
- package/build/index.js +3 -4
- package/build/index.js.map +1 -1
- package/build/index.native.js +2 -2
- package/build/index.native.js.map +1 -1
- package/build/media-text/edit.js +21 -2
- package/build/media-text/edit.js.map +1 -1
- package/build/media-text/edit.native.js +2 -2
- package/build/media-text/edit.native.js.map +1 -1
- package/build/media-text/media-container.native.js +1 -1
- package/build/media-text/media-container.native.js.map +1 -1
- package/build/missing/edit.native.js +1 -1
- package/build/missing/edit.native.js.map +1 -1
- package/build/more/transforms.js +2 -2
- package/build/more/transforms.js.map +1 -1
- package/build/navigation/edit/index.js +134 -60
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/inner-blocks.js +8 -3
- package/build/navigation/edit/inner-blocks.js.map +1 -1
- package/build/navigation/edit/navigation-menu-selector.js +66 -53
- package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build/navigation/edit/placeholder/index.js +31 -46
- package/build/navigation/edit/placeholder/index.js.map +1 -1
- package/build/navigation/edit/placeholder/placeholder-preview.js +3 -12
- package/build/navigation/edit/placeholder/placeholder-preview.js.map +1 -1
- package/build/navigation/edit/unsaved-inner-blocks.js +3 -1
- package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js +120 -0
- package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -0
- package/build/navigation/edit/use-create-navigation-menu.js +53 -4
- package/build/navigation/edit/use-create-navigation-menu.js.map +1 -1
- package/build/navigation/edit/use-navigation-notice.js +3 -3
- package/build/navigation/edit/use-navigation-notice.js.map +1 -1
- package/build/navigation/menu-items-to-blocks.js +1 -1
- package/build/navigation/menu-items-to-blocks.js.map +1 -1
- package/build/navigation/use-navigation-entities.js +25 -49
- package/build/navigation/use-navigation-entities.js.map +1 -1
- package/build/navigation/use-navigation-menu.js +2 -0
- package/build/navigation/use-navigation-menu.js.map +1 -1
- package/build/navigation-link/fallback-variations.js +1 -1
- package/build/navigation-link/fallback-variations.js.map +1 -1
- package/build/navigation-link/hooks.js +2 -2
- package/build/navigation-link/hooks.js.map +1 -1
- package/build/navigation-submenu/edit.js +2 -2
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/page-list/convert-to-links-modal.js +13 -23
- package/build/page-list/convert-to-links-modal.js.map +1 -1
- package/build/page-list/edit.js +8 -22
- package/build/page-list/edit.js.map +1 -1
- package/build/post-author-name/edit.js +2 -1
- package/build/post-author-name/edit.js.map +1 -1
- package/build/post-comments-form/edit.js +3 -1
- package/build/post-comments-form/edit.js.map +1 -1
- package/build/post-excerpt/edit.js +7 -4
- package/build/post-excerpt/edit.js.map +1 -1
- package/build/post-terms/edit.js +3 -1
- package/build/post-terms/edit.js.map +1 -1
- package/build/query-title/edit.js +0 -1
- package/build/query-title/edit.js.map +1 -1
- package/build/search/edit.js +4 -1
- package/build/search/edit.js.map +1 -1
- package/build/search/edit.native.js +1 -1
- package/build/search/edit.native.js.map +1 -1
- package/build/separator/save.js +4 -4
- package/build/separator/save.js.map +1 -1
- package/build/separator/separator-settings.native.js +1 -1
- package/build/separator/separator-settings.native.js.map +1 -1
- package/build/site-logo/edit.js +1 -1
- package/build/site-logo/edit.js.map +1 -1
- package/build/social-link/edit.native.js +11 -3
- package/build/social-link/edit.native.js.map +1 -1
- package/build/spacer/controls.js +5 -5
- package/build/spacer/controls.js.map +1 -1
- package/build/spacer/controls.native.js +5 -5
- package/build/spacer/controls.native.js.map +1 -1
- package/build/table/edit.js +2 -2
- package/build/table/edit.js.map +1 -1
- package/build/video/edit.js +4 -4
- package/build/video/edit.js.map +1 -1
- package/build/video/edit.native.js +3 -3
- package/build/video/edit.native.js.map +1 -1
- package/build-module/audio/edit.js +4 -4
- package/build-module/audio/edit.js.map +1 -1
- package/build-module/audio/edit.native.js +4 -4
- package/build-module/audio/edit.native.js.map +1 -1
- package/build-module/audio/transforms.js +1 -1
- package/build-module/audio/transforms.js.map +1 -1
- package/build-module/block/edit.js +5 -11
- package/build-module/block/edit.js.map +1 -1
- package/build-module/button/edit.js +3 -2
- package/build-module/button/edit.js.map +1 -1
- package/build-module/button/edit.native.js +2 -2
- package/build-module/button/edit.native.js.map +1 -1
- package/build-module/buttons/transforms.js +8 -8
- package/build-module/buttons/transforms.js.map +1 -1
- package/build-module/categories/edit.js +15 -25
- package/build-module/categories/edit.js.map +1 -1
- package/build-module/code/index.js +0 -1
- package/build-module/code/index.js.map +1 -1
- package/build-module/columns/columnCalculations.native.js +1 -1
- package/build-module/columns/columnCalculations.native.js.map +1 -1
- package/build-module/columns/edit.js +1 -1
- package/build-module/columns/edit.js.map +1 -1
- package/build-module/columns/edit.native.js +3 -3
- package/build-module/columns/edit.native.js.map +1 -1
- package/build-module/cover/controls.native.js +5 -5
- package/build-module/cover/controls.native.js.map +1 -1
- package/build-module/cover/deprecated.js +190 -17
- package/build-module/cover/deprecated.js.map +1 -1
- package/build-module/cover/edit.js +8 -11
- package/build-module/cover/edit.js.map +1 -1
- package/build-module/cover/edit.native.js +8 -8
- package/build-module/cover/edit.native.js.map +1 -1
- package/build-module/cover/overlay-color-settings.native.js +3 -3
- package/build-module/cover/overlay-color-settings.native.js.map +1 -1
- package/build-module/cover/save.js +1 -1
- package/build-module/cover/save.js.map +1 -1
- package/build-module/cover/shared.js +2 -2
- package/build-module/cover/shared.js.map +1 -1
- package/build-module/embed/edit.js +1 -1
- package/build-module/embed/edit.js.map +1 -1
- package/build-module/embed/edit.native.js +1 -1
- package/build-module/embed/edit.native.js.map +1 -1
- package/build-module/embed/util.js +2 -2
- package/build-module/embed/util.js.map +1 -1
- package/build-module/embed/variations.js +1 -1
- package/build-module/embed/variations.js.map +1 -1
- package/build-module/file/edit.js +21 -18
- package/build-module/file/edit.js.map +1 -1
- package/build-module/file/edit.native.js +1 -1
- package/build-module/file/edit.native.js.map +1 -1
- package/build-module/file/save.js +7 -3
- package/build-module/file/save.js.map +1 -1
- package/build-module/freeform/edit.js +2 -2
- package/build-module/freeform/edit.js.map +1 -1
- package/build-module/gallery/edit.js +1 -1
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/gallery/gallery.native.js +1 -1
- package/build-module/gallery/gallery.native.js.map +1 -1
- package/build-module/gallery/v1/edit.js +3 -3
- package/build-module/gallery/v1/edit.js.map +1 -1
- package/build-module/gallery/v1/gallery-image.native.js +3 -3
- package/build-module/gallery/v1/gallery-image.native.js.map +1 -1
- package/build-module/gallery/v1/gallery.native.js +2 -2
- package/build-module/gallery/v1/gallery.native.js.map +1 -1
- package/build-module/group/index.js +2 -36
- package/build-module/group/index.js.map +1 -1
- package/build-module/group/transforms.js +36 -0
- package/build-module/group/transforms.js.map +1 -0
- package/build-module/home-link/edit.js +1 -1
- package/build-module/home-link/edit.js.map +1 -1
- package/build-module/image/edit.js +7 -6
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/edit.native.js +25 -10
- package/build-module/image/edit.native.js.map +1 -1
- package/build-module/image/transforms.js +1 -1
- package/build-module/image/transforms.js.map +1 -1
- package/build-module/index.js +4 -5
- package/build-module/index.js.map +1 -1
- package/build-module/index.native.js +2 -2
- package/build-module/index.native.js.map +1 -1
- package/build-module/media-text/edit.js +20 -2
- package/build-module/media-text/edit.js.map +1 -1
- package/build-module/media-text/edit.native.js +2 -2
- package/build-module/media-text/edit.native.js.map +1 -1
- package/build-module/media-text/media-container.native.js +1 -1
- package/build-module/media-text/media-container.native.js.map +1 -1
- package/build-module/missing/edit.native.js +1 -1
- package/build-module/missing/edit.native.js.map +1 -1
- package/build-module/more/transforms.js +2 -2
- package/build-module/more/transforms.js.map +1 -1
- package/build-module/navigation/edit/index.js +128 -60
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/inner-blocks.js +8 -3
- package/build-module/navigation/edit/inner-blocks.js.map +1 -1
- package/build-module/navigation/edit/navigation-menu-selector.js +66 -50
- package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build-module/navigation/edit/placeholder/index.js +32 -45
- package/build-module/navigation/edit/placeholder/index.js.map +1 -1
- package/build-module/navigation/edit/placeholder/placeholder-preview.js +3 -9
- package/build-module/navigation/edit/placeholder/placeholder-preview.js.map +1 -1
- package/build-module/navigation/edit/unsaved-inner-blocks.js +3 -1
- package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js +100 -0
- package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -0
- package/build-module/navigation/edit/use-create-navigation-menu.js +48 -5
- package/build-module/navigation/edit/use-create-navigation-menu.js.map +1 -1
- package/build-module/navigation/edit/use-navigation-notice.js +3 -3
- package/build-module/navigation/edit/use-navigation-notice.js.map +1 -1
- package/build-module/navigation/menu-items-to-blocks.js +1 -1
- package/build-module/navigation/menu-items-to-blocks.js.map +1 -1
- package/build-module/navigation/use-navigation-entities.js +26 -50
- package/build-module/navigation/use-navigation-entities.js.map +1 -1
- package/build-module/navigation/use-navigation-menu.js +2 -0
- package/build-module/navigation/use-navigation-menu.js.map +1 -1
- package/build-module/navigation-link/fallback-variations.js +1 -1
- package/build-module/navigation-link/fallback-variations.js.map +1 -1
- package/build-module/navigation-link/hooks.js +2 -2
- package/build-module/navigation-link/hooks.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +2 -2
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/page-list/convert-to-links-modal.js +15 -25
- package/build-module/page-list/convert-to-links-modal.js.map +1 -1
- package/build-module/page-list/edit.js +9 -23
- package/build-module/page-list/edit.js.map +1 -1
- package/build-module/post-author-name/edit.js +2 -1
- package/build-module/post-author-name/edit.js.map +1 -1
- package/build-module/post-comments-form/edit.js +4 -2
- package/build-module/post-comments-form/edit.js.map +1 -1
- package/build-module/post-excerpt/edit.js +9 -6
- package/build-module/post-excerpt/edit.js.map +1 -1
- package/build-module/post-terms/edit.js +2 -1
- package/build-module/post-terms/edit.js.map +1 -1
- package/build-module/query-title/edit.js +0 -1
- package/build-module/query-title/edit.js.map +1 -1
- package/build-module/search/edit.js +3 -1
- package/build-module/search/edit.js.map +1 -1
- package/build-module/search/edit.native.js +1 -1
- package/build-module/search/edit.native.js.map +1 -1
- package/build-module/separator/save.js +4 -4
- package/build-module/separator/save.js.map +1 -1
- package/build-module/separator/separator-settings.native.js +1 -1
- package/build-module/separator/separator-settings.native.js.map +1 -1
- package/build-module/site-logo/edit.js +1 -1
- package/build-module/site-logo/edit.js.map +1 -1
- package/build-module/social-link/edit.native.js +11 -3
- package/build-module/social-link/edit.native.js.map +1 -1
- package/build-module/spacer/controls.js +5 -5
- package/build-module/spacer/controls.js.map +1 -1
- package/build-module/spacer/controls.native.js +5 -5
- package/build-module/spacer/controls.native.js.map +1 -1
- package/build-module/table/edit.js +2 -2
- package/build-module/table/edit.js.map +1 -1
- package/build-module/video/edit.js +4 -4
- package/build-module/video/edit.js.map +1 -1
- package/build-module/video/edit.native.js +3 -3
- package/build-module/video/edit.native.js.map +1 -1
- package/build-style/button/editor-rtl.css +0 -3
- package/build-style/button/editor.css +0 -3
- package/build-style/code/style-rtl.css +2 -1
- package/build-style/code/style.css +2 -1
- package/build-style/code/theme-rtl.css +0 -3
- package/build-style/code/theme.css +0 -3
- package/build-style/common-rtl.css +1 -1
- package/build-style/common.css +1 -1
- package/build-style/cover/style-rtl.css +1 -5
- package/build-style/cover/style.css +1 -5
- package/build-style/editor-rtl.css +16 -3
- package/build-style/editor.css +16 -3
- package/build-style/image/style-rtl.css +2 -1
- package/build-style/image/style.css +2 -1
- package/build-style/navigation/editor-rtl.css +16 -0
- package/build-style/navigation/editor.css +16 -0
- package/build-style/style-rtl.css +12 -10
- package/build-style/style.css +12 -10
- package/build-style/tag-cloud/style-rtl.css +6 -2
- package/build-style/tag-cloud/style.css +6 -2
- package/build-style/theme-rtl.css +0 -3
- package/build-style/theme.css +0 -3
- package/package.json +32 -28
- package/src/audio/edit.js +4 -4
- package/src/audio/edit.native.js +4 -4
- package/src/audio/transforms.js +1 -1
- package/src/block/edit.js +7 -22
- package/src/block/test/edit.native.js +9 -9
- package/src/button/edit.js +2 -1
- package/src/button/edit.native.js +2 -2
- package/src/button/editor.scss +0 -5
- package/src/buttons/test/edit.native.js +3 -3
- package/src/buttons/transforms.js +8 -8
- package/src/categories/edit.js +12 -22
- package/src/code/block.json +0 -1
- package/src/code/style.scss +4 -2
- package/src/code/theme.scss +0 -3
- package/src/columns/columnCalculations.native.js +1 -1
- package/src/columns/edit.js +1 -1
- package/src/columns/edit.native.js +3 -3
- package/src/comments-pagination-numbers/index.php +1 -1
- package/src/common.scss +1 -1
- package/src/cover/controls.native.js +1 -1
- package/src/cover/deprecated.js +214 -1
- package/src/cover/edit.js +6 -8
- package/src/cover/edit.native.js +8 -8
- package/src/cover/overlay-color-settings.native.js +3 -3
- package/src/cover/save.js +4 -3
- package/src/cover/shared.js +2 -2
- package/src/cover/style.scss +1 -3
- package/src/cover/test/edit.native.js +39 -39
- package/src/embed/edit.js +1 -1
- package/src/embed/edit.native.js +1 -1
- package/src/embed/test/index.native.js +105 -105
- package/src/embed/util.js +2 -2
- package/src/embed/variations.js +1 -1
- package/src/file/edit.js +19 -17
- package/src/file/edit.native.js +1 -1
- package/src/file/save.js +9 -3
- package/src/file/style.native.scss +1 -0
- package/src/freeform/edit.js +2 -2
- package/src/gallery/edit.js +1 -1
- package/src/gallery/gallery.native.js +1 -1
- package/src/gallery/test/__snapshots__/index.native.js.snap +164 -0
- package/src/gallery/test/helpers.native.js +293 -0
- package/src/gallery/test/index.native.js +583 -65
- package/src/gallery/v1/edit.js +3 -4
- package/src/gallery/v1/gallery-image.native.js +3 -3
- package/src/gallery/v1/gallery.native.js +2 -2
- package/src/group/index.js +2 -54
- package/src/group/transforms.js +52 -0
- package/src/home-link/edit.js +1 -1
- package/src/image/edit.js +7 -6
- package/src/image/edit.native.js +25 -8
- package/src/image/style.scss +2 -1
- package/src/image/test/edit.native.js +1 -1
- package/src/image/transforms.js +1 -1
- package/src/index.js +2 -3
- package/src/index.native.js +2 -2
- package/src/media-text/edit.js +20 -2
- package/src/media-text/edit.native.js +2 -2
- package/src/media-text/media-container.native.js +1 -1
- package/src/media-text/style.native.scss +1 -0
- package/src/missing/edit.native.js +1 -1
- package/src/missing/test/edit-integration.native.js +4 -4
- package/src/missing/test/edit.native.js +2 -2
- package/src/more/transforms.js +2 -2
- package/src/navigation/edit/index.js +194 -69
- package/src/navigation/edit/inner-blocks.js +11 -4
- package/src/navigation/edit/navigation-menu-selector.js +97 -79
- package/src/navigation/edit/placeholder/index.js +61 -84
- package/src/navigation/edit/placeholder/placeholder-preview.js +3 -10
- package/src/navigation/edit/unsaved-inner-blocks.js +3 -1
- package/src/navigation/edit/use-convert-classic-menu-to-block-menu.js +137 -0
- package/src/navigation/edit/use-create-navigation-menu.js +59 -8
- package/src/navigation/edit/use-navigation-notice.js +3 -3
- package/src/navigation/editor.scss +23 -1
- package/src/navigation/menu-items-to-blocks.js +1 -1
- package/src/navigation/test/menu-items-to-blocks.js +1 -1
- package/src/navigation/use-navigation-entities.js +26 -60
- package/src/navigation/use-navigation-menu.js +5 -0
- package/src/navigation-link/fallback-variations.js +1 -1
- package/src/navigation-link/hooks.js +2 -2
- package/src/navigation-link/test/edit.js +5 -5
- package/src/navigation-submenu/edit.js +2 -2
- package/src/page-list/convert-to-links-modal.js +17 -31
- package/src/page-list/edit.js +14 -23
- package/src/post-author-name/edit.js +1 -0
- package/src/post-author-name/index.php +1 -1
- package/src/post-comments-form/edit.js +7 -3
- package/src/post-excerpt/edit.js +9 -12
- package/src/post-terms/edit.js +2 -1
- package/src/query-title/edit.js +0 -1
- package/src/search/edit.js +6 -0
- package/src/search/edit.native.js +1 -1
- package/src/search/index.php +3 -2
- package/src/search/test/edit.native.js +0 -1
- package/src/separator/save.js +4 -4
- package/src/separator/separator-settings.native.js +1 -1
- package/src/site-logo/edit.js +1 -1
- package/src/social-link/edit.native.js +17 -8
- package/src/social-link/test/index.native.js +138 -0
- package/src/spacer/controls.js +1 -1
- package/src/spacer/controls.native.js +1 -1
- package/src/table/edit.js +2 -2
- package/src/tag-cloud/style.scss +12 -7
- package/src/video/edit.js +4 -4
- package/src/video/edit.native.js +3 -3
- package/src/video/style.native.scss +1 -0
- package/build/navigation/use-convert-classic-menu.js +0 -59
- package/build/navigation/use-convert-classic-menu.js.map +0 -1
- package/build-module/navigation/use-convert-classic-menu.js +0 -47
- package/build-module/navigation/use-convert-classic-menu.js.map +0 -1
- package/src/navigation/use-convert-classic-menu.js +0 -58
package/src/gallery/v1/edit.js
CHANGED
|
@@ -245,7 +245,7 @@ function GalleryEdit( props ) {
|
|
|
245
245
|
id: newImageId,
|
|
246
246
|
} );
|
|
247
247
|
|
|
248
|
-
//
|
|
248
|
+
// If the attachment caption is updated.
|
|
249
249
|
if ( attachment && attachment.caption !== newImage.caption ) {
|
|
250
250
|
return newImage.caption;
|
|
251
251
|
}
|
|
@@ -362,7 +362,7 @@ function GalleryEdit( props ) {
|
|
|
362
362
|
}, [] );
|
|
363
363
|
|
|
364
364
|
useEffect( () => {
|
|
365
|
-
// Deselect images when deselecting the block
|
|
365
|
+
// Deselect images when deselecting the block.
|
|
366
366
|
if ( ! isSelected ) {
|
|
367
367
|
setSelectedImage();
|
|
368
368
|
}
|
|
@@ -370,7 +370,7 @@ function GalleryEdit( props ) {
|
|
|
370
370
|
|
|
371
371
|
useEffect( () => {
|
|
372
372
|
// linkTo attribute must be saved so blocks don't break when changing
|
|
373
|
-
// image_default_link_type in options.php
|
|
373
|
+
// image_default_link_type in options.php.
|
|
374
374
|
if ( ! linkTo ) {
|
|
375
375
|
__unstableMarkNextChangeAsNotPersistent();
|
|
376
376
|
setAttributes( {
|
|
@@ -456,7 +456,6 @@ function GalleryEdit( props ) {
|
|
|
456
456
|
) }
|
|
457
457
|
</PanelBody>
|
|
458
458
|
</InspectorControls>
|
|
459
|
-
|
|
460
459
|
{ noticeUI }
|
|
461
460
|
<Gallery
|
|
462
461
|
{ ...props }
|
|
@@ -134,8 +134,8 @@ class GalleryImage extends Component {
|
|
|
134
134
|
} );
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
//
|
|
138
|
-
// the caption is not immediately selected
|
|
137
|
+
// Unselect the caption so when the user selects other image and comeback
|
|
138
|
+
// the caption is not immediately selected.
|
|
139
139
|
if (
|
|
140
140
|
this.state.captionSelected &&
|
|
141
141
|
! isSelected &&
|
|
@@ -318,7 +318,7 @@ class GalleryImage extends Component {
|
|
|
318
318
|
return (
|
|
319
319
|
<TouchableWithoutFeedback
|
|
320
320
|
onPress={ this.onMediaPressed }
|
|
321
|
-
accessible={ ! isSelected } // We need only child views to be accessible after the selection
|
|
321
|
+
accessible={ ! isSelected } // We need only child views to be accessible after the selection.
|
|
322
322
|
accessibilityLabel={ this.accessibilityLabelImageContainer() } // if we don't set this explicitly it reads system provided accessibilityLabels of all child components and those include pretty technical words which don't make sense
|
|
323
323
|
accessibilityRole={ 'imagebutton' } // this makes VoiceOver to read a description of image provided by system on iOS and lets user know this is a button which conveys the message of tappablity
|
|
324
324
|
>
|
|
@@ -77,7 +77,7 @@ export const Gallery = ( props ) => {
|
|
|
77
77
|
if ( isCaptionSelected ) {
|
|
78
78
|
setIsCaptionSelected( false );
|
|
79
79
|
}
|
|
80
|
-
//
|
|
80
|
+
// We need to fully invoke the curried function here.
|
|
81
81
|
onSelectImage( index )();
|
|
82
82
|
};
|
|
83
83
|
};
|
|
@@ -152,7 +152,7 @@ export const Gallery = ( props ) => {
|
|
|
152
152
|
)
|
|
153
153
|
}
|
|
154
154
|
onFocus={ focusGalleryCaption }
|
|
155
|
-
onBlur={ onBlur } //
|
|
155
|
+
onBlur={ onBlur } // Always assign onBlur as props.
|
|
156
156
|
insertBlocksAfter={ insertBlocksAfter }
|
|
157
157
|
/>
|
|
158
158
|
</View>
|
package/src/group/index.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
|
-
import { createBlock } from '@wordpress/blocks';
|
|
6
5
|
import { group as icon } from '@wordpress/icons';
|
|
7
6
|
|
|
8
7
|
/**
|
|
@@ -12,6 +11,7 @@ import deprecated from './deprecated';
|
|
|
12
11
|
import edit from './edit';
|
|
13
12
|
import metadata from './block.json';
|
|
14
13
|
import save from './save';
|
|
14
|
+
import transforms from './transforms';
|
|
15
15
|
import variations from './variations';
|
|
16
16
|
|
|
17
17
|
const { name } = metadata;
|
|
@@ -80,59 +80,7 @@ export const settings = {
|
|
|
80
80
|
},
|
|
81
81
|
],
|
|
82
82
|
},
|
|
83
|
-
transforms
|
|
84
|
-
from: [
|
|
85
|
-
{
|
|
86
|
-
type: 'block',
|
|
87
|
-
isMultiBlock: true,
|
|
88
|
-
blocks: [ '*' ],
|
|
89
|
-
__experimentalConvert( blocks ) {
|
|
90
|
-
// Avoid transforming a single `core/group` Block
|
|
91
|
-
if (
|
|
92
|
-
blocks.length === 1 &&
|
|
93
|
-
blocks[ 0 ].name === 'core/group'
|
|
94
|
-
) {
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
const alignments = [ 'wide', 'full' ];
|
|
99
|
-
|
|
100
|
-
// Determine the widest setting of all the blocks to be grouped
|
|
101
|
-
const widestAlignment = blocks.reduce(
|
|
102
|
-
( accumulator, block ) => {
|
|
103
|
-
const { align } = block.attributes;
|
|
104
|
-
return alignments.indexOf( align ) >
|
|
105
|
-
alignments.indexOf( accumulator )
|
|
106
|
-
? align
|
|
107
|
-
: accumulator;
|
|
108
|
-
},
|
|
109
|
-
undefined
|
|
110
|
-
);
|
|
111
|
-
|
|
112
|
-
// Clone the Blocks to be Grouped
|
|
113
|
-
// Failing to create new block references causes the original blocks
|
|
114
|
-
// to be replaced in the switchToBlockType call thereby meaning they
|
|
115
|
-
// are removed both from their original location and within the
|
|
116
|
-
// new group block.
|
|
117
|
-
const groupInnerBlocks = blocks.map( ( block ) => {
|
|
118
|
-
return createBlock(
|
|
119
|
-
block.name,
|
|
120
|
-
block.attributes,
|
|
121
|
-
block.innerBlocks
|
|
122
|
-
);
|
|
123
|
-
} );
|
|
124
|
-
|
|
125
|
-
return createBlock(
|
|
126
|
-
'core/group',
|
|
127
|
-
{
|
|
128
|
-
align: widestAlignment,
|
|
129
|
-
},
|
|
130
|
-
groupInnerBlocks
|
|
131
|
-
);
|
|
132
|
-
},
|
|
133
|
-
},
|
|
134
|
-
],
|
|
135
|
-
},
|
|
83
|
+
transforms,
|
|
136
84
|
edit,
|
|
137
85
|
save,
|
|
138
86
|
deprecated,
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { createBlock } from '@wordpress/blocks';
|
|
5
|
+
|
|
6
|
+
const transforms = {
|
|
7
|
+
from: [
|
|
8
|
+
{
|
|
9
|
+
type: 'block',
|
|
10
|
+
isMultiBlock: true,
|
|
11
|
+
blocks: [ '*' ],
|
|
12
|
+
__experimentalConvert( blocks ) {
|
|
13
|
+
const alignments = [ 'wide', 'full' ];
|
|
14
|
+
|
|
15
|
+
// Determine the widest setting of all the blocks to be grouped
|
|
16
|
+
const widestAlignment = blocks.reduce(
|
|
17
|
+
( accumulator, block ) => {
|
|
18
|
+
const { align } = block.attributes;
|
|
19
|
+
return alignments.indexOf( align ) >
|
|
20
|
+
alignments.indexOf( accumulator )
|
|
21
|
+
? align
|
|
22
|
+
: accumulator;
|
|
23
|
+
},
|
|
24
|
+
undefined
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
// Clone the Blocks to be Grouped
|
|
28
|
+
// Failing to create new block references causes the original blocks
|
|
29
|
+
// to be replaced in the switchToBlockType call thereby meaning they
|
|
30
|
+
// are removed both from their original location and within the
|
|
31
|
+
// new group block.
|
|
32
|
+
const groupInnerBlocks = blocks.map( ( block ) => {
|
|
33
|
+
return createBlock(
|
|
34
|
+
block.name,
|
|
35
|
+
block.attributes,
|
|
36
|
+
block.innerBlocks
|
|
37
|
+
);
|
|
38
|
+
} );
|
|
39
|
+
|
|
40
|
+
return createBlock(
|
|
41
|
+
'core/group',
|
|
42
|
+
{
|
|
43
|
+
align: widestAlignment,
|
|
44
|
+
},
|
|
45
|
+
groupInnerBlocks
|
|
46
|
+
);
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export default transforms;
|
package/src/home-link/edit.js
CHANGED
package/src/image/edit.js
CHANGED
|
@@ -171,6 +171,12 @@ export function ImageEdit( {
|
|
|
171
171
|
function onUploadError( message ) {
|
|
172
172
|
noticeOperations.removeAllNotices();
|
|
173
173
|
noticeOperations.createErrorNotice( message );
|
|
174
|
+
setAttributes( {
|
|
175
|
+
src: undefined,
|
|
176
|
+
id: undefined,
|
|
177
|
+
url: undefined,
|
|
178
|
+
} );
|
|
179
|
+
setTemporaryURL( undefined );
|
|
174
180
|
}
|
|
175
181
|
|
|
176
182
|
function onSelectImage( media ) {
|
|
@@ -306,12 +312,7 @@ export function ImageEdit( {
|
|
|
306
312
|
allowedTypes: ALLOWED_MEDIA_TYPES,
|
|
307
313
|
onError: ( message ) => {
|
|
308
314
|
isTemp = false;
|
|
309
|
-
|
|
310
|
-
setAttributes( {
|
|
311
|
-
src: undefined,
|
|
312
|
-
id: undefined,
|
|
313
|
-
url: undefined,
|
|
314
|
-
} );
|
|
315
|
+
onUploadError( message );
|
|
315
316
|
},
|
|
316
317
|
} );
|
|
317
318
|
}
|
package/src/image/edit.native.js
CHANGED
|
@@ -88,7 +88,7 @@ function LinkSettings( {
|
|
|
88
88
|
const route = useRoute();
|
|
89
89
|
const { href: url, label, linkDestination, linkTarget, rel } = attributes;
|
|
90
90
|
|
|
91
|
-
// Persist attributes passed from child screen
|
|
91
|
+
// Persist attributes passed from child screen.
|
|
92
92
|
useEffect( () => {
|
|
93
93
|
const { inputValue: newUrl } = route.params || {};
|
|
94
94
|
|
|
@@ -186,6 +186,7 @@ export class ImageEdit extends Component {
|
|
|
186
186
|
this.state = {
|
|
187
187
|
isCaptionSelected: false,
|
|
188
188
|
uploadStatus: UPLOAD_STATE_IDLE,
|
|
189
|
+
isAnimatedGif: false,
|
|
189
190
|
};
|
|
190
191
|
|
|
191
192
|
this.replacedFeaturedImage = false;
|
|
@@ -225,7 +226,7 @@ export class ImageEdit extends Component {
|
|
|
225
226
|
console.warn( 'Attributes has id with no url.' );
|
|
226
227
|
}
|
|
227
228
|
|
|
228
|
-
// Detect any pasted image and start an upload
|
|
229
|
+
// Detect any pasted image and start an upload.
|
|
229
230
|
if (
|
|
230
231
|
! attributes.id &&
|
|
231
232
|
attributes.url &&
|
|
@@ -239,7 +240,7 @@ export class ImageEdit extends Component {
|
|
|
239
240
|
}
|
|
240
241
|
|
|
241
242
|
// Make sure we mark any temporary images as failed if they failed while
|
|
242
|
-
// the editor wasn't open
|
|
243
|
+
// the editor wasn't open.
|
|
243
244
|
if (
|
|
244
245
|
attributes.id &&
|
|
245
246
|
attributes.url &&
|
|
@@ -250,7 +251,7 @@ export class ImageEdit extends Component {
|
|
|
250
251
|
}
|
|
251
252
|
|
|
252
253
|
componentWillUnmount() {
|
|
253
|
-
//
|
|
254
|
+
// This action will only exist if the user pressed the trash button on the block holder.
|
|
254
255
|
if (
|
|
255
256
|
hasAction( 'blocks.onRemoveBlockCheckUpload' ) &&
|
|
256
257
|
this.state.uploadStatus === UPLOAD_STATE_UPLOADING
|
|
@@ -305,7 +306,7 @@ export class ImageEdit extends Component {
|
|
|
305
306
|
|
|
306
307
|
static getDerivedStateFromProps( props, state ) {
|
|
307
308
|
// Avoid a UI flicker in the toolbar by insuring that isCaptionSelected
|
|
308
|
-
// is updated immediately any time the isSelected prop becomes false
|
|
309
|
+
// is updated immediately any time the isSelected prop becomes false.
|
|
309
310
|
return {
|
|
310
311
|
isCaptionSelected: props.isSelected && state.isCaptionSelected,
|
|
311
312
|
};
|
|
@@ -363,6 +364,10 @@ export class ImageEdit extends Component {
|
|
|
363
364
|
|
|
364
365
|
setAttributes( { url: payload.mediaUrl, id: payload.mediaServerId } );
|
|
365
366
|
this.setState( { uploadStatus: UPLOAD_STATE_SUCCEEDED } );
|
|
367
|
+
|
|
368
|
+
this.setState( {
|
|
369
|
+
isAnimatedGif: payload.mediaUrl.toLowerCase().includes( '.gif' ),
|
|
370
|
+
} );
|
|
366
371
|
}
|
|
367
372
|
|
|
368
373
|
finishMediaUploadWithFailure( payload ) {
|
|
@@ -459,6 +464,10 @@ export class ImageEdit extends Component {
|
|
|
459
464
|
...mediaAttributes,
|
|
460
465
|
...additionalAttributes,
|
|
461
466
|
} );
|
|
467
|
+
|
|
468
|
+
this.setState( {
|
|
469
|
+
isAnimatedGif: media.url.toLowerCase().includes( '.gif' ),
|
|
470
|
+
} );
|
|
462
471
|
}
|
|
463
472
|
|
|
464
473
|
onFocusCaption() {
|
|
@@ -739,8 +748,16 @@ export class ImageEdit extends Component {
|
|
|
739
748
|
context?.fixedHeight && styles.fixedHeight,
|
|
740
749
|
];
|
|
741
750
|
|
|
751
|
+
const badgeLabelShown = isFeaturedImage || this.state.isAnimatedGif;
|
|
752
|
+
let badgeLabelText = '';
|
|
753
|
+
if ( isFeaturedImage ) {
|
|
754
|
+
badgeLabelText = __( 'Featured' );
|
|
755
|
+
} else if ( this.state.isAnimatedGif ) {
|
|
756
|
+
badgeLabelText = __( 'GIF' );
|
|
757
|
+
}
|
|
758
|
+
|
|
742
759
|
const getImageComponent = ( openMediaOptions, getMediaOptions ) => (
|
|
743
|
-
<Badge label={
|
|
760
|
+
<Badge label={ badgeLabelText } show={ badgeLabelShown }>
|
|
744
761
|
<TouchableWithoutFeedback
|
|
745
762
|
accessible={ ! isSelected }
|
|
746
763
|
onPress={ this.onImagePressed }
|
|
@@ -813,7 +830,7 @@ export class ImageEdit extends Component {
|
|
|
813
830
|
accessible
|
|
814
831
|
accessibilityLabelCreator={ this.accessibilityLabelCreator }
|
|
815
832
|
onFocus={ this.onFocusCaption }
|
|
816
|
-
onBlur={ this.props.onBlur } //
|
|
833
|
+
onBlur={ this.props.onBlur } // Always assign onBlur as props.
|
|
817
834
|
insertBlocksAfter={ this.props.insertBlocksAfter }
|
|
818
835
|
/>
|
|
819
836
|
</Badge>
|
|
@@ -851,7 +868,7 @@ export default compose( [
|
|
|
851
868
|
const shouldGetMedia =
|
|
852
869
|
( isSelected && isNotFileUrl ) ||
|
|
853
870
|
// Edge case to update the image after uploading if the block gets unselected
|
|
854
|
-
// Check if it's the original image and not the resized one with queryparams
|
|
871
|
+
// Check if it's the original image and not the resized one with queryparams.
|
|
855
872
|
( ! isSelected &&
|
|
856
873
|
isNotFileUrl &&
|
|
857
874
|
url &&
|
package/src/image/style.scss
CHANGED
|
@@ -69,7 +69,8 @@
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
// Variations
|
|
72
|
-
&.is-style-rounded img
|
|
72
|
+
&.is-style-rounded img,
|
|
73
|
+
.is-style-rounded img {
|
|
73
74
|
// We use an absolute pixel to prevent the oval shape that a value of 50% would give
|
|
74
75
|
// to rectangular images. A pill-shape is better than otherwise.
|
|
75
76
|
border-radius: 9999px;
|
package/src/image/transforms.js
CHANGED
|
@@ -19,7 +19,7 @@ export function stripFirstImage( attributes, { shortcode } ) {
|
|
|
19
19
|
|
|
20
20
|
let nodeToRemove = body.querySelector( 'img' );
|
|
21
21
|
|
|
22
|
-
//
|
|
22
|
+
// If an image has parents, find the topmost node to remove.
|
|
23
23
|
while (
|
|
24
24
|
nodeToRemove &&
|
|
25
25
|
nodeToRemove.parentNode &&
|
package/src/index.js
CHANGED
|
@@ -96,7 +96,6 @@ import * as socialLink from './social-link';
|
|
|
96
96
|
import * as socialLinks from './social-links';
|
|
97
97
|
import * as spacer from './spacer';
|
|
98
98
|
import * as table from './table';
|
|
99
|
-
// import * as tableOfContents from './table-of-contents';
|
|
100
99
|
import * as tagCloud from './tag-cloud';
|
|
101
100
|
import * as templatePart from './template-part';
|
|
102
101
|
import * as termDescription from './term-description';
|
|
@@ -145,7 +144,7 @@ export const __experimentalGetCoreBlocks = () => [
|
|
|
145
144
|
buttons,
|
|
146
145
|
calendar,
|
|
147
146
|
categories,
|
|
148
|
-
window.wp && window.wp.oldEditor ? classic : null, // Only add the classic block in WP Context
|
|
147
|
+
window.wp && window.wp.oldEditor ? classic : null, // Only add the classic block in WP Context.
|
|
149
148
|
code,
|
|
150
149
|
column,
|
|
151
150
|
columns,
|
|
@@ -205,7 +204,6 @@ export const __experimentalGetCoreBlocks = () => [
|
|
|
205
204
|
logInOut,
|
|
206
205
|
termDescription,
|
|
207
206
|
queryTitle,
|
|
208
|
-
postAuthorName,
|
|
209
207
|
postAuthorBiography,
|
|
210
208
|
];
|
|
211
209
|
|
|
@@ -251,6 +249,7 @@ export const __experimentalRegisterExperimentalCoreBlocks = process.env
|
|
|
251
249
|
[
|
|
252
250
|
// Experimental blocks.
|
|
253
251
|
homeLink,
|
|
252
|
+
postAuthorName,
|
|
254
253
|
|
|
255
254
|
// Full Site Editing blocks.
|
|
256
255
|
...( enableFSEBlocks
|
package/src/index.native.js
CHANGED
|
@@ -135,7 +135,7 @@ export const registerBlock = ( block ) => {
|
|
|
135
135
|
{
|
|
136
136
|
name,
|
|
137
137
|
...metadata,
|
|
138
|
-
// Gradients support only available for blocks listed in ALLOWED_BLOCKS_GRADIENT_SUPPORT
|
|
138
|
+
// Gradients support only available for blocks listed in ALLOWED_BLOCKS_GRADIENT_SUPPORT.
|
|
139
139
|
...( ! ALLOWED_BLOCKS_GRADIENT_SUPPORT.includes( name ) &&
|
|
140
140
|
supports?.color?.gradients
|
|
141
141
|
? {
|
|
@@ -171,7 +171,7 @@ const registerBlockVariations = ( block ) => {
|
|
|
171
171
|
} );
|
|
172
172
|
};
|
|
173
173
|
|
|
174
|
-
//
|
|
174
|
+
// Only enable code block for development
|
|
175
175
|
// eslint-disable-next-line no-undef
|
|
176
176
|
const devOnly = ( block ) => ( !! __DEV__ ? block : null );
|
|
177
177
|
|
package/src/media-text/edit.js
CHANGED
|
@@ -29,6 +29,7 @@ import {
|
|
|
29
29
|
ExternalLink,
|
|
30
30
|
FocalPointPicker,
|
|
31
31
|
} from '@wordpress/components';
|
|
32
|
+
import { isBlobURL, getBlobTypeByURL } from '@wordpress/blob';
|
|
32
33
|
import { pullLeft, pullRight } from '@wordpress/icons';
|
|
33
34
|
import { store as coreStore } from '@wordpress/core-data';
|
|
34
35
|
|
|
@@ -72,9 +73,26 @@ function attributesFromMedia( {
|
|
|
72
73
|
setAttributes,
|
|
73
74
|
} ) {
|
|
74
75
|
return ( media ) => {
|
|
76
|
+
if ( ! media || ! media.url ) {
|
|
77
|
+
setAttributes( {
|
|
78
|
+
mediaAlt: undefined,
|
|
79
|
+
mediaId: undefined,
|
|
80
|
+
mediaType: undefined,
|
|
81
|
+
mediaUrl: undefined,
|
|
82
|
+
mediaLink: undefined,
|
|
83
|
+
href: undefined,
|
|
84
|
+
focalPoint: undefined,
|
|
85
|
+
} );
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if ( isBlobURL( media.url ) ) {
|
|
90
|
+
media.type = getBlobTypeByURL( media.url );
|
|
91
|
+
}
|
|
92
|
+
|
|
75
93
|
let mediaType;
|
|
76
94
|
let src;
|
|
77
|
-
//
|
|
95
|
+
// For media selections originated from a file upload.
|
|
78
96
|
if ( media.media_type ) {
|
|
79
97
|
if ( media.media_type === 'image' ) {
|
|
80
98
|
mediaType = 'image';
|
|
@@ -84,7 +102,7 @@ function attributesFromMedia( {
|
|
|
84
102
|
mediaType = 'video';
|
|
85
103
|
}
|
|
86
104
|
} else {
|
|
87
|
-
//
|
|
105
|
+
// For media selections originated from existing files in the media library.
|
|
88
106
|
mediaType = media.type;
|
|
89
107
|
}
|
|
90
108
|
|
|
@@ -82,7 +82,7 @@ class MediaTextEdit extends Component {
|
|
|
82
82
|
|
|
83
83
|
let mediaType;
|
|
84
84
|
let src;
|
|
85
|
-
//
|
|
85
|
+
// For media selections originated from a file upload.
|
|
86
86
|
if ( media.media_type ) {
|
|
87
87
|
if ( media.media_type === 'image' ) {
|
|
88
88
|
mediaType = 'image';
|
|
@@ -92,7 +92,7 @@ class MediaTextEdit extends Component {
|
|
|
92
92
|
mediaType = 'video';
|
|
93
93
|
}
|
|
94
94
|
} else {
|
|
95
|
-
//
|
|
95
|
+
// For media selections originated from existing files in the media library.
|
|
96
96
|
mediaType = media.type;
|
|
97
97
|
}
|
|
98
98
|
|
|
@@ -73,7 +73,7 @@ class MediaContainer extends Component {
|
|
|
73
73
|
const { mediaId, mediaUrl } = this.props;
|
|
74
74
|
|
|
75
75
|
// Make sure we mark any temporary images as failed if they failed while
|
|
76
|
-
// the editor wasn't open
|
|
76
|
+
// the editor wasn't open.
|
|
77
77
|
if ( mediaId && mediaUrl && getProtocol( mediaUrl ) === 'file:' ) {
|
|
78
78
|
mediaUploadSync();
|
|
79
79
|
}
|
|
@@ -173,7 +173,7 @@ export class UnsupportedBlockEdit extends Component {
|
|
|
173
173
|
// On iOS, onModalHide is called when the controller is still part of the hierarchy.
|
|
174
174
|
// A small delay will ensure that the controller has already been removed.
|
|
175
175
|
this.timeout = setTimeout( () => {
|
|
176
|
-
//
|
|
176
|
+
// For the Classic block, the content is kept in the `content` attribute.
|
|
177
177
|
const content =
|
|
178
178
|
blockName === 'core/freeform'
|
|
179
179
|
? attributes.content
|
|
@@ -15,21 +15,21 @@ import { setLocaleData } from '@wordpress/i18n';
|
|
|
15
15
|
import { registerCoreBlocks } from '../..';
|
|
16
16
|
|
|
17
17
|
beforeAll( () => {
|
|
18
|
-
// Mock translations
|
|
18
|
+
// Mock translations.
|
|
19
19
|
setLocaleData( {
|
|
20
20
|
'block title\u0004Table': [ 'Tabla' ],
|
|
21
21
|
"'%s' is not fully-supported": [ '«%s» no es totalmente compatible' ],
|
|
22
22
|
} );
|
|
23
23
|
|
|
24
|
-
// Register all core blocks
|
|
24
|
+
// Register all core blocks.
|
|
25
25
|
registerCoreBlocks();
|
|
26
26
|
} );
|
|
27
27
|
|
|
28
28
|
afterAll( () => {
|
|
29
|
-
// Clean up translations
|
|
29
|
+
// Clean up translations.
|
|
30
30
|
setLocaleData( {} );
|
|
31
31
|
|
|
32
|
-
// Clean up registered blocks
|
|
32
|
+
// Clean up registered blocks.
|
|
33
33
|
getBlockTypes().forEach( ( block ) => {
|
|
34
34
|
unregisterBlockType( block.name );
|
|
35
35
|
} );
|
|
@@ -49,7 +49,7 @@ describe( 'Missing block', () => {
|
|
|
49
49
|
const testInstance = getTestComponentWithContent();
|
|
50
50
|
const bottomSheet = testInstance.UNSAFE_getByType( BottomSheet );
|
|
51
51
|
const children = bottomSheet.props.children[ 0 ].props.children;
|
|
52
|
-
expect( children.length ).toBe( 3 ); // 4 children in the bottom sheet: the icon, the "isn't yet supported" title and the "We are working hard..." message
|
|
52
|
+
expect( children.length ).toBe( 3 ); // 4 children in the bottom sheet: the icon, the "isn't yet supported" title and the "We are working hard..." message.
|
|
53
53
|
expect( children[ 0 ].props.icon ).toBe( help );
|
|
54
54
|
} );
|
|
55
55
|
|
|
@@ -66,7 +66,7 @@ describe( 'Missing block', () => {
|
|
|
66
66
|
|
|
67
67
|
describe( 'Unsupported block editor (UBE)', () => {
|
|
68
68
|
beforeEach( () => {
|
|
69
|
-
// By default we set the web editor as available
|
|
69
|
+
// By default we set the web editor as available.
|
|
70
70
|
storeConfig.selectors.getSettings.mockReturnValue( {
|
|
71
71
|
unsupportedBlockEditor: true,
|
|
72
72
|
} );
|
package/src/more/transforms.js
CHANGED
|
@@ -15,11 +15,11 @@ const transforms = {
|
|
|
15
15
|
transform( node ) {
|
|
16
16
|
const { customText, noTeaser } = node.dataset;
|
|
17
17
|
const attrs = {};
|
|
18
|
-
// Don't copy unless defined and not an empty string
|
|
18
|
+
// Don't copy unless defined and not an empty string.
|
|
19
19
|
if ( customText ) {
|
|
20
20
|
attrs.customText = customText;
|
|
21
21
|
}
|
|
22
|
-
// Special handling for boolean
|
|
22
|
+
// Special handling for boolean.
|
|
23
23
|
if ( noTeaser === '' ) {
|
|
24
24
|
attrs.noTeaser = true;
|
|
25
25
|
}
|