@wordpress/block-library 7.5.0 → 7.8.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 +10 -0
- package/README.md +3 -2
- package/babel-plugin.js +154 -0
- package/build/audio/edit.js +1 -1
- package/build/audio/edit.js.map +1 -1
- package/build/audio/index.js +6 -1
- package/build/audio/index.js.map +1 -1
- package/build/avatar/hooks.js +2 -2
- package/build/avatar/hooks.js.map +1 -1
- package/build/block/edit.js +10 -9
- package/build/block/edit.js.map +1 -1
- package/build/block/edit.native.js.map +1 -1
- package/build/button/deprecated.js +175 -35
- package/build/button/deprecated.js.map +1 -1
- package/build/button/edit.js +1 -1
- package/build/button/edit.js.map +1 -1
- package/build/button/edit.native.js.map +1 -1
- package/build/button/index.js +25 -1
- package/build/button/index.js.map +1 -1
- package/build/button/save.js +1 -1
- package/build/button/save.js.map +1 -1
- package/build/buttons/deprecated.js.map +1 -1
- package/build/buttons/edit.js.map +1 -1
- package/build/buttons/edit.native.js.map +1 -1
- package/build/categories/edit.js +1 -1
- package/build/categories/edit.js.map +1 -1
- package/build/categories/index.js +1 -1
- package/build/column/deprecated.js.map +1 -1
- package/build/column/edit.js.map +1 -1
- package/build/column/edit.native.js.map +1 -1
- package/build/columns/deprecated.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 +1 -1
- package/build/columns/edit.native.js.map +1 -1
- package/build/columns/index.js +3 -1
- package/build/columns/index.js.map +1 -1
- package/build/columns/utils.js +1 -1
- package/build/columns/utils.js.map +1 -1
- package/build/comment-author-avatar/index.js +1 -0
- package/build/comment-author-avatar/index.js.map +1 -1
- package/build/comment-author-name/edit.js +4 -2
- package/build/comment-author-name/edit.js.map +1 -1
- package/build/comment-date/edit.js +1 -1
- package/build/comment-date/edit.js.map +1 -1
- package/build/comments-title/deprecated.js +110 -0
- package/build/comments-title/deprecated.js.map +1 -0
- package/build/comments-title/edit.js +35 -37
- package/build/comments-title/edit.js.map +1 -1
- package/build/comments-title/index.js +5 -8
- package/build/comments-title/index.js.map +1 -1
- package/build/cover/controls.native.js +2 -3
- package/build/cover/controls.native.js.map +1 -1
- package/build/cover/deprecated.js +212 -207
- package/build/cover/deprecated.js.map +1 -1
- package/build/cover/edit/block-controls.js +108 -0
- package/build/cover/edit/block-controls.js.map +1 -0
- package/build/cover/edit/cover-placeholder.js +49 -0
- package/build/cover/edit/cover-placeholder.js.map +1 -0
- package/build/cover/edit/index.js +336 -0
- package/build/cover/edit/index.js.map +1 -0
- package/build/cover/edit/inspector-controls.js +252 -0
- package/build/cover/edit/inspector-controls.js.map +1 -0
- package/build/cover/edit/resizable-cover.js +67 -0
- package/build/cover/edit/resizable-cover.js.map +1 -0
- package/build/cover/{use-cover-is-dark.js → edit/use-cover-is-dark.js} +0 -0
- package/build/cover/edit/use-cover-is-dark.js.map +1 -0
- package/build/cover/edit.native.js +0 -1
- package/build/cover/edit.native.js.map +1 -1
- package/build/cover/focal-point-settings-button.native.js.map +1 -1
- package/build/cover/save.js +18 -5
- package/build/cover/save.js.map +1 -1
- package/build/cover/shared.js +15 -9
- package/build/cover/shared.js.map +1 -1
- package/build/cover/transforms.js.map +1 -1
- package/build/embed/deprecated.js +6 -1
- package/build/embed/deprecated.js.map +1 -1
- package/build/embed/edit.js.map +1 -1
- package/build/embed/edit.native.js.map +1 -1
- package/build/embed/embed-controls.native.js.map +1 -1
- package/build/embed/embed-preview.js +1 -1
- package/build/embed/embed-preview.js.map +1 -1
- package/build/embed/index.js +6 -1
- package/build/embed/index.js.map +1 -1
- package/build/embed/transforms.js +6 -1
- package/build/embed/transforms.js.map +1 -1
- package/build/embed/util.js +6 -1
- package/build/embed/util.js.map +1 -1
- package/build/file/edit.js +1 -1
- package/build/file/edit.js.map +1 -1
- package/build/file/edit.native.js +0 -1
- package/build/file/edit.native.js.map +1 -1
- package/build/file/index.js.map +1 -1
- package/build/file/save.js +9 -1
- package/build/file/save.js.map +1 -1
- package/build/gallery/edit.js +3 -2
- package/build/gallery/edit.js.map +1 -1
- package/build/gallery/gallery.js +1 -1
- package/build/gallery/gallery.js.map +1 -1
- package/build/gallery/gallery.native.js.map +1 -1
- package/build/gallery/gap-styles.js +14 -4
- package/build/gallery/gap-styles.js.map +1 -1
- package/build/gallery/index.js +1 -1
- package/build/gallery/index.js.map +1 -1
- package/build/gallery/shared.js +29 -12
- package/build/gallery/shared.js.map +1 -1
- package/build/gallery/use-get-media.js +2 -1
- package/build/gallery/use-get-media.js.map +1 -1
- package/build/gallery/use-short-code-transform.js +19 -18
- package/build/gallery/use-short-code-transform.js.map +1 -1
- package/build/gallery/v1/edit.js.map +1 -1
- package/build/gallery/v1/gallery-image.js.map +1 -1
- package/build/gallery/v1/gallery-image.native.js.map +1 -1
- package/build/gallery/v1/gallery.js +1 -1
- package/build/gallery/v1/gallery.js.map +1 -1
- package/build/heading/autogenerate-anchors.js +7 -2
- package/build/heading/autogenerate-anchors.js.map +1 -1
- package/build/heading/deprecated.js.map +1 -1
- package/build/heading/edit.js +6 -2
- package/build/heading/edit.js.map +1 -1
- package/build/heading/index.js +1 -0
- package/build/heading/index.js.map +1 -1
- package/build/heading/transforms.js +1 -0
- package/build/heading/transforms.js.map +1 -1
- package/build/image/deprecated.js.map +1 -1
- package/build/image/edit.js +5 -56
- package/build/image/edit.js.map +1 -1
- package/build/image/edit.native.js +56 -4
- package/build/image/edit.native.js.map +1 -1
- package/build/image/image.js +4 -14
- package/build/image/image.js.map +1 -1
- package/build/image/index.js +5 -0
- package/build/image/index.js.map +1 -1
- package/build/image/transforms.js.map +1 -1
- package/build/image/utils.js +2 -1
- package/build/image/utils.js.map +1 -1
- package/build/index.js +46 -10
- package/build/index.js.map +1 -1
- package/build/is-block-metadata-experimental.js +18 -0
- package/build/is-block-metadata-experimental.js.map +1 -0
- package/build/latest-comments/edit.js.map +1 -1
- package/build/latest-posts/edit.js +31 -5
- package/build/latest-posts/edit.js.map +1 -1
- package/build/latest-posts/edit.native.js.map +1 -1
- package/build/list/index.js.map +1 -1
- package/build/list/transforms.js +6 -0
- package/build/list/transforms.js.map +1 -1
- package/build/list/v2/edit.js +2 -1
- package/build/list/v2/edit.js.map +1 -1
- package/build/list/v2/migrate.js +1 -0
- package/build/list/v2/migrate.js.map +1 -1
- package/build/list/v2/transforms.js +46 -9
- package/build/list/v2/transforms.js.map +1 -1
- package/build/list-item/edit.js +7 -9
- package/build/list-item/edit.js.map +1 -1
- package/build/list-item/hooks/index.js +24 -0
- package/build/list-item/hooks/index.js.map +1 -1
- package/build/list-item/hooks/use-backspace.js +59 -0
- package/build/list-item/hooks/use-backspace.js.map +1 -0
- package/build/list-item/hooks/use-enter.js +6 -9
- package/build/list-item/hooks/use-enter.js.map +1 -1
- package/build/list-item/hooks/use-indent-list-item.js +33 -39
- package/build/list-item/hooks/use-indent-list-item.js.map +1 -1
- package/build/list-item/hooks/use-outdent-list-item.js.map +1 -1
- package/build/list-item/hooks/use-space.js +54 -0
- package/build/list-item/hooks/use-space.js.map +1 -0
- package/build/list-item/hooks/use-split.js +44 -0
- package/build/list-item/hooks/use-split.js.map +1 -0
- package/build/list-item/index.js +1 -0
- package/build/list-item/index.js.map +1 -1
- package/build/list-item/utils.js +1 -1
- package/build/list-item/utils.js.map +1 -1
- package/build/media-text/deprecated.js +5 -3
- package/build/media-text/deprecated.js.map +1 -1
- package/build/media-text/edit.native.js +2 -1
- package/build/media-text/edit.native.js.map +1 -1
- package/build/media-text/media-container.js +3 -3
- package/build/media-text/media-container.js.map +1 -1
- package/build/media-text/media-container.native.js +2 -4
- package/build/media-text/media-container.native.js.map +1 -1
- package/build/media-text/save.js +3 -1
- package/build/media-text/save.js.map +1 -1
- package/build/media-text/transforms.js +137 -8
- package/build/media-text/transforms.js.map +1 -1
- package/build/missing/edit.native.js.map +1 -1
- package/build/navigation/deprecated.js.map +1 -1
- package/build/navigation/edit/index.js +86 -81
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/inner-blocks.js +1 -5
- package/build/navigation/edit/inner-blocks.js.map +1 -1
- package/build/navigation/edit/navigation-menu-delete-control.js.map +1 -1
- package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
- package/build/navigation/use-navigation-entities.js +3 -3
- package/build/navigation/use-navigation-entities.js.map +1 -1
- package/build/navigation/use-navigation-menu.js +130 -38
- package/build/navigation/use-navigation-menu.js.map +1 -1
- package/build/navigation/use-template-part-area-label.js +4 -1
- package/build/navigation/use-template-part-area-label.js.map +1 -1
- package/build/navigation-link/edit.js +44 -12
- package/build/navigation-link/edit.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 +1 -1
- package/build/navigation-link/hooks.js.map +1 -1
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/page-list/convert-to-links-modal.js +1 -1
- package/build/page-list/convert-to-links-modal.js.map +1 -1
- package/build/page-list/edit.js +1 -1
- package/build/page-list/edit.js.map +1 -1
- package/build/paragraph/deprecated.js +1 -1
- package/build/paragraph/deprecated.js.map +1 -1
- package/build/pattern/edit.js.map +1 -1
- package/build/post-author/edit.js +1 -1
- package/build/post-author/edit.js.map +1 -1
- package/build/post-author-name/index.js +4 -0
- package/build/post-author-name/index.js.map +1 -1
- package/build/post-author-name/transforms.js +41 -0
- package/build/post-author-name/transforms.js.map +1 -0
- package/build/post-comment/index.js +1 -0
- package/build/post-comment/index.js.map +1 -1
- package/build/post-comments/edit.js +34 -16
- package/build/post-comments/edit.js.map +1 -1
- package/build/post-comments-count/index.js +1 -0
- package/build/post-comments-count/index.js.map +1 -1
- package/build/post-comments-form/form.js +12 -2
- package/build/post-comments-form/form.js.map +1 -1
- package/build/post-comments-link/index.js +1 -0
- package/build/post-comments-link/index.js.map +1 -1
- package/build/post-content/edit.js.map +1 -1
- package/build/post-date/edit.js +13 -7
- package/build/post-date/edit.js.map +1 -1
- package/build/post-featured-image/edit.js +11 -25
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/post-navigation-link/index.js +4 -0
- package/build/post-navigation-link/index.js.map +1 -1
- package/build/post-template/edit.js +7 -2
- package/build/post-template/edit.js.map +1 -1
- package/build/post-terms/edit.js +11 -2
- package/build/post-terms/edit.js.map +1 -1
- package/build/post-terms/hooks.js +33 -0
- package/build/post-terms/hooks.js.map +1 -0
- package/build/post-terms/index.js +12 -5
- package/build/post-terms/index.js.map +1 -1
- package/build/post-title/index.js +1 -1
- package/build/post-title/index.js.map +1 -1
- package/build/pullquote/deprecated.js.map +1 -1
- package/build/pullquote/edit.js +1 -1
- package/build/pullquote/edit.js.map +1 -1
- package/build/pullquote/edit.native.js +1 -1
- package/build/pullquote/edit.native.js.map +1 -1
- package/build/query/edit/index.js +5 -1
- package/build/query/edit/index.js.map +1 -1
- package/build/query/edit/inspector-controls/index.js +26 -17
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/edit/inspector-controls/parent-control.js +148 -0
- package/build/query/edit/inspector-controls/parent-control.js.map +1 -0
- package/build/query/edit/inspector-controls/sticky-control.js +41 -0
- package/build/query/edit/inspector-controls/sticky-control.js.map +1 -0
- package/build/query/edit/query-toolbar.js +16 -2
- package/build/query/edit/query-toolbar.js.map +1 -1
- package/build/query/index.js +2 -1
- package/build/query/index.js.map +1 -1
- package/build/query/utils.js +28 -2
- package/build/query/utils.js.map +1 -1
- package/build/query-title/index.js +1 -1
- package/build/query-title/index.js.map +1 -1
- package/build/query-title/variations.js +1 -1
- package/build/query-title/variations.js.map +1 -1
- package/build/quote/edit.js +3 -2
- package/build/quote/edit.js.map +1 -1
- package/build/quote/v2/edit.js +1 -1
- package/build/quote/v2/edit.js.map +1 -1
- package/build/search/edit.js +2 -1
- package/build/search/edit.js.map +1 -1
- package/build/search/edit.native.js.map +1 -1
- package/build/search/index.js +4 -0
- package/build/search/index.js.map +1 -1
- package/build/separator/use-deprecated-opacity.js.map +1 -1
- package/build/shortcode/edit.native.js +16 -13
- package/build/shortcode/edit.native.js.map +1 -1
- package/build/site-logo/edit.js +4 -13
- package/build/site-logo/edit.js.map +1 -1
- package/build/social-links/deprecated.js.map +1 -1
- package/build/social-links/edit.js +2 -2
- package/build/social-links/edit.js.map +1 -1
- package/build/social-links/edit.native.js.map +1 -1
- package/build/spacer/controls.js.map +1 -1
- package/build/table/deprecated.js.map +1 -1
- package/build/table/edit.js +15 -2
- package/build/table/edit.js.map +1 -1
- package/build/table/index.js +6 -1
- package/build/table/index.js.map +1 -1
- package/build/table/state.js.map +1 -1
- package/build/table-of-contents/edit.js +145 -65
- package/build/table-of-contents/edit.js.map +1 -1
- package/build/table-of-contents/index.js +13 -3
- package/build/table-of-contents/index.js.map +1 -1
- package/build/table-of-contents/list.js +16 -9
- package/build/table-of-contents/list.js.map +1 -1
- package/build/table-of-contents/save.js +40 -0
- package/build/table-of-contents/save.js.map +1 -0
- package/build/table-of-contents/utils.js +11 -77
- package/build/table-of-contents/utils.js.map +1 -1
- package/build/tag-cloud/edit.js.map +1 -1
- package/build/template-part/edit/advanced-controls.js +4 -1
- package/build/template-part/edit/advanced-controls.js.map +1 -1
- package/build/template-part/edit/index.js +7 -3
- package/build/template-part/edit/index.js.map +1 -1
- package/build/template-part/edit/inner-blocks.js +3 -8
- package/build/template-part/edit/inner-blocks.js.map +1 -1
- package/build/template-part/edit/utils/hooks.js +4 -1
- package/build/template-part/edit/utils/hooks.js.map +1 -1
- package/build/transformationCategories.native.js.map +1 -1
- package/build/video/edit-common-settings.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 +43 -0
- package/build/video/edit.native.js.map +1 -1
- package/build/video/index.js +6 -1
- package/build/video/index.js.map +1 -1
- package/build-module/audio/edit.js +2 -2
- package/build-module/audio/edit.js.map +1 -1
- package/build-module/audio/index.js +6 -1
- package/build-module/audio/index.js.map +1 -1
- package/build-module/avatar/hooks.js +2 -2
- package/build-module/avatar/hooks.js.map +1 -1
- package/build-module/block/edit.js +11 -10
- package/build-module/block/edit.js.map +1 -1
- package/build-module/block/edit.native.js.map +1 -1
- package/build-module/button/deprecated.js +175 -35
- package/build-module/button/deprecated.js.map +1 -1
- package/build-module/button/edit.js +2 -2
- package/build-module/button/edit.js.map +1 -1
- package/build-module/button/edit.native.js.map +1 -1
- package/build-module/button/index.js +25 -1
- package/build-module/button/index.js.map +1 -1
- package/build-module/button/save.js +2 -2
- package/build-module/button/save.js.map +1 -1
- package/build-module/buttons/deprecated.js.map +1 -1
- package/build-module/buttons/edit.js.map +1 -1
- package/build-module/buttons/edit.native.js.map +1 -1
- package/build-module/categories/edit.js +1 -1
- package/build-module/categories/edit.js.map +1 -1
- package/build-module/categories/index.js +1 -1
- package/build-module/column/deprecated.js.map +1 -1
- package/build-module/column/edit.js.map +1 -1
- package/build-module/column/edit.native.js.map +1 -1
- package/build-module/columns/deprecated.js.map +1 -1
- package/build-module/columns/edit.js +2 -2
- package/build-module/columns/edit.js.map +1 -1
- package/build-module/columns/edit.native.js +2 -2
- package/build-module/columns/edit.native.js.map +1 -1
- package/build-module/columns/index.js +3 -1
- package/build-module/columns/index.js.map +1 -1
- package/build-module/columns/utils.js +2 -2
- package/build-module/columns/utils.js.map +1 -1
- package/build-module/comment-author-avatar/index.js +1 -0
- package/build-module/comment-author-avatar/index.js.map +1 -1
- package/build-module/comment-author-name/edit.js +4 -2
- package/build-module/comment-author-name/edit.js.map +1 -1
- package/build-module/comment-date/edit.js +1 -1
- package/build-module/comment-date/edit.js.map +1 -1
- package/build-module/comments-title/deprecated.js +102 -0
- package/build-module/comments-title/deprecated.js.map +1 -0
- package/build-module/comments-title/edit.js +38 -40
- package/build-module/comments-title/edit.js.map +1 -1
- package/build-module/comments-title/index.js +4 -8
- package/build-module/comments-title/index.js.map +1 -1
- package/build-module/cover/controls.native.js +2 -3
- package/build-module/cover/controls.native.js.map +1 -1
- package/build-module/cover/deprecated.js +206 -198
- package/build-module/cover/deprecated.js.map +1 -1
- package/build-module/cover/edit/block-controls.js +99 -0
- package/build-module/cover/edit/block-controls.js.map +1 -0
- package/build-module/cover/edit/cover-placeholder.js +38 -0
- package/build-module/cover/edit/cover-placeholder.js.map +1 -0
- package/build-module/cover/edit/index.js +310 -0
- package/build-module/cover/edit/index.js.map +1 -0
- package/build-module/cover/edit/inspector-controls.js +240 -0
- package/build-module/cover/edit/inspector-controls.js.map +1 -0
- package/build-module/cover/edit/resizable-cover.js +55 -0
- package/build-module/cover/edit/resizable-cover.js.map +1 -0
- package/build-module/cover/{use-cover-is-dark.js → edit/use-cover-is-dark.js} +0 -0
- package/build-module/cover/edit/use-cover-is-dark.js.map +1 -0
- package/build-module/cover/edit.native.js +0 -1
- package/build-module/cover/edit.native.js.map +1 -1
- package/build-module/cover/focal-point-settings-button.native.js.map +1 -1
- package/build-module/cover/save.js +19 -6
- package/build-module/cover/save.js.map +1 -1
- package/build-module/cover/shared.js +11 -5
- package/build-module/cover/shared.js.map +1 -1
- package/build-module/cover/transforms.js.map +1 -1
- package/build-module/embed/deprecated.js +6 -1
- package/build-module/embed/deprecated.js.map +1 -1
- package/build-module/embed/edit.js.map +1 -1
- package/build-module/embed/edit.native.js.map +1 -1
- package/build-module/embed/embed-controls.native.js.map +1 -1
- package/build-module/embed/embed-preview.js +2 -2
- package/build-module/embed/embed-preview.js.map +1 -1
- package/build-module/embed/index.js +6 -1
- package/build-module/embed/index.js.map +1 -1
- package/build-module/embed/transforms.js +6 -1
- package/build-module/embed/transforms.js.map +1 -1
- package/build-module/embed/util.js +6 -1
- package/build-module/embed/util.js.map +1 -1
- package/build-module/file/edit.js +2 -2
- package/build-module/file/edit.js.map +1 -1
- package/build-module/file/edit.native.js +0 -1
- package/build-module/file/edit.native.js.map +1 -1
- package/build-module/file/index.js.map +1 -1
- package/build-module/file/save.js +7 -2
- package/build-module/file/save.js.map +1 -1
- package/build-module/gallery/edit.js +4 -3
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/gallery/gallery.js +2 -2
- package/build-module/gallery/gallery.js.map +1 -1
- package/build-module/gallery/gallery.native.js.map +1 -1
- package/build-module/gallery/gap-styles.js +14 -4
- package/build-module/gallery/gap-styles.js.map +1 -1
- package/build-module/gallery/index.js +1 -1
- package/build-module/gallery/index.js.map +1 -1
- package/build-module/gallery/shared.js +27 -10
- package/build-module/gallery/shared.js.map +1 -1
- package/build-module/gallery/use-get-media.js +2 -1
- package/build-module/gallery/use-get-media.js.map +1 -1
- package/build-module/gallery/use-short-code-transform.js +19 -18
- package/build-module/gallery/use-short-code-transform.js.map +1 -1
- package/build-module/gallery/v1/edit.js.map +1 -1
- package/build-module/gallery/v1/gallery-image.js.map +1 -1
- package/build-module/gallery/v1/gallery-image.native.js.map +1 -1
- package/build-module/gallery/v1/gallery.js +2 -2
- package/build-module/gallery/v1/gallery.js.map +1 -1
- package/build-module/heading/autogenerate-anchors.js +5 -2
- package/build-module/heading/autogenerate-anchors.js.map +1 -1
- package/build-module/heading/deprecated.js.map +1 -1
- package/build-module/heading/edit.js +6 -2
- package/build-module/heading/edit.js.map +1 -1
- package/build-module/heading/index.js +1 -0
- package/build-module/heading/index.js.map +1 -1
- package/build-module/heading/transforms.js +1 -0
- package/build-module/heading/transforms.js.map +1 -1
- package/build-module/image/deprecated.js.map +1 -1
- package/build-module/image/edit.js +4 -52
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/edit.native.js +57 -6
- package/build-module/image/edit.native.js.map +1 -1
- package/build-module/image/image.js +6 -16
- package/build-module/image/image.js.map +1 -1
- package/build-module/image/index.js +5 -0
- package/build-module/image/index.js.map +1 -1
- package/build-module/image/transforms.js.map +1 -1
- package/build-module/image/utils.js +2 -2
- package/build-module/image/utils.js.map +1 -1
- package/build-module/index.js +42 -10
- package/build-module/index.js.map +1 -1
- package/build-module/is-block-metadata-experimental.js +16 -0
- package/build-module/is-block-metadata-experimental.js.map +1 -0
- package/build-module/latest-comments/edit.js.map +1 -1
- package/build-module/latest-posts/edit.js +31 -7
- package/build-module/latest-posts/edit.js.map +1 -1
- package/build-module/latest-posts/edit.native.js.map +1 -1
- package/build-module/list/index.js.map +1 -1
- package/build-module/list/transforms.js +6 -0
- package/build-module/list/transforms.js.map +1 -1
- package/build-module/list/v2/edit.js +2 -1
- package/build-module/list/v2/edit.js.map +1 -1
- package/build-module/list/v2/migrate.js +1 -3
- package/build-module/list/v2/migrate.js.map +1 -1
- package/build-module/list/v2/transforms.js +46 -9
- package/build-module/list/v2/transforms.js.map +1 -1
- package/build-module/list-item/edit.js +8 -9
- package/build-module/list-item/edit.js.map +1 -1
- package/build-module/list-item/hooks/index.js +3 -0
- package/build-module/list-item/hooks/index.js.map +1 -1
- package/build-module/list-item/hooks/use-backspace.js +44 -0
- package/build-module/list-item/hooks/use-backspace.js.map +1 -0
- package/build-module/list-item/hooks/use-enter.js +6 -9
- package/build-module/list-item/hooks/use-enter.js.map +1 -1
- package/build-module/list-item/hooks/use-indent-list-item.js +33 -38
- package/build-module/list-item/hooks/use-indent-list-item.js.map +1 -1
- package/build-module/list-item/hooks/use-outdent-list-item.js.map +1 -1
- package/build-module/list-item/hooks/use-space.js +40 -0
- package/build-module/list-item/hooks/use-space.js.map +1 -0
- package/build-module/list-item/hooks/use-split.js +33 -0
- package/build-module/list-item/hooks/use-split.js.map +1 -0
- package/build-module/list-item/index.js +1 -0
- package/build-module/list-item/index.js.map +1 -1
- package/build-module/list-item/utils.js +1 -1
- package/build-module/list-item/utils.js.map +1 -1
- package/build-module/media-text/deprecated.js +3 -1
- package/build-module/media-text/deprecated.js.map +1 -1
- package/build-module/media-text/edit.native.js +2 -1
- package/build-module/media-text/edit.native.js.map +1 -1
- package/build-module/media-text/media-container.js +3 -1
- package/build-module/media-text/media-container.js.map +1 -1
- package/build-module/media-text/media-container.native.js +2 -4
- package/build-module/media-text/media-container.native.js.map +1 -1
- package/build-module/media-text/save.js +4 -1
- package/build-module/media-text/save.js.map +1 -1
- package/build-module/media-text/transforms.js +137 -8
- package/build-module/media-text/transforms.js.map +1 -1
- package/build-module/missing/edit.native.js.map +1 -1
- package/build-module/navigation/deprecated.js.map +1 -1
- package/build-module/navigation/edit/index.js +87 -82
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/inner-blocks.js +2 -6
- package/build-module/navigation/edit/inner-blocks.js.map +1 -1
- package/build-module/navigation/edit/navigation-menu-delete-control.js.map +1 -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.map +1 -1
- package/build-module/navigation/use-navigation-entities.js +1 -1
- package/build-module/navigation/use-navigation-entities.js.map +1 -1
- package/build-module/navigation/use-navigation-menu.js +130 -38
- package/build-module/navigation/use-navigation-menu.js.map +1 -1
- package/build-module/navigation/use-template-part-area-label.js +4 -1
- package/build-module/navigation/use-template-part-area-label.js.map +1 -1
- package/build-module/navigation-link/edit.js +44 -13
- package/build-module/navigation-link/edit.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.map +1 -1
- package/build-module/page-list/convert-to-links-modal.js +1 -1
- package/build-module/page-list/convert-to-links-modal.js.map +1 -1
- package/build-module/page-list/edit.js +1 -1
- package/build-module/page-list/edit.js.map +1 -1
- package/build-module/paragraph/deprecated.js +2 -2
- package/build-module/paragraph/deprecated.js.map +1 -1
- package/build-module/pattern/edit.js.map +1 -1
- package/build-module/post-author/edit.js +1 -1
- package/build-module/post-author/edit.js.map +1 -1
- package/build-module/post-author-name/index.js +3 -0
- package/build-module/post-author-name/index.js.map +1 -1
- package/build-module/post-author-name/transforms.js +32 -0
- package/build-module/post-author-name/transforms.js.map +1 -0
- package/build-module/post-comment/index.js +1 -0
- package/build-module/post-comment/index.js.map +1 -1
- package/build-module/post-comments/edit.js +35 -16
- package/build-module/post-comments/edit.js.map +1 -1
- package/build-module/post-comments-count/index.js +1 -0
- package/build-module/post-comments-count/index.js.map +1 -1
- package/build-module/post-comments-form/form.js +8 -2
- package/build-module/post-comments-form/form.js.map +1 -1
- package/build-module/post-comments-link/index.js +1 -0
- package/build-module/post-comments-link/index.js.map +1 -1
- package/build-module/post-content/edit.js.map +1 -1
- package/build-module/post-date/edit.js +15 -9
- package/build-module/post-date/edit.js.map +1 -1
- package/build-module/post-featured-image/edit.js +11 -24
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/post-navigation-link/index.js +4 -0
- package/build-module/post-navigation-link/index.js.map +1 -1
- package/build-module/post-template/edit.js +7 -2
- package/build-module/post-template/edit.js.map +1 -1
- package/build-module/post-terms/edit.js +10 -3
- package/build-module/post-terms/edit.js.map +1 -1
- package/build-module/post-terms/hooks.js +25 -0
- package/build-module/post-terms/hooks.js.map +1 -0
- package/build-module/post-terms/index.js +10 -8
- package/build-module/post-terms/index.js.map +1 -1
- package/build-module/post-title/index.js +1 -1
- package/build-module/post-title/index.js.map +1 -1
- package/build-module/pullquote/deprecated.js.map +1 -1
- package/build-module/pullquote/edit.js +2 -2
- package/build-module/pullquote/edit.js.map +1 -1
- package/build-module/pullquote/edit.native.js +2 -2
- package/build-module/pullquote/edit.native.js.map +1 -1
- package/build-module/query/edit/index.js +5 -1
- package/build-module/query/edit/index.js.map +1 -1
- package/build-module/query/edit/inspector-controls/index.js +24 -17
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/query/edit/inspector-controls/parent-control.js +135 -0
- package/build-module/query/edit/inspector-controls/parent-control.js.map +1 -0
- package/build-module/query/edit/inspector-controls/sticky-control.js +31 -0
- package/build-module/query/edit/inspector-controls/sticky-control.js.map +1 -0
- package/build-module/query/edit/query-toolbar.js +14 -2
- package/build-module/query/edit/query-toolbar.js.map +1 -1
- package/build-module/query/index.js +2 -1
- package/build-module/query/index.js.map +1 -1
- package/build-module/query/utils.js +21 -0
- package/build-module/query/utils.js.map +1 -1
- package/build-module/query-title/index.js +1 -1
- package/build-module/query-title/index.js.map +1 -1
- package/build-module/query-title/variations.js +2 -2
- package/build-module/query-title/variations.js.map +1 -1
- package/build-module/quote/edit.js +4 -3
- package/build-module/quote/edit.js.map +1 -1
- package/build-module/quote/v2/edit.js +2 -2
- package/build-module/quote/v2/edit.js.map +1 -1
- package/build-module/search/edit.js +3 -2
- package/build-module/search/edit.js.map +1 -1
- package/build-module/search/edit.native.js.map +1 -1
- package/build-module/search/index.js +4 -0
- package/build-module/search/index.js.map +1 -1
- package/build-module/separator/use-deprecated-opacity.js.map +1 -1
- package/build-module/shortcode/edit.native.js +17 -13
- package/build-module/shortcode/edit.native.js.map +1 -1
- package/build-module/site-logo/edit.js +4 -12
- package/build-module/site-logo/edit.js.map +1 -1
- package/build-module/social-links/deprecated.js.map +1 -1
- package/build-module/social-links/edit.js +2 -2
- package/build-module/social-links/edit.js.map +1 -1
- package/build-module/social-links/edit.native.js.map +1 -1
- package/build-module/spacer/controls.js.map +1 -1
- package/build-module/table/deprecated.js.map +1 -1
- package/build-module/table/edit.js +17 -4
- package/build-module/table/edit.js.map +1 -1
- package/build-module/table/index.js +6 -1
- package/build-module/table/index.js.map +1 -1
- package/build-module/table/state.js.map +1 -1
- package/build-module/table-of-contents/edit.js +144 -68
- package/build-module/table-of-contents/edit.js.map +1 -1
- package/build-module/table-of-contents/index.js +12 -3
- package/build-module/table-of-contents/index.js.map +1 -1
- package/build-module/table-of-contents/list.js +18 -10
- package/build-module/table-of-contents/list.js.map +1 -1
- package/build-module/table-of-contents/save.js +28 -0
- package/build-module/table-of-contents/save.js.map +1 -0
- package/build-module/table-of-contents/utils.js +11 -73
- package/build-module/table-of-contents/utils.js.map +1 -1
- package/build-module/tag-cloud/edit.js.map +1 -1
- package/build-module/template-part/edit/advanced-controls.js +4 -1
- package/build-module/template-part/edit/advanced-controls.js.map +1 -1
- package/build-module/template-part/edit/index.js +8 -4
- package/build-module/template-part/edit/index.js.map +1 -1
- package/build-module/template-part/edit/inner-blocks.js +4 -9
- package/build-module/template-part/edit/inner-blocks.js.map +1 -1
- package/build-module/template-part/edit/utils/hooks.js +4 -1
- package/build-module/template-part/edit/utils/hooks.js.map +1 -1
- package/build-module/transformationCategories.native.js.map +1 -1
- package/build-module/video/edit-common-settings.js.map +1 -1
- package/build-module/video/edit.js +2 -2
- package/build-module/video/edit.js.map +1 -1
- package/build-module/video/edit.native.js +42 -1
- package/build-module/video/edit.native.js.map +1 -1
- package/build-module/video/index.js +6 -1
- package/build-module/video/index.js.map +1 -1
- package/build-style/audio/style-rtl.css +0 -3
- package/build-style/audio/style.css +0 -3
- package/build-style/button/style-rtl.css +0 -5
- package/build-style/button/style.css +0 -5
- package/build-style/common-rtl.css +1 -3
- package/build-style/common.css +1 -3
- package/build-style/cover/editor-rtl.css +11 -0
- package/build-style/cover/editor.css +11 -0
- package/build-style/cover/style-rtl.css +33 -25
- package/build-style/cover/style.css +33 -25
- package/build-style/editor-rtl.css +15 -45
- package/build-style/editor.css +15 -45
- package/build-style/embed/style-rtl.css +0 -1
- package/build-style/embed/style.css +0 -1
- package/build-style/file/style-rtl.css +9 -7
- package/build-style/file/style.css +9 -7
- package/build-style/gallery/style-rtl.css +2 -4
- package/build-style/gallery/style.css +2 -4
- package/build-style/image/editor-rtl.css +1 -1
- package/build-style/image/editor.css +1 -1
- package/build-style/image/style-rtl.css +0 -3
- package/build-style/image/style.css +0 -3
- package/build-style/post-comments/style-rtl.css +22 -0
- package/build-style/post-comments/style.css +22 -0
- package/build-style/post-comments-form/style-rtl.css +1 -3
- package/build-style/post-comments-form/style.css +1 -3
- package/build-style/post-featured-image/editor-rtl.css +0 -27
- package/build-style/post-featured-image/editor.css +0 -27
- package/build-style/search/style-rtl.css +4 -4
- package/build-style/search/style.css +4 -4
- package/build-style/separator/editor-rtl.css +1 -0
- package/build-style/separator/editor.css +1 -0
- package/build-style/site-logo/editor-rtl.css +0 -12
- package/build-style/site-logo/editor.css +0 -12
- package/build-style/site-logo/style-rtl.css +4 -0
- package/build-style/site-logo/style.css +4 -0
- package/build-style/style-rtl.css +77 -64
- package/build-style/style.css +77 -64
- package/build-style/table/style-rtl.css +0 -1
- package/build-style/table/style.css +0 -1
- package/build-style/video/editor-rtl.css +2 -5
- package/build-style/video/editor.css +2 -5
- package/build-style/video/style-rtl.css +1 -5
- package/build-style/video/style.css +1 -5
- package/build-types/table-of-contents/list.d.ts +12 -0
- package/build-types/table-of-contents/list.d.ts.map +1 -0
- package/build-types/table-of-contents/utils.d.ts +24 -0
- package/build-types/table-of-contents/utils.d.ts.map +1 -0
- package/package.json +32 -30
- package/src/audio/block.json +6 -1
- package/src/audio/edit.js +4 -2
- package/src/audio/index.js +1 -2
- package/src/audio/style.scss +0 -2
- package/src/avatar/block.json +0 -1
- package/src/avatar/hooks.js +9 -6
- package/src/avatar/index.php +2 -2
- package/src/block/edit.js +43 -48
- package/src/block/edit.native.js +12 -16
- package/src/block/test/edit.native.js +6 -9
- package/src/button/block.json +25 -1
- package/src/button/deprecated.js +145 -36
- package/src/button/edit.js +7 -11
- package/src/button/edit.native.js +2 -3
- package/src/button/save.js +5 -11
- package/src/button/style.scss +0 -5
- package/src/buttons/deprecated.js +4 -6
- package/src/buttons/edit.js +3 -3
- package/src/buttons/edit.native.js +7 -11
- package/src/buttons/test/__snapshots__/edit.native.js.snap +1 -1
- package/src/buttons/test/edit.native.js +1 -1
- package/src/categories/block.json +1 -1
- package/src/categories/edit.js +1 -1
- package/src/column/deprecated.js +2 -1
- package/src/column/edit.js +2 -3
- package/src/column/edit.native.js +2 -2
- package/src/columns/block.json +3 -1
- package/src/columns/deprecated.js +4 -2
- package/src/columns/edit.js +6 -7
- package/src/columns/edit.native.js +12 -16
- package/src/columns/index.js +1 -2
- package/src/columns/utils.js +5 -3
- package/src/comment-author-avatar/block.json +1 -0
- package/src/comment-author-name/edit.js +2 -2
- package/src/comment-date/edit.js +1 -1
- package/src/comments-title/block.json +0 -6
- package/src/comments-title/deprecated.js +34 -0
- package/src/comments-title/edit.js +44 -100
- package/src/comments-title/index.js +3 -1
- package/src/comments-title/index.php +41 -23
- package/src/cover/controls.native.js +3 -6
- package/src/cover/deprecated.js +237 -195
- package/src/cover/edit/block-controls.js +110 -0
- package/src/cover/edit/cover-placeholder.js +39 -0
- package/src/cover/edit/index.js +396 -0
- package/src/cover/edit/inspector-controls.js +317 -0
- package/src/cover/edit/resizable-cover.js +55 -0
- package/src/cover/{use-cover-is-dark.js → edit/use-cover-is-dark.js} +0 -0
- package/src/cover/edit.native.js +8 -14
- package/src/cover/editor.scss +14 -1
- package/src/cover/focal-point-settings-button.native.js +1 -1
- package/src/cover/index.php +20 -37
- package/src/cover/save.js +28 -16
- package/src/cover/shared.js +5 -3
- package/src/cover/style.scss +27 -22
- package/src/cover/test/block-controls.js +62 -0
- package/src/cover/test/edit.native.js +4 -7
- package/src/cover/transforms.js +2 -7
- package/src/embed/block.json +6 -1
- package/src/embed/edit.js +38 -40
- package/src/embed/edit.native.js +46 -49
- package/src/embed/embed-controls.native.js +2 -3
- package/src/embed/embed-preview.js +4 -2
- package/src/embed/style.scss +0 -1
- package/src/embed/test/index.native.js +24 -50
- package/src/file/edit.js +7 -5
- package/src/file/edit.native.js +14 -26
- package/src/file/index.js +1 -2
- package/src/file/save.js +14 -2
- package/src/file/style.scss +15 -14
- package/src/gallery/block.json +1 -1
- package/src/gallery/edit.js +10 -7
- package/src/gallery/gallery.js +2 -2
- package/src/gallery/gallery.native.js +2 -4
- package/src/gallery/gap-styles.js +21 -6
- package/src/gallery/index.js +2 -4
- package/src/gallery/index.php +23 -12
- package/src/gallery/shared.js +25 -11
- package/src/gallery/test/index.native.js +18 -34
- package/src/gallery/use-get-media.js +2 -1
- package/src/gallery/use-short-code-transform.js +19 -16
- package/src/gallery/v1/edit.js +15 -20
- package/src/gallery/v1/gallery-image.js +6 -11
- package/src/gallery/v1/gallery-image.native.js +8 -17
- package/src/gallery/v1/gallery.js +2 -2
- package/src/heading/autogenerate-anchors.js +8 -5
- package/src/heading/block.json +1 -0
- package/src/heading/deprecated.js +6 -21
- package/src/heading/edit.js +7 -5
- package/src/image/block.json +5 -0
- package/src/image/deprecated.js +6 -29
- package/src/image/edit.js +0 -44
- package/src/image/edit.native.js +74 -25
- package/src/image/editor.scss +1 -1
- package/src/image/image.js +41 -51
- package/src/image/style.scss +0 -2
- package/src/image/styles.native.scss +11 -0
- package/src/image/test/edit.native.js +7 -7
- package/src/image/transforms.js +4 -3
- package/src/image/utils.js +2 -2
- package/src/index.js +51 -28
- package/src/is-block-metadata-experimental.js +19 -0
- package/src/latest-comments/edit.js +2 -6
- package/src/latest-posts/edit.js +33 -9
- package/src/latest-posts/edit.native.js +10 -15
- package/src/latest-posts/index.php +12 -6
- package/src/list/index.js +1 -2
- package/src/list/test/migrate.js +1 -2
- package/src/list/transforms.js +7 -0
- package/src/list/v2/edit.js +7 -9
- package/src/list/v2/migrate.js +1 -1
- package/src/list/v2/transforms.js +35 -0
- package/src/list-item/block.json +2 -1
- package/src/list-item/edit.js +17 -10
- package/src/list-item/hooks/index.js +3 -0
- package/src/list-item/hooks/use-backspace.js +51 -0
- package/src/list-item/hooks/use-enter.js +8 -16
- package/src/list-item/hooks/use-indent-list-item.js +49 -63
- package/src/list-item/hooks/use-outdent-list-item.js +2 -3
- package/src/list-item/hooks/use-space.js +47 -0
- package/src/list-item/hooks/use-split.js +33 -0
- package/src/list-item/utils.js +1 -1
- package/src/media-text/deprecated.js +6 -3
- package/src/media-text/edit.native.js +5 -6
- package/src/media-text/media-container.js +1 -1
- package/src/media-text/media-container.native.js +8 -13
- package/src/media-text/save.js +2 -1
- package/src/media-text/transforms.js +154 -0
- package/src/missing/edit.native.js +2 -3
- package/src/missing/test/edit-integration.native.js +2 -3
- package/src/missing/test/edit.native.js +6 -9
- package/src/navigation/deprecated.js +2 -5
- package/src/navigation/edit/index.js +195 -201
- package/src/navigation/edit/inner-blocks.js +1 -8
- package/src/navigation/edit/navigation-menu-delete-control.js +2 -3
- package/src/navigation/edit/unsaved-inner-blocks.js +31 -30
- package/src/navigation/edit/use-convert-classic-menu-to-block-menu.js +2 -3
- package/src/navigation/index.php +40 -0
- package/src/navigation/test/use-navigation-menu.js +236 -0
- package/src/navigation/use-navigation-entities.js +12 -14
- package/src/navigation/use-navigation-menu.js +152 -82
- package/src/navigation/use-template-part-area-label.js +8 -7
- package/src/navigation-link/edit.js +59 -25
- package/src/navigation-link/fallback-variations.js +1 -1
- package/src/navigation-link/hooks.js +2 -2
- package/src/navigation-link/test/__snapshots__/hooks.js.snap +4 -4
- package/src/navigation-link/test/edit.js +2 -24
- package/src/navigation-submenu/edit.js +10 -20
- package/src/page-list/convert-to-links-modal.js +52 -55
- package/src/page-list/edit.js +7 -10
- package/src/page-list/test/convert-to-links-modal.js +6 -12
- package/src/paragraph/deprecated.js +2 -2
- package/src/pattern/edit.js +2 -4
- package/src/post-author/edit.js +26 -25
- package/src/post-author/index.php +3 -2
- package/src/post-author-name/block.json +1 -0
- package/src/post-author-name/index.js +2 -0
- package/src/post-author-name/index.php +1 -1
- package/src/post-author-name/transforms.js +25 -0
- package/src/post-comment/block.json +1 -0
- package/src/post-comments/edit.js +54 -22
- package/src/post-comments/index.php +1 -1
- package/src/post-comments/style.scss +26 -0
- package/src/post-comments-count/block.json +1 -0
- package/src/post-comments-form/form.js +12 -5
- package/src/post-comments-form/index.php +1 -1
- package/src/post-comments-form/style.scss +1 -4
- package/src/post-comments-link/block.json +1 -0
- package/src/post-content/edit.js +2 -3
- package/src/post-date/edit.js +4 -3
- package/src/post-featured-image/edit.js +15 -31
- package/src/post-featured-image/editor.scss +0 -29
- package/src/post-navigation-link/block.json +4 -0
- package/src/post-template/edit.js +5 -0
- package/src/post-template/index.php +30 -0
- package/src/post-terms/edit.js +19 -0
- package/src/post-terms/hooks.js +27 -0
- package/src/post-terms/index.js +14 -7
- package/src/post-terms/index.php +40 -2
- package/src/post-title/index.js +1 -1
- package/src/pullquote/deprecated.js +2 -1
- package/src/pullquote/edit.js +2 -2
- package/src/pullquote/edit.native.js +2 -2
- package/src/query/block.json +2 -1
- package/src/query/edit/index.js +10 -10
- package/src/query/edit/inspector-controls/index.js +25 -11
- package/src/query/edit/inspector-controls/parent-control.js +132 -0
- package/src/query/edit/inspector-controls/sticky-control.js +25 -0
- package/src/query/edit/query-toolbar.js +25 -5
- package/src/query/utils.js +22 -0
- package/src/query-pagination/index.php +0 -1
- package/src/query-title/index.js +1 -1
- package/src/query-title/variations.js +2 -2
- package/src/quote/edit.js +5 -2
- package/src/quote/v2/edit.js +8 -8
- package/src/quote/v2/test/migrate.js +1 -2
- package/src/search/block.json +4 -0
- package/src/search/edit.js +10 -13
- package/src/search/edit.native.js +4 -6
- package/src/search/index.php +29 -16
- package/src/search/style.scss +2 -1
- package/src/separator/editor.scss +1 -0
- package/src/separator/use-deprecated-opacity.js +2 -4
- package/src/shortcode/edit.native.js +30 -15
- package/src/shortcode/style.native.scss +11 -4
- package/src/shortcode/test/__snapshots__/edit.native.js.snap +9 -0
- package/src/shortcode/test/edit.native.js +55 -40
- package/src/site-logo/edit.js +4 -18
- package/src/site-logo/editor.scss +0 -14
- package/src/site-logo/style.scss +6 -0
- package/src/social-links/deprecated.js +4 -2
- package/src/social-links/edit.js +11 -10
- package/src/social-links/edit.native.js +3 -5
- package/src/spacer/controls.js +2 -3
- package/src/spacer/test/index.native.js +10 -21
- package/src/table/block.json +6 -1
- package/src/table/deprecated.js +4 -8
- package/src/table/edit.js +19 -4
- package/src/table/state.js +2 -4
- package/src/table/style.scss +0 -1
- package/src/table-of-contents/block.json +9 -2
- package/src/table-of-contents/edit.js +166 -77
- package/src/table-of-contents/index.js +2 -0
- package/src/table-of-contents/list.tsx +46 -0
- package/src/table-of-contents/save.js +25 -0
- package/src/table-of-contents/utils.ts +71 -0
- package/src/tag-cloud/block.json +1 -1
- package/src/tag-cloud/edit.js +4 -7
- package/src/template-part/edit/advanced-controls.js +4 -4
- package/src/template-part/edit/index.js +31 -25
- package/src/template-part/edit/inner-blocks.js +2 -10
- package/src/template-part/edit/utils/hooks.js +8 -7
- package/src/transformationCategories.native.js +3 -3
- package/src/video/block.json +6 -1
- package/src/video/edit-common-settings.js +2 -8
- package/src/video/edit.js +4 -2
- package/src/video/edit.native.js +38 -16
- package/src/video/editor.scss +3 -6
- package/src/video/index.js +1 -2
- package/src/video/style.scss +0 -2
- package/test/babel-plugin.js +67 -0
- package/tsconfig.json +11 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/build/cover/edit.js +0 -598
- package/build/cover/edit.js.map +0 -1
- package/build/cover/use-cover-is-dark.js.map +0 -1
- package/build/post-terms/variations.js +0 -37
- package/build/post-terms/variations.js.map +0 -1
- package/build-module/cover/edit.js +0 -575
- package/build-module/cover/edit.js.map +0 -1
- package/build-module/cover/use-cover-is-dark.js.map +0 -1
- package/build-module/post-terms/variations.js +0 -27
- package/build-module/post-terms/variations.js.map +0 -1
- package/src/cover/edit.js +0 -757
- package/src/post-terms/variations.js +0 -28
- package/src/table-of-contents/index.php +0 -346
- package/src/table-of-contents/list.js +0 -28
- package/src/table-of-contents/utils.js +0 -126
package/src/gallery/index.php
CHANGED
|
@@ -48,7 +48,14 @@ function block_core_gallery_render( $attributes, $content ) {
|
|
|
48
48
|
// Skip if gap value contains unsupported characters.
|
|
49
49
|
// Regex for CSS value borrowed from `safecss_filter_attr`, and used here
|
|
50
50
|
// because we only want to match against the value, not the CSS attribute.
|
|
51
|
-
|
|
51
|
+
if ( is_array( $gap ) ) {
|
|
52
|
+
foreach ( $gap as $key => $value ) {
|
|
53
|
+
$gap[ $key ] = $value && preg_match( '%[\\\(&=}]|/\*%', $value ) ? null : $value;
|
|
54
|
+
}
|
|
55
|
+
} else {
|
|
56
|
+
$gap = $gap && preg_match( '%[\\\(&=}]|/\*%', $gap ) ? null : $gap;
|
|
57
|
+
}
|
|
58
|
+
|
|
52
59
|
$class = wp_unique_id( 'wp-block-gallery-' );
|
|
53
60
|
$content = preg_replace(
|
|
54
61
|
'/' . preg_quote( 'class="', '/' ) . '/',
|
|
@@ -56,19 +63,23 @@ function block_core_gallery_render( $attributes, $content ) {
|
|
|
56
63
|
$content,
|
|
57
64
|
1
|
|
58
65
|
);
|
|
66
|
+
|
|
59
67
|
// --gallery-block--gutter-size is deprecated. --wp--style--gallery-gap-default should be used by themes that want to set a default
|
|
60
68
|
// gap on the gallery.
|
|
61
|
-
$
|
|
62
|
-
$
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
'
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
$fallback_gap = 'var( --wp--style--gallery-gap-default, var( --gallery-block--gutter-size, var( --wp--style--block-gap, 0.5em ) ) )';
|
|
70
|
+
$gap_value = $gap ? $gap : $fallback_gap;
|
|
71
|
+
$gap_column = $gap_value;
|
|
72
|
+
|
|
73
|
+
if ( is_array( $gap_value ) ) {
|
|
74
|
+
$gap_row = isset( $gap_value['top'] ) ? $gap_value['top'] : $fallback_gap;
|
|
75
|
+
$gap_column = isset( $gap_value['left'] ) ? $gap_value['left'] : $fallback_gap;
|
|
76
|
+
$gap_value = $gap_row === $gap_column ? $gap_row : $gap_row . ' ' . $gap_column;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Set the CSS variable to the column value, and the `gap` property to the combined gap value.
|
|
80
|
+
$style = '.' . $class . '{ --wp--style--unstable-gallery-gap: ' . $gap_column . '; gap: ' . $gap_value . '}';
|
|
81
|
+
|
|
82
|
+
gutenberg_enqueue_block_support_styles( $style, 11 );
|
|
72
83
|
return $content;
|
|
73
84
|
}
|
|
74
85
|
/**
|
package/src/gallery/shared.js
CHANGED
|
@@ -3,16 +3,22 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { get, pick } from 'lodash';
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* WordPress dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { Platform } from '@wordpress/element';
|
|
10
|
+
|
|
6
11
|
export function defaultColumnsNumber( imageCount ) {
|
|
7
12
|
return imageCount ? Math.min( 3, imageCount ) : 3;
|
|
8
13
|
}
|
|
9
14
|
|
|
10
15
|
export const pickRelevantMediaFiles = ( image, sizeSlug = 'large' ) => {
|
|
11
|
-
const imageProps = pick( image, [ 'alt', 'id', 'link'
|
|
16
|
+
const imageProps = pick( image, [ 'alt', 'id', 'link' ] );
|
|
12
17
|
imageProps.url =
|
|
13
18
|
get( image, [ 'sizes', sizeSlug, 'url' ] ) ||
|
|
14
19
|
get( image, [ 'media_details', 'sizes', sizeSlug, 'source_url' ] ) ||
|
|
15
|
-
image.url
|
|
20
|
+
image.url ||
|
|
21
|
+
image.source_url;
|
|
16
22
|
const fullUrl =
|
|
17
23
|
get( image, [ 'sizes', 'full', 'url' ] ) ||
|
|
18
24
|
get( image, [ 'media_details', 'sizes', 'full', 'source_url' ] );
|
|
@@ -22,6 +28,15 @@ export const pickRelevantMediaFiles = ( image, sizeSlug = 'large' ) => {
|
|
|
22
28
|
return imageProps;
|
|
23
29
|
};
|
|
24
30
|
|
|
31
|
+
function getGalleryBlockV2Enabled() {
|
|
32
|
+
// We want to fail early here, at least during beta testing phase, to ensure
|
|
33
|
+
// there aren't instances where undefined values cause false negatives.
|
|
34
|
+
if ( ! window.wp || typeof window.wp.galleryBlockV2Enabled !== 'boolean' ) {
|
|
35
|
+
throw 'window.wp.galleryBlockV2Enabled is not defined';
|
|
36
|
+
}
|
|
37
|
+
return window.wp.galleryBlockV2Enabled;
|
|
38
|
+
}
|
|
39
|
+
|
|
25
40
|
/**
|
|
26
41
|
* The new gallery block format is not compatible with the use_BalanceTags option
|
|
27
42
|
* in WP versions <= 5.8 https://core.trac.wordpress.org/ticket/54130. The
|
|
@@ -29,18 +44,17 @@ export const pickRelevantMediaFiles = ( image, sizeSlug = 'large' ) => {
|
|
|
29
44
|
* can be removed when minimum supported WP version >=5.9.
|
|
30
45
|
*/
|
|
31
46
|
export function isGalleryV2Enabled() {
|
|
47
|
+
// The logic for the native version is located in a different if statement
|
|
48
|
+
// due to a lint rule that prohibits a single conditional combining
|
|
49
|
+
// `process.env.IS_GUTENBERG_PLUGIN` with a native platform check.
|
|
50
|
+
if ( Platform.isNative ) {
|
|
51
|
+
return getGalleryBlockV2Enabled();
|
|
52
|
+
}
|
|
53
|
+
|
|
32
54
|
// Only run the Gallery version compat check if the plugin is running, otherwise
|
|
33
55
|
// assume we are in 5.9 core and enable by default.
|
|
34
56
|
if ( process.env.IS_GUTENBERG_PLUGIN ) {
|
|
35
|
-
|
|
36
|
-
// there aren't instances where undefined values cause false negatives.
|
|
37
|
-
if (
|
|
38
|
-
! window.wp ||
|
|
39
|
-
typeof window.wp.galleryBlockV2Enabled !== 'boolean'
|
|
40
|
-
) {
|
|
41
|
-
throw 'window.wp.galleryBlockV2Enabled is not defined';
|
|
42
|
-
}
|
|
43
|
-
return window.wp.galleryBlockV2Enabled;
|
|
57
|
+
return getGalleryBlockV2Enabled();
|
|
44
58
|
}
|
|
45
59
|
|
|
46
60
|
return true;
|
|
@@ -110,13 +110,10 @@ describe( 'Gallery block', () => {
|
|
|
110
110
|
// is addressed.
|
|
111
111
|
it.skip( 'displays media options picker when selecting the block', async () => {
|
|
112
112
|
// Initialize with an empty gallery
|
|
113
|
-
const {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
} = await initializeEditor( {
|
|
118
|
-
initialHtml: generateGalleryBlock( 0 ),
|
|
119
|
-
} );
|
|
113
|
+
const { getByA11yLabel, getByText, getByTestId } =
|
|
114
|
+
await initializeEditor( {
|
|
115
|
+
initialHtml: generateGalleryBlock( 0 ),
|
|
116
|
+
} );
|
|
120
117
|
|
|
121
118
|
// Tap on Gallery block
|
|
122
119
|
fireEvent.press( getByText( 'ADD MEDIA' ) );
|
|
@@ -208,9 +205,8 @@ describe( 'Gallery block', () => {
|
|
|
208
205
|
fireEvent.press( galleryItem );
|
|
209
206
|
|
|
210
207
|
// Set gallery item caption
|
|
211
|
-
const captionField =
|
|
212
|
-
'Add caption'
|
|
213
|
-
);
|
|
208
|
+
const captionField =
|
|
209
|
+
within( galleryItem ).getByPlaceholderText( 'Add caption' );
|
|
214
210
|
setCaption(
|
|
215
211
|
captionField,
|
|
216
212
|
'<strong>Bold</strong> <em>italic</em> <s>strikethrough</s> image caption'
|
|
@@ -223,10 +219,8 @@ describe( 'Gallery block', () => {
|
|
|
223
219
|
// Reference: https://github.com/wordpress-mobile/test-cases/blob/trunk/test-cases/gutenberg/gallery.md#tc005
|
|
224
220
|
it( 'successfully uploads items', async () => {
|
|
225
221
|
const { notifyUploadingState, notifySucceedState } = setupMediaUpload();
|
|
226
|
-
const {
|
|
227
|
-
|
|
228
|
-
mediaPickerCallback,
|
|
229
|
-
} = setupMediaPicker();
|
|
222
|
+
const { expectMediaPickerCall, mediaPickerCallback } =
|
|
223
|
+
setupMediaPicker();
|
|
230
224
|
|
|
231
225
|
// Initialize with an empty gallery
|
|
232
226
|
const { galleryBlock, getByText } = await initializeWithGalleryBlock();
|
|
@@ -263,10 +257,8 @@ describe( 'Gallery block', () => {
|
|
|
263
257
|
// Reference: https://github.com/wordpress-mobile/test-cases/blob/trunk/test-cases/gutenberg/gallery.md#tc006
|
|
264
258
|
it( 'handles failed uploads', async () => {
|
|
265
259
|
const { notifyUploadingState, notifyFailedState } = setupMediaUpload();
|
|
266
|
-
const {
|
|
267
|
-
|
|
268
|
-
mediaPickerCallback,
|
|
269
|
-
} = setupMediaPicker();
|
|
260
|
+
const { expectMediaPickerCall, mediaPickerCallback } =
|
|
261
|
+
setupMediaPicker();
|
|
270
262
|
|
|
271
263
|
// Initialize with an empty gallery
|
|
272
264
|
const { galleryBlock, getByText } = await initializeWithGalleryBlock();
|
|
@@ -319,10 +311,8 @@ describe( 'Gallery block', () => {
|
|
|
319
311
|
// Reference: https://github.com/wordpress-mobile/test-cases/blob/trunk/test-cases/gutenberg/gallery.md#tc007
|
|
320
312
|
it( 'takes a photo', async () => {
|
|
321
313
|
const { notifyUploadingState, notifySucceedState } = setupMediaUpload();
|
|
322
|
-
const {
|
|
323
|
-
|
|
324
|
-
mediaPickerCallback,
|
|
325
|
-
} = setupMediaPicker();
|
|
314
|
+
const { expectMediaPickerCall, mediaPickerCallback } =
|
|
315
|
+
setupMediaPicker();
|
|
326
316
|
|
|
327
317
|
// Initialize with an empty gallery
|
|
328
318
|
const { galleryBlock, getByText } = await initializeWithGalleryBlock();
|
|
@@ -360,10 +350,8 @@ describe( 'Gallery block', () => {
|
|
|
360
350
|
}.jpeg`,
|
|
361
351
|
} ) );
|
|
362
352
|
const { notifyUploadingState, notifySucceedState } = setupMediaUpload();
|
|
363
|
-
const {
|
|
364
|
-
|
|
365
|
-
mediaPickerCallback,
|
|
366
|
-
} = setupMediaPicker();
|
|
353
|
+
const { expectMediaPickerCall, mediaPickerCallback } =
|
|
354
|
+
setupMediaPicker();
|
|
367
355
|
|
|
368
356
|
let otherMediaOptionsCallback;
|
|
369
357
|
getOtherMediaOptions.mockImplementation( ( filter, callback ) => {
|
|
@@ -417,10 +405,8 @@ describe( 'Gallery block', () => {
|
|
|
417
405
|
// Reference: https://github.com/wordpress-mobile/test-cases/blob/trunk/test-cases/gutenberg/gallery.md#tc009
|
|
418
406
|
it( 'cancels uploads', async () => {
|
|
419
407
|
const { notifyUploadingState, notifyResetState } = setupMediaUpload();
|
|
420
|
-
const {
|
|
421
|
-
|
|
422
|
-
mediaPickerCallback,
|
|
423
|
-
} = setupMediaPicker();
|
|
408
|
+
const { expectMediaPickerCall, mediaPickerCallback } =
|
|
409
|
+
setupMediaPicker();
|
|
424
410
|
|
|
425
411
|
// Initialize with an empty gallery
|
|
426
412
|
const { galleryBlock, getByText } = await initializeWithGalleryBlock();
|
|
@@ -506,10 +492,8 @@ describe( 'Gallery block', () => {
|
|
|
506
492
|
localUrl: `file:///IMG_${ index + 1 }.JPG`,
|
|
507
493
|
} ) );
|
|
508
494
|
const { notifyUploadingState, notifySucceedState } = setupMediaUpload();
|
|
509
|
-
const {
|
|
510
|
-
|
|
511
|
-
mediaPickerCallback,
|
|
512
|
-
} = setupMediaPicker();
|
|
495
|
+
const { expectMediaPickerCall, mediaPickerCallback } =
|
|
496
|
+
setupMediaPicker();
|
|
513
497
|
|
|
514
498
|
let otherMediaOptionsCallback;
|
|
515
499
|
getOtherMediaOptions.mockImplementation( ( filter, callback ) => {
|
|
@@ -23,20 +23,13 @@ export default function useShortCodeTransform( shortCodeTransforms ) {
|
|
|
23
23
|
if ( ! shortCodeTransforms || shortCodeTransforms.length === 0 ) {
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
url: imageData.source_url,
|
|
34
|
-
mime: imageData.mime_type,
|
|
35
|
-
alt: imageData.alt_text,
|
|
36
|
-
link: imageData.link,
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
return undefined;
|
|
26
|
+
|
|
27
|
+
const imageIds = shortCodeTransforms.map( ( image ) => image.id );
|
|
28
|
+
|
|
29
|
+
return select( coreStore ).getMediaItems( {
|
|
30
|
+
include: imageIds.join( ',' ),
|
|
31
|
+
per_page: imageIds.length,
|
|
32
|
+
orderby: 'include',
|
|
40
33
|
} );
|
|
41
34
|
},
|
|
42
35
|
[ shortCodeTransforms ]
|
|
@@ -46,7 +39,17 @@ export default function useShortCodeTransform( shortCodeTransforms ) {
|
|
|
46
39
|
return;
|
|
47
40
|
}
|
|
48
41
|
|
|
49
|
-
if ( every( newImageData, ( img ) => img && img.
|
|
50
|
-
return newImageData
|
|
42
|
+
if ( every( newImageData, ( img ) => img && img.source_url ) ) {
|
|
43
|
+
return newImageData.map( ( imageData ) => {
|
|
44
|
+
return {
|
|
45
|
+
id: imageData.id,
|
|
46
|
+
type: 'image',
|
|
47
|
+
url: imageData.source_url,
|
|
48
|
+
mime: imageData.mime_type,
|
|
49
|
+
alt: imageData.alt_text,
|
|
50
|
+
link: imageData.link,
|
|
51
|
+
caption: imageData?.caption?.raw,
|
|
52
|
+
};
|
|
53
|
+
} );
|
|
51
54
|
}
|
|
52
55
|
}
|
package/src/gallery/v1/edit.js
CHANGED
|
@@ -90,27 +90,22 @@ function GalleryEdit( props ) {
|
|
|
90
90
|
} = attributes;
|
|
91
91
|
const [ selectedImage, setSelectedImage ] = useState();
|
|
92
92
|
const [ attachmentCaptions, setAttachmentCaptions ] = useState();
|
|
93
|
-
const { __unstableMarkNextChangeAsNotPersistent } =
|
|
94
|
-
blockEditorStore
|
|
95
|
-
);
|
|
93
|
+
const { __unstableMarkNextChangeAsNotPersistent } =
|
|
94
|
+
useDispatch( blockEditorStore );
|
|
96
95
|
|
|
97
|
-
const {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
blockEditorStore
|
|
111
|
-
).wasBlockJustInserted( clientId, 'inserter_menu' ),
|
|
112
|
-
};
|
|
113
|
-
} );
|
|
96
|
+
const { imageSizes, mediaUpload, getMedia, wasBlockJustInserted } =
|
|
97
|
+
useSelect( ( select ) => {
|
|
98
|
+
const settings = select( blockEditorStore ).getSettings();
|
|
99
|
+
|
|
100
|
+
return {
|
|
101
|
+
imageSizes: settings.imageSizes,
|
|
102
|
+
mediaUpload: settings.mediaUpload,
|
|
103
|
+
getMedia: select( coreStore ).getMedia,
|
|
104
|
+
wasBlockJustInserted: select(
|
|
105
|
+
blockEditorStore
|
|
106
|
+
).wasBlockJustInserted( clientId, 'inserter_menu' ),
|
|
107
|
+
};
|
|
108
|
+
} );
|
|
114
109
|
|
|
115
110
|
const resizedImages = useMemo( () => {
|
|
116
111
|
if ( isSelected ) {
|
|
@@ -47,9 +47,8 @@ class GalleryImage extends Component {
|
|
|
47
47
|
this.onRemoveImage = this.onRemoveImage.bind( this );
|
|
48
48
|
this.bindContainer = this.bindContainer.bind( this );
|
|
49
49
|
this.onEdit = this.onEdit.bind( this );
|
|
50
|
-
this.onSelectImageFromLibrary =
|
|
51
|
-
this
|
|
52
|
-
);
|
|
50
|
+
this.onSelectImageFromLibrary =
|
|
51
|
+
this.onSelectImageFromLibrary.bind( this );
|
|
53
52
|
this.onSelectCustomURL = this.onSelectCustomURL.bind( this );
|
|
54
53
|
this.state = {
|
|
55
54
|
isEditing: false,
|
|
@@ -84,11 +83,8 @@ class GalleryImage extends Component {
|
|
|
84
83
|
}
|
|
85
84
|
|
|
86
85
|
componentDidUpdate() {
|
|
87
|
-
const {
|
|
88
|
-
|
|
89
|
-
url,
|
|
90
|
-
__unstableMarkNextChangeAsNotPersistent,
|
|
91
|
-
} = this.props;
|
|
86
|
+
const { image, url, __unstableMarkNextChangeAsNotPersistent } =
|
|
87
|
+
this.props;
|
|
92
88
|
if ( image && ! url ) {
|
|
93
89
|
__unstableMarkNextChangeAsNotPersistent();
|
|
94
90
|
this.props.setAttributes( {
|
|
@@ -273,9 +269,8 @@ export default compose( [
|
|
|
273
269
|
};
|
|
274
270
|
} ),
|
|
275
271
|
withDispatch( ( dispatch ) => {
|
|
276
|
-
const { __unstableMarkNextChangeAsNotPersistent } =
|
|
277
|
-
blockEditorStore
|
|
278
|
-
);
|
|
272
|
+
const { __unstableMarkNextChangeAsNotPersistent } =
|
|
273
|
+
dispatch( blockEditorStore );
|
|
279
274
|
return {
|
|
280
275
|
__unstableMarkNextChangeAsNotPersistent,
|
|
281
276
|
};
|
|
@@ -50,12 +50,10 @@ class GalleryImage extends Component {
|
|
|
50
50
|
this.onSelectMedia = this.onSelectMedia.bind( this );
|
|
51
51
|
|
|
52
52
|
this.updateMediaProgress = this.updateMediaProgress.bind( this );
|
|
53
|
-
this.finishMediaUploadWithSuccess =
|
|
54
|
-
this
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
this
|
|
58
|
-
);
|
|
53
|
+
this.finishMediaUploadWithSuccess =
|
|
54
|
+
this.finishMediaUploadWithSuccess.bind( this );
|
|
55
|
+
this.finishMediaUploadWithFailure =
|
|
56
|
+
this.finishMediaUploadWithFailure.bind( this );
|
|
59
57
|
this.renderContent = this.renderContent.bind( this );
|
|
60
58
|
|
|
61
59
|
this.state = {
|
|
@@ -79,11 +77,8 @@ class GalleryImage extends Component {
|
|
|
79
77
|
|
|
80
78
|
onMediaPressed() {
|
|
81
79
|
const { id, url, isSelected } = this.props;
|
|
82
|
-
const {
|
|
83
|
-
|
|
84
|
-
isUploadInProgress,
|
|
85
|
-
didUploadFail,
|
|
86
|
-
} = this.state;
|
|
80
|
+
const { captionSelected, isUploadInProgress, didUploadFail } =
|
|
81
|
+
this.state;
|
|
87
82
|
|
|
88
83
|
this.onSelectImage();
|
|
89
84
|
|
|
@@ -303,12 +298,8 @@ class GalleryImage extends Component {
|
|
|
303
298
|
}
|
|
304
299
|
|
|
305
300
|
render() {
|
|
306
|
-
const {
|
|
307
|
-
|
|
308
|
-
onRemove,
|
|
309
|
-
getStylesFromColorScheme,
|
|
310
|
-
isSelected,
|
|
311
|
-
} = this.props;
|
|
301
|
+
const { id, onRemove, getStylesFromColorScheme, isSelected } =
|
|
302
|
+
this.props;
|
|
312
303
|
|
|
313
304
|
const containerStyle = getStylesFromColorScheme(
|
|
314
305
|
style.galleryImageContainer,
|
|
@@ -9,7 +9,7 @@ import classnames from 'classnames';
|
|
|
9
9
|
import { RichText } from '@wordpress/block-editor';
|
|
10
10
|
import { VisuallyHidden } from '@wordpress/components';
|
|
11
11
|
import { __, sprintf } from '@wordpress/i18n';
|
|
12
|
-
import { createBlock } from '@wordpress/blocks';
|
|
12
|
+
import { createBlock, getDefaultBlockName } from '@wordpress/blocks';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Internal dependencies
|
|
@@ -101,7 +101,7 @@ export const Gallery = ( props ) => {
|
|
|
101
101
|
onChange={ ( value ) => setAttributes( { caption: value } ) }
|
|
102
102
|
inlineToolbar
|
|
103
103
|
__unstableOnSplitAtEnd={ () =>
|
|
104
|
-
insertBlocksAfter( createBlock(
|
|
104
|
+
insertBlocksAfter( createBlock( getDefaultBlockName() ) )
|
|
105
105
|
}
|
|
106
106
|
/>
|
|
107
107
|
</figure>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
4
|
+
import removeAccents from 'remove-accents';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Object map tracking anchors.
|
|
@@ -32,11 +32,14 @@ const getTextWithoutMarkup = ( text ) => {
|
|
|
32
32
|
*/
|
|
33
33
|
const getSlug = ( content ) => {
|
|
34
34
|
// Get the slug.
|
|
35
|
-
return
|
|
36
|
-
|
|
35
|
+
return (
|
|
36
|
+
removeAccents( getTextWithoutMarkup( content ) )
|
|
37
|
+
// Convert anything that's not a letter or number to a hyphen.
|
|
37
38
|
.replace( /[^\p{L}\p{N}]+/gu, '-' )
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
// Convert to lowercase
|
|
40
|
+
.toLowerCase()
|
|
41
|
+
// Remove any remaining leading or trailing hyphens.
|
|
42
|
+
.replace( /(^-+)|(-+$)/g, '' )
|
|
40
43
|
);
|
|
41
44
|
};
|
|
42
45
|
|
package/src/heading/block.json
CHANGED
|
@@ -112,13 +112,8 @@ const deprecated = [
|
|
|
112
112
|
migrate: ( attributes ) =>
|
|
113
113
|
migrateCustomColors( migrateTextAlign( attributes ) ),
|
|
114
114
|
save( { attributes } ) {
|
|
115
|
-
const {
|
|
116
|
-
|
|
117
|
-
content,
|
|
118
|
-
customTextColor,
|
|
119
|
-
level,
|
|
120
|
-
textColor,
|
|
121
|
-
} = attributes;
|
|
115
|
+
const { align, content, customTextColor, level, textColor } =
|
|
116
|
+
attributes;
|
|
122
117
|
const tagName = 'h' + level;
|
|
123
118
|
|
|
124
119
|
const textClass = getColorClassName( 'color', textColor );
|
|
@@ -154,13 +149,8 @@ const deprecated = [
|
|
|
154
149
|
migrate: ( attributes ) =>
|
|
155
150
|
migrateCustomColors( migrateTextAlign( attributes ) ),
|
|
156
151
|
save( { attributes } ) {
|
|
157
|
-
const {
|
|
158
|
-
|
|
159
|
-
content,
|
|
160
|
-
customTextColor,
|
|
161
|
-
level,
|
|
162
|
-
textColor,
|
|
163
|
-
} = attributes;
|
|
152
|
+
const { align, content, customTextColor, level, textColor } =
|
|
153
|
+
attributes;
|
|
164
154
|
const tagName = 'h' + level;
|
|
165
155
|
|
|
166
156
|
const textClass = getColorClassName( 'color', textColor );
|
|
@@ -197,13 +187,8 @@ const deprecated = [
|
|
|
197
187
|
migrate: ( attributes ) =>
|
|
198
188
|
migrateCustomColors( migrateTextAlign( attributes ) ),
|
|
199
189
|
save( { attributes } ) {
|
|
200
|
-
const {
|
|
201
|
-
|
|
202
|
-
level,
|
|
203
|
-
content,
|
|
204
|
-
textColor,
|
|
205
|
-
customTextColor,
|
|
206
|
-
} = attributes;
|
|
190
|
+
const { align, level, content, textColor, customTextColor } =
|
|
191
|
+
attributes;
|
|
207
192
|
const tagName = 'h' + level;
|
|
208
193
|
|
|
209
194
|
const textClass = getColorClassName( 'color', textColor );
|
package/src/heading/edit.js
CHANGED
|
@@ -42,16 +42,18 @@ function HeadingEdit( {
|
|
|
42
42
|
} );
|
|
43
43
|
|
|
44
44
|
const { canGenerateAnchors } = useSelect( ( select ) => {
|
|
45
|
-
const
|
|
45
|
+
const { getGlobalBlockCount, getSettings } = select( blockEditorStore );
|
|
46
|
+
const settings = getSettings();
|
|
46
47
|
|
|
47
48
|
return {
|
|
48
|
-
canGenerateAnchors:
|
|
49
|
+
canGenerateAnchors:
|
|
50
|
+
!! settings.generateAnchors ||
|
|
51
|
+
getGlobalBlockCount( 'core/table-of-contents' ) > 0,
|
|
49
52
|
};
|
|
50
53
|
}, [] );
|
|
51
54
|
|
|
52
|
-
const { __unstableMarkNextChangeAsNotPersistent } =
|
|
53
|
-
blockEditorStore
|
|
54
|
-
);
|
|
55
|
+
const { __unstableMarkNextChangeAsNotPersistent } =
|
|
56
|
+
useDispatch( blockEditorStore );
|
|
55
57
|
|
|
56
58
|
// Initially set anchor for headings that have content but no anchor set.
|
|
57
59
|
// This is used when transforming a block to heading, or for legacy anchors.
|
package/src/image/block.json
CHANGED
package/src/image/deprecated.js
CHANGED
|
@@ -176,16 +176,8 @@ const deprecated = [
|
|
|
176
176
|
{
|
|
177
177
|
attributes: blockAttributes,
|
|
178
178
|
save( { attributes } ) {
|
|
179
|
-
const {
|
|
180
|
-
|
|
181
|
-
alt,
|
|
182
|
-
caption,
|
|
183
|
-
align,
|
|
184
|
-
href,
|
|
185
|
-
width,
|
|
186
|
-
height,
|
|
187
|
-
id,
|
|
188
|
-
} = attributes;
|
|
179
|
+
const { url, alt, caption, align, href, width, height, id } =
|
|
180
|
+
attributes;
|
|
189
181
|
|
|
190
182
|
const classes = classnames( {
|
|
191
183
|
[ `align${ align }` ]: align,
|
|
@@ -218,16 +210,8 @@ const deprecated = [
|
|
|
218
210
|
{
|
|
219
211
|
attributes: blockAttributes,
|
|
220
212
|
save( { attributes } ) {
|
|
221
|
-
const {
|
|
222
|
-
|
|
223
|
-
alt,
|
|
224
|
-
caption,
|
|
225
|
-
align,
|
|
226
|
-
href,
|
|
227
|
-
width,
|
|
228
|
-
height,
|
|
229
|
-
id,
|
|
230
|
-
} = attributes;
|
|
213
|
+
const { url, alt, caption, align, href, width, height, id } =
|
|
214
|
+
attributes;
|
|
231
215
|
|
|
232
216
|
const image = (
|
|
233
217
|
<img
|
|
@@ -255,15 +239,8 @@ const deprecated = [
|
|
|
255
239
|
{
|
|
256
240
|
attributes: blockAttributes,
|
|
257
241
|
save( { attributes } ) {
|
|
258
|
-
const {
|
|
259
|
-
|
|
260
|
-
alt,
|
|
261
|
-
caption,
|
|
262
|
-
align,
|
|
263
|
-
href,
|
|
264
|
-
width,
|
|
265
|
-
height,
|
|
266
|
-
} = attributes;
|
|
242
|
+
const { url, alt, caption, align, href, width, height } =
|
|
243
|
+
attributes;
|
|
267
244
|
const extraImageProps = width || height ? { width, height } : {};
|
|
268
245
|
const image = (
|
|
269
246
|
<img src={ url } alt={ alt } { ...extraImageProps } />
|