@wordpress/block-library 10.1.0 → 10.2.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 +18 -0
- package/build/accordion/block.json +1 -0
- package/build/accordion/edit.cjs +0 -1
- package/build/accordion/edit.cjs.map +2 -2
- package/build/accordion/view.cjs +23 -0
- package/build/accordion/view.cjs.map +2 -2
- package/build/accordion-heading/deprecated.cjs +121 -1
- package/build/accordion-heading/deprecated.cjs.map +2 -2
- package/build/accordion-heading/edit.cjs +18 -1
- package/build/accordion-heading/edit.cjs.map +3 -3
- package/build/accordion-heading/save.cjs +18 -1
- package/build/accordion-heading/save.cjs.map +3 -3
- package/build/accordion-panel/edit.cjs +1 -1
- package/build/accordion-panel/edit.cjs.map +2 -2
- package/build/archives/edit.cjs +0 -1
- package/build/archives/edit.cjs.map +2 -2
- package/build/audio/edit.cjs +0 -1
- package/build/audio/edit.cjs.map +2 -2
- package/build/avatar/edit.cjs +0 -1
- package/build/avatar/edit.cjs.map +2 -2
- package/build/avatar/user-control.cjs +0 -1
- package/build/avatar/user-control.cjs.map +2 -2
- package/build/button/edit.cjs +18 -8
- package/build/button/edit.cjs.map +2 -2
- package/build/categories/edit.cjs +0 -1
- package/build/categories/edit.cjs.map +2 -2
- package/build/code/transforms.cjs +5 -3
- package/build/code/transforms.cjs.map +2 -2
- package/build/column/edit.cjs +0 -1
- package/build/column/edit.cjs.map +2 -2
- package/build/columns/edit.cjs +0 -1
- package/build/columns/edit.cjs.map +2 -2
- package/build/columns/transforms.cjs +9 -2
- package/build/columns/transforms.cjs.map +2 -2
- package/build/comment-author-avatar/edit.cjs +0 -1
- package/build/comment-author-avatar/edit.cjs.map +2 -2
- package/build/comments-pagination/comments-pagination-arrow-controls.cjs +0 -1
- package/build/comments-pagination/comments-pagination-arrow-controls.cjs.map +2 -2
- package/build/cover/block.json +11 -0
- package/build/cover/edit/block-controls.cjs +11 -4
- package/build/cover/edit/block-controls.cjs.map +2 -2
- package/build/cover/edit/embed-video-url-input.cjs +5 -3
- package/build/cover/edit/embed-video-url-input.cjs.map +3 -3
- package/build/cover/edit/index.cjs +1 -1
- package/build/cover/edit/index.cjs.map +2 -2
- package/build/cover/edit/inspector-controls.cjs +1 -3
- package/build/cover/edit/inspector-controls.cjs.map +2 -2
- package/build/cover/embed-video-utils.cjs +17 -7
- package/build/cover/embed-video-utils.cjs.map +2 -2
- package/build/details/transforms.cjs +1 -1
- package/build/details/transforms.cjs.map +2 -2
- package/build/embed/edit.cjs +2 -3
- package/build/embed/edit.cjs.map +2 -2
- package/build/embed/embed-placeholder.cjs +20 -21
- package/build/embed/embed-placeholder.cjs.map +3 -3
- package/build/file/edit.cjs +4 -3
- package/build/file/edit.cjs.map +2 -2
- package/build/file/inspector.cjs +0 -2
- package/build/file/inspector.cjs.map +2 -2
- package/build/file/transforms.cjs +25 -60
- package/build/file/transforms.cjs.map +2 -2
- package/build/form/edit.cjs +0 -2
- package/build/form/edit.cjs.map +2 -2
- package/build/freeform/convert-to-blocks-button.cjs +52 -0
- package/build/freeform/convert-to-blocks-button.cjs.map +7 -0
- package/build/freeform/edit.cjs +14 -33
- package/build/freeform/edit.cjs.map +3 -3
- package/build/freeform/index.cjs +1 -7
- package/build/freeform/index.cjs.map +3 -3
- package/build/gallery/block.json +8 -3
- package/build/gallery/dynamic-gallery.cjs +263 -0
- package/build/gallery/dynamic-gallery.cjs.map +7 -0
- package/build/gallery/dynamic-source.cjs +85 -0
- package/build/gallery/dynamic-source.cjs.map +7 -0
- package/build/gallery/edit.cjs +286 -206
- package/build/gallery/edit.cjs.map +3 -3
- package/build/gallery/gallery.cjs +0 -3
- package/build/gallery/gallery.cjs.map +2 -2
- package/build/gallery/gap-styles.cjs +49 -13
- package/build/gallery/gap-styles.cjs.map +3 -3
- package/build/gallery/index.cjs +2 -0
- package/build/gallery/index.cjs.map +3 -3
- package/build/gallery/save.cjs +16 -12
- package/build/gallery/save.cjs.map +2 -2
- package/build/gallery/use-dynamic-gallery.cjs +181 -0
- package/build/gallery/use-dynamic-gallery.cjs.map +7 -0
- package/build/gallery/variations.cjs +54 -0
- package/build/gallery/variations.cjs.map +7 -0
- package/build/group/edit.cjs +1 -2
- package/build/group/edit.cjs.map +2 -2
- package/build/group/transforms.cjs +3 -7
- package/build/group/transforms.cjs.map +2 -2
- package/build/heading/edit.cjs +10 -3
- package/build/heading/edit.cjs.map +2 -2
- package/build/html/block.json +2 -2
- package/build/html/edit.cjs +65 -23
- package/build/html/edit.cjs.map +3 -3
- package/build/html/index.cjs +3 -3
- package/build/html/index.cjs.map +2 -2
- package/build/html/modal.cjs +4 -8
- package/build/html/modal.cjs.map +2 -2
- package/build/html/save.cjs +2 -4
- package/build/html/save.cjs.map +2 -2
- package/build/html/transforms.cjs +7 -5
- package/build/html/transforms.cjs.map +2 -2
- package/build/icon/components/custom-inserter/icon-grid.cjs +25 -12
- package/build/icon/components/custom-inserter/icon-grid.cjs.map +2 -2
- package/build/icon/components/custom-inserter/index.cjs +100 -31
- package/build/icon/components/custom-inserter/index.cjs.map +3 -3
- package/build/icon/edit.cjs +11 -12
- package/build/icon/edit.cjs.map +2 -2
- package/build/image/block.json +1 -1
- package/build/image/image.cjs +23 -70
- package/build/image/image.cjs.map +3 -3
- package/build/image/transforms.cjs +78 -0
- package/build/image/transforms.cjs.map +3 -3
- package/build/index.cjs +18 -8
- package/build/index.cjs.map +2 -2
- package/build/latest-comments/edit.cjs +0 -2
- package/build/latest-comments/edit.cjs.map +2 -2
- package/build/latest-posts/block.json +8 -9
- package/build/latest-posts/constants.cjs +0 -3
- package/build/latest-posts/constants.cjs.map +2 -2
- package/build/latest-posts/deprecated.cjs +100 -8
- package/build/latest-posts/deprecated.cjs.map +2 -2
- package/build/latest-posts/edit.cjs +67 -84
- package/build/latest-posts/edit.cjs.map +2 -2
- package/build/list/ordered-list-settings.cjs +0 -1
- package/build/list/ordered-list-settings.cjs.map +2 -2
- package/build/list-item/edit.cjs +1 -1
- package/build/list-item/edit.cjs.map +2 -2
- package/build/list-item/hooks/use-enter.cjs +14 -17
- package/build/list-item/hooks/use-enter.cjs.map +3 -3
- package/build/list-item/hooks/use-space.cjs +3 -2
- package/build/list-item/hooks/use-space.cjs.map +3 -3
- package/build/media-text/edit.cjs +0 -1
- package/build/media-text/edit.cjs.map +2 -2
- package/build/missing/edit.cjs +1 -3
- package/build/missing/edit.cjs.map +2 -2
- package/build/navigation/edit/index.cjs +0 -1
- package/build/navigation/edit/index.cjs.map +2 -2
- package/build/navigation/edit/overlay-menu-preview-controls.cjs +0 -1
- package/build/navigation/edit/overlay-menu-preview-controls.cjs.map +2 -2
- package/build/navigation/edit/overlay-menu-preview.cjs +0 -1
- package/build/navigation/edit/overlay-menu-preview.cjs.map +2 -2
- package/build/navigation/edit/overlay-template-part-selector.cjs +0 -1
- package/build/navigation/edit/overlay-template-part-selector.cjs.map +2 -2
- package/build/navigation/edit/overlay-visibility-control.cjs +0 -1
- package/build/navigation/edit/overlay-visibility-control.cjs.map +2 -2
- package/build/navigation-link/shared/use-link-preview.cjs +11 -1
- package/build/navigation-link/shared/use-link-preview.cjs.map +2 -2
- package/build/navigation-overlay-close/edit.cjs +0 -1
- package/build/navigation-overlay-close/edit.cjs.map +2 -2
- package/build/page-list/edit.cjs +0 -1
- package/build/page-list/edit.cjs.map +2 -2
- package/build/paragraph/block.json +1 -0
- package/build/paragraph/use-enter.cjs +3 -7
- package/build/paragraph/use-enter.cjs.map +3 -3
- package/build/playlist/block.json +28 -15
- package/build/playlist/context.cjs +36 -0
- package/build/playlist/context.cjs.map +7 -0
- package/build/playlist/edit.cjs +257 -81
- package/build/playlist/edit.cjs.map +3 -3
- package/build/playlist/index.cjs +1 -1
- package/build/playlist/index.cjs.map +2 -2
- package/build/playlist/utils.cjs +19 -8
- package/build/playlist/utils.cjs.map +3 -3
- package/build/playlist/view.cjs +87 -17
- package/build/playlist/view.cjs.map +2 -2
- package/build/playlist-track/block.json +4 -5
- package/build/playlist-track/edit.cjs +114 -70
- package/build/playlist-track/edit.cjs.map +3 -3
- package/build/post-author/edit.cjs +0 -2
- package/build/post-author/edit.cjs.map +2 -2
- package/build/post-content/block.json +1 -0
- package/build/post-excerpt/edit.cjs +0 -1
- package/build/post-excerpt/edit.cjs.map +2 -2
- package/build/post-featured-image/overlay-controls.cjs +1 -2
- package/build/post-featured-image/overlay-controls.cjs.map +2 -2
- package/build/post-navigation-link/edit.cjs +0 -2
- package/build/post-navigation-link/edit.cjs.map +2 -2
- package/build/post-template/block.json +2 -1
- package/build/post-template/edit.cjs +10 -1
- package/build/post-template/edit.cjs.map +2 -2
- package/build/pullquote/block.json +3 -1
- package/build/query/block.json +3 -2
- package/build/query/edit/inspector-controls/author-control.cjs +1 -2
- package/build/query/edit/inspector-controls/author-control.cjs.map +2 -2
- package/build/query/edit/inspector-controls/format-controls.cjs +1 -2
- package/build/query/edit/inspector-controls/format-controls.cjs.map +2 -2
- package/build/query/edit/inspector-controls/index.cjs +38 -7
- package/build/query/edit/inspector-controls/index.cjs.map +2 -2
- package/build/query/edit/inspector-controls/offset-controls.cjs +0 -1
- package/build/query/edit/inspector-controls/offset-controls.cjs.map +2 -2
- package/build/query/edit/inspector-controls/order-control.cjs +0 -1
- package/build/query/edit/inspector-controls/order-control.cjs.map +2 -2
- package/build/query/edit/inspector-controls/pages-control.cjs +0 -1
- package/build/query/edit/inspector-controls/pages-control.cjs.map +2 -2
- package/build/query/edit/inspector-controls/parent-control.cjs +0 -1
- package/build/query/edit/inspector-controls/parent-control.cjs.map +2 -2
- package/build/query/edit/inspector-controls/per-page-control.cjs +0 -1
- package/build/query/edit/inspector-controls/per-page-control.cjs.map +2 -2
- package/build/query/edit/inspector-controls/sticky-control.cjs +0 -1
- package/build/query/edit/inspector-controls/sticky-control.cjs.map +2 -2
- package/build/query/edit/inspector-controls/taxonomy-controls.cjs +1 -2
- package/build/query/edit/inspector-controls/taxonomy-controls.cjs.map +2 -2
- package/build/query/edit/query-content.cjs +10 -3
- package/build/query/edit/query-content.cjs.map +2 -2
- package/build/query/index.cjs +2 -1
- package/build/query/index.cjs.map +2 -2
- package/build/query-pagination/query-pagination-arrow-controls.cjs +0 -1
- package/build/query-pagination/query-pagination-arrow-controls.cjs.map +2 -2
- package/build/query-pagination-numbers/edit.cjs +0 -1
- package/build/query-pagination-numbers/edit.cjs.map +2 -2
- package/build/quote/block.json +3 -1
- package/build/quote/transforms.cjs +1 -7
- package/build/quote/transforms.cjs.map +2 -2
- package/build/rss/edit.cjs +0 -4
- package/build/rss/edit.cjs.map +2 -2
- package/build/search/edit.cjs +0 -4
- package/build/search/edit.cjs.map +2 -2
- package/build/separator/edit.cjs +1 -2
- package/build/separator/edit.cjs.map +2 -2
- package/build/site-logo/edit.cjs +34 -63
- package/build/site-logo/edit.cjs.map +3 -3
- package/build/social-links/edit.cjs +0 -1
- package/build/social-links/edit.cjs.map +2 -2
- package/build/spacer/controls.cjs +2 -4
- package/build/spacer/controls.cjs.map +2 -2
- package/build/spacer/edit.cjs +1 -2
- package/build/spacer/edit.cjs.map +2 -2
- package/build/tab-list/block.json +5 -4
- package/build/tab-list/edit.cjs +95 -54
- package/build/tab-list/edit.cjs.map +3 -3
- package/build/tab-list/save.cjs +4 -3
- package/build/tab-list/save.cjs.map +2 -2
- package/build/tab-panel/block.json +1 -6
- package/build/tab-panel/controls.cjs +2 -4
- package/build/tab-panel/controls.cjs.map +3 -3
- package/build/tab-panel/edit.cjs +15 -15
- package/build/tab-panel/edit.cjs.map +2 -2
- package/build/tab-panels/block.json +0 -1
- package/build/tab-panels/edit.cjs +2 -4
- package/build/tab-panels/edit.cjs.map +3 -3
- package/build/table-of-contents/edit.cjs +0 -1
- package/build/table-of-contents/edit.cjs.map +2 -2
- package/build/tabs/block.json +0 -5
- package/build/tabs/edit.cjs +6 -41
- package/build/tabs/edit.cjs.map +3 -3
- package/build/tabs/tab-toolbar-controls.cjs +74 -0
- package/build/tabs/tab-toolbar-controls.cjs.map +7 -0
- package/build/tabs/use-tab-actions.cjs +87 -0
- package/build/tabs/use-tab-actions.cjs.map +7 -0
- package/build/tabs/use-tab-list-items-sync.cjs +23 -5
- package/build/tabs/use-tab-list-items-sync.cjs.map +2 -2
- package/build/tag-cloud/edit.cjs +2 -6
- package/build/tag-cloud/edit.cjs.map +2 -2
- package/build/template-part/edit/advanced-controls.cjs +0 -1
- package/build/template-part/edit/advanced-controls.cjs.map +2 -2
- package/build/template-part/edit/import-controls.cjs +1 -2
- package/build/template-part/edit/import-controls.cjs.map +2 -2
- package/build/term-name/block.json +1 -3
- package/build/term-name/deprecated.cjs +105 -0
- package/build/term-name/deprecated.cjs.map +7 -0
- package/build/term-name/edit.cjs +11 -37
- package/build/term-name/edit.cjs.map +3 -3
- package/build/term-name/index.cjs +3 -1
- package/build/term-name/index.cjs.map +3 -3
- package/build/terms-query/edit/inspector-controls/include-control.cjs +0 -1
- package/build/terms-query/edit/inspector-controls/include-control.cjs.map +2 -2
- package/build/terms-query/edit/inspector-controls/inherit-control.cjs +0 -1
- package/build/terms-query/edit/inspector-controls/inherit-control.cjs.map +2 -2
- package/build/terms-query/edit/inspector-controls/max-terms-control.cjs +0 -1
- package/build/terms-query/edit/inspector-controls/max-terms-control.cjs.map +2 -2
- package/build/terms-query/edit/inspector-controls/order-control.cjs +0 -1
- package/build/terms-query/edit/inspector-controls/order-control.cjs.map +2 -2
- package/build/terms-query/edit/inspector-controls/taxonomy-control.cjs +0 -1
- package/build/terms-query/edit/inspector-controls/taxonomy-control.cjs.map +2 -2
- package/build/text-columns/edit.cjs +0 -1
- package/build/text-columns/edit.cjs.map +2 -2
- package/build/utils/waveform-player.cjs +138 -22
- package/build/utils/waveform-player.cjs.map +2 -2
- package/build/utils/waveform-utils.cjs +315 -17
- package/build/utils/waveform-utils.cjs.map +2 -2
- package/build/verse/block.json +3 -1
- package/build/video/block.json +6 -0
- package/build/video/edit-common-settings.cjs +0 -1
- package/build/video/edit-common-settings.cjs.map +2 -2
- package/build/video/edit.cjs +17 -1
- package/build/video/edit.cjs.map +2 -2
- package/build/video/index.cjs +2 -0
- package/build/video/index.cjs.map +3 -3
- package/build/video/save.cjs +7 -1
- package/build/video/save.cjs.map +2 -2
- package/build/video/tracks-editor.cjs +0 -1
- package/build/video/tracks-editor.cjs.map +2 -2
- package/build/video/variations.cjs +75 -0
- package/build/video/variations.cjs.map +7 -0
- package/build-module/accordion/block.json +1 -0
- package/build-module/accordion/edit.mjs +0 -1
- package/build-module/accordion/edit.mjs.map +2 -2
- package/build-module/accordion/view.mjs +23 -0
- package/build-module/accordion/view.mjs.map +2 -2
- package/build-module/accordion-heading/deprecated.mjs +121 -1
- package/build-module/accordion-heading/deprecated.mjs.map +2 -2
- package/build-module/accordion-heading/edit.mjs +8 -1
- package/build-module/accordion-heading/edit.mjs.map +2 -2
- package/build-module/accordion-heading/save.mjs +8 -1
- package/build-module/accordion-heading/save.mjs.map +2 -2
- package/build-module/accordion-panel/edit.mjs +1 -1
- package/build-module/accordion-panel/edit.mjs.map +2 -2
- package/build-module/archives/edit.mjs +0 -1
- package/build-module/archives/edit.mjs.map +2 -2
- package/build-module/audio/edit.mjs +0 -1
- package/build-module/audio/edit.mjs.map +2 -2
- package/build-module/avatar/edit.mjs +0 -1
- package/build-module/avatar/edit.mjs.map +2 -2
- package/build-module/avatar/user-control.mjs +0 -1
- package/build-module/avatar/user-control.mjs.map +2 -2
- package/build-module/button/edit.mjs +19 -14
- package/build-module/button/edit.mjs.map +2 -2
- package/build-module/categories/edit.mjs +0 -1
- package/build-module/categories/edit.mjs.map +2 -2
- package/build-module/code/transforms.mjs +6 -4
- package/build-module/code/transforms.mjs.map +2 -2
- package/build-module/column/edit.mjs +0 -1
- package/build-module/column/edit.mjs.map +2 -2
- package/build-module/columns/edit.mjs +0 -1
- package/build-module/columns/edit.mjs.map +2 -2
- package/build-module/columns/transforms.mjs +9 -2
- package/build-module/columns/transforms.mjs.map +2 -2
- package/build-module/comment-author-avatar/edit.mjs +0 -1
- package/build-module/comment-author-avatar/edit.mjs.map +2 -2
- package/build-module/comments-pagination/comments-pagination-arrow-controls.mjs +0 -1
- package/build-module/comments-pagination/comments-pagination-arrow-controls.mjs.map +2 -2
- package/build-module/cover/block.json +11 -0
- package/build-module/cover/edit/block-controls.mjs +11 -4
- package/build-module/cover/edit/block-controls.mjs.map +2 -2
- package/build-module/cover/edit/embed-video-url-input.mjs +5 -4
- package/build-module/cover/edit/embed-video-url-input.mjs.map +2 -2
- package/build-module/cover/edit/index.mjs +1 -1
- package/build-module/cover/edit/index.mjs.map +2 -2
- package/build-module/cover/edit/inspector-controls.mjs +1 -3
- package/build-module/cover/edit/inspector-controls.mjs.map +2 -2
- package/build-module/cover/embed-video-utils.mjs +16 -7
- package/build-module/cover/embed-video-utils.mjs.map +2 -2
- package/build-module/details/transforms.mjs +2 -2
- package/build-module/details/transforms.mjs.map +2 -2
- package/build-module/embed/edit.mjs +2 -3
- package/build-module/embed/edit.mjs.map +2 -2
- package/build-module/embed/embed-placeholder.mjs +20 -24
- package/build-module/embed/embed-placeholder.mjs.map +2 -2
- package/build-module/file/edit.mjs +4 -3
- package/build-module/file/edit.mjs.map +2 -2
- package/build-module/file/inspector.mjs +0 -2
- package/build-module/file/inspector.mjs.map +2 -2
- package/build-module/file/transforms.mjs +25 -60
- package/build-module/file/transforms.mjs.map +2 -2
- package/build-module/form/edit.mjs +0 -2
- package/build-module/form/edit.mjs.map +2 -2
- package/build-module/freeform/convert-to-blocks-button.mjs +31 -0
- package/build-module/freeform/convert-to-blocks-button.mjs.map +7 -0
- package/build-module/freeform/edit.mjs +15 -34
- package/build-module/freeform/edit.mjs.map +2 -2
- package/build-module/freeform/index.mjs +1 -7
- package/build-module/freeform/index.mjs.map +2 -2
- package/build-module/gallery/block.json +8 -3
- package/build-module/gallery/dynamic-gallery.mjs +253 -0
- package/build-module/gallery/dynamic-gallery.mjs.map +7 -0
- package/build-module/gallery/dynamic-source.mjs +55 -0
- package/build-module/gallery/dynamic-source.mjs.map +7 -0
- package/build-module/gallery/edit.mjs +291 -209
- package/build-module/gallery/edit.mjs.map +2 -2
- package/build-module/gallery/gallery.mjs +0 -3
- package/build-module/gallery/gallery.mjs.map +2 -2
- package/build-module/gallery/gap-styles.mjs +53 -14
- package/build-module/gallery/gap-styles.mjs.map +2 -2
- package/build-module/gallery/index.mjs +2 -0
- package/build-module/gallery/index.mjs.map +2 -2
- package/build-module/gallery/save.mjs +16 -12
- package/build-module/gallery/save.mjs.map +2 -2
- package/build-module/gallery/use-dynamic-gallery.mjs +167 -0
- package/build-module/gallery/use-dynamic-gallery.mjs.map +7 -0
- package/build-module/gallery/variations.mjs +33 -0
- package/build-module/gallery/variations.mjs.map +7 -0
- package/build-module/group/edit.mjs +1 -2
- package/build-module/group/edit.mjs.map +2 -2
- package/build-module/group/transforms.mjs +4 -8
- package/build-module/group/transforms.mjs.map +2 -2
- package/build-module/heading/edit.mjs +11 -4
- package/build-module/heading/edit.mjs.map +2 -2
- package/build-module/html/block.json +2 -2
- package/build-module/html/edit.mjs +69 -25
- package/build-module/html/edit.mjs.map +2 -2
- package/build-module/html/index.mjs +3 -3
- package/build-module/html/index.mjs.map +2 -2
- package/build-module/html/modal.mjs +4 -8
- package/build-module/html/modal.mjs.map +2 -2
- package/build-module/html/save.mjs +2 -4
- package/build-module/html/save.mjs.map +2 -2
- package/build-module/html/transforms.mjs +8 -6
- package/build-module/html/transforms.mjs.map +2 -2
- package/build-module/icon/components/custom-inserter/icon-grid.mjs +25 -12
- package/build-module/icon/components/custom-inserter/icon-grid.mjs.map +2 -2
- package/build-module/icon/components/custom-inserter/index.mjs +102 -33
- package/build-module/icon/components/custom-inserter/index.mjs.map +2 -2
- package/build-module/icon/edit.mjs +11 -12
- package/build-module/icon/edit.mjs.map +2 -2
- package/build-module/image/block.json +1 -1
- package/build-module/image/image.mjs +23 -71
- package/build-module/image/image.mjs.map +2 -2
- package/build-module/image/transforms.mjs +78 -0
- package/build-module/image/transforms.mjs.map +2 -2
- package/build-module/index.mjs +18 -8
- package/build-module/index.mjs.map +2 -2
- package/build-module/latest-comments/edit.mjs +0 -2
- package/build-module/latest-comments/edit.mjs.map +2 -2
- package/build-module/latest-posts/block.json +8 -9
- package/build-module/latest-posts/constants.mjs +0 -2
- package/build-module/latest-posts/constants.mjs.map +2 -2
- package/build-module/latest-posts/deprecated.mjs +100 -8
- package/build-module/latest-posts/deprecated.mjs.map +2 -2
- package/build-module/latest-posts/edit.mjs +67 -85
- package/build-module/latest-posts/edit.mjs.map +2 -2
- package/build-module/list/ordered-list-settings.mjs +0 -1
- package/build-module/list/ordered-list-settings.mjs.map +2 -2
- package/build-module/list-item/edit.mjs +1 -1
- package/build-module/list-item/edit.mjs.map +2 -2
- package/build-module/list-item/hooks/use-enter.mjs +15 -21
- package/build-module/list-item/hooks/use-enter.mjs.map +2 -2
- package/build-module/list-item/hooks/use-space.mjs +4 -6
- package/build-module/list-item/hooks/use-space.mjs.map +2 -2
- package/build-module/media-text/edit.mjs +0 -1
- package/build-module/media-text/edit.mjs.map +2 -2
- package/build-module/missing/edit.mjs +1 -3
- package/build-module/missing/edit.mjs.map +2 -2
- package/build-module/navigation/edit/index.mjs +0 -1
- package/build-module/navigation/edit/index.mjs.map +2 -2
- package/build-module/navigation/edit/overlay-menu-preview-controls.mjs +0 -1
- package/build-module/navigation/edit/overlay-menu-preview-controls.mjs.map +2 -2
- package/build-module/navigation/edit/overlay-menu-preview.mjs +0 -1
- package/build-module/navigation/edit/overlay-menu-preview.mjs.map +2 -2
- package/build-module/navigation/edit/overlay-template-part-selector.mjs +0 -1
- package/build-module/navigation/edit/overlay-template-part-selector.mjs.map +2 -2
- package/build-module/navigation/edit/overlay-visibility-control.mjs +0 -1
- package/build-module/navigation/edit/overlay-visibility-control.mjs.map +2 -2
- package/build-module/navigation-link/shared/use-link-preview.mjs +11 -1
- package/build-module/navigation-link/shared/use-link-preview.mjs.map +2 -2
- package/build-module/navigation-overlay-close/edit.mjs +0 -1
- package/build-module/navigation-overlay-close/edit.mjs.map +2 -2
- package/build-module/page-list/edit.mjs +0 -1
- package/build-module/page-list/edit.mjs.map +2 -2
- package/build-module/paragraph/block.json +1 -0
- package/build-module/paragraph/use-enter.mjs +4 -11
- package/build-module/paragraph/use-enter.mjs.map +2 -2
- package/build-module/playlist/block.json +28 -15
- package/build-module/playlist/context.mjs +11 -0
- package/build-module/playlist/context.mjs.map +7 -0
- package/build-module/playlist/edit.mjs +262 -84
- package/build-module/playlist/edit.mjs.map +2 -2
- package/build-module/playlist/index.mjs +1 -1
- package/build-module/playlist/index.mjs.map +2 -2
- package/build-module/playlist/utils.mjs +17 -7
- package/build-module/playlist/utils.mjs.map +2 -2
- package/build-module/playlist/view.mjs +93 -18
- package/build-module/playlist/view.mjs.map +2 -2
- package/build-module/playlist-track/block.json +4 -5
- package/build-module/playlist-track/edit.mjs +117 -72
- package/build-module/playlist-track/edit.mjs.map +2 -2
- package/build-module/post-author/edit.mjs +0 -2
- package/build-module/post-author/edit.mjs.map +2 -2
- package/build-module/post-content/block.json +1 -0
- package/build-module/post-excerpt/edit.mjs +0 -1
- package/build-module/post-excerpt/edit.mjs.map +2 -2
- package/build-module/post-featured-image/overlay-controls.mjs +1 -2
- package/build-module/post-featured-image/overlay-controls.mjs.map +2 -2
- package/build-module/post-navigation-link/edit.mjs +0 -2
- package/build-module/post-navigation-link/edit.mjs.map +2 -2
- package/build-module/post-template/block.json +2 -1
- package/build-module/post-template/edit.mjs +10 -1
- package/build-module/post-template/edit.mjs.map +2 -2
- package/build-module/pullquote/block.json +3 -1
- package/build-module/query/block.json +3 -2
- package/build-module/query/edit/inspector-controls/author-control.mjs +1 -2
- package/build-module/query/edit/inspector-controls/author-control.mjs.map +2 -2
- package/build-module/query/edit/inspector-controls/format-controls.mjs +1 -2
- package/build-module/query/edit/inspector-controls/format-controls.mjs.map +2 -2
- package/build-module/query/edit/inspector-controls/index.mjs +40 -8
- package/build-module/query/edit/inspector-controls/index.mjs.map +2 -2
- package/build-module/query/edit/inspector-controls/offset-controls.mjs +0 -1
- package/build-module/query/edit/inspector-controls/offset-controls.mjs.map +2 -2
- package/build-module/query/edit/inspector-controls/order-control.mjs +0 -1
- package/build-module/query/edit/inspector-controls/order-control.mjs.map +2 -2
- package/build-module/query/edit/inspector-controls/pages-control.mjs +0 -1
- package/build-module/query/edit/inspector-controls/pages-control.mjs.map +2 -2
- package/build-module/query/edit/inspector-controls/parent-control.mjs +0 -1
- package/build-module/query/edit/inspector-controls/parent-control.mjs.map +2 -2
- package/build-module/query/edit/inspector-controls/per-page-control.mjs +0 -1
- package/build-module/query/edit/inspector-controls/per-page-control.mjs.map +2 -2
- package/build-module/query/edit/inspector-controls/sticky-control.mjs +0 -1
- package/build-module/query/edit/inspector-controls/sticky-control.mjs.map +2 -2
- package/build-module/query/edit/inspector-controls/taxonomy-controls.mjs +1 -2
- package/build-module/query/edit/inspector-controls/taxonomy-controls.mjs.map +2 -2
- package/build-module/query/edit/query-content.mjs +10 -3
- package/build-module/query/edit/query-content.mjs.map +2 -2
- package/build-module/query/index.mjs +2 -1
- package/build-module/query/index.mjs.map +2 -2
- package/build-module/query-pagination/query-pagination-arrow-controls.mjs +0 -1
- package/build-module/query-pagination/query-pagination-arrow-controls.mjs.map +2 -2
- package/build-module/query-pagination-numbers/edit.mjs +0 -1
- package/build-module/query-pagination-numbers/edit.mjs.map +2 -2
- package/build-module/quote/block.json +3 -1
- package/build-module/quote/transforms.mjs +6 -8
- package/build-module/quote/transforms.mjs.map +2 -2
- package/build-module/rss/edit.mjs +0 -4
- package/build-module/rss/edit.mjs.map +2 -2
- package/build-module/search/edit.mjs +0 -4
- package/build-module/search/edit.mjs.map +2 -2
- package/build-module/separator/edit.mjs +1 -2
- package/build-module/separator/edit.mjs.map +2 -2
- package/build-module/site-logo/edit.mjs +34 -64
- package/build-module/site-logo/edit.mjs.map +2 -2
- package/build-module/social-links/edit.mjs +0 -1
- package/build-module/social-links/edit.mjs.map +2 -2
- package/build-module/spacer/controls.mjs +2 -4
- package/build-module/spacer/controls.mjs.map +2 -2
- package/build-module/spacer/edit.mjs +1 -2
- package/build-module/spacer/edit.mjs.map +2 -2
- package/build-module/tab-list/block.json +5 -4
- package/build-module/tab-list/edit.mjs +102 -56
- package/build-module/tab-list/edit.mjs.map +2 -2
- package/build-module/tab-list/save.mjs +5 -3
- package/build-module/tab-list/save.mjs.map +2 -2
- package/build-module/tab-panel/block.json +1 -6
- package/build-module/tab-panel/controls.mjs +2 -4
- package/build-module/tab-panel/controls.mjs.map +2 -2
- package/build-module/tab-panel/edit.mjs +16 -16
- package/build-module/tab-panel/edit.mjs.map +2 -2
- package/build-module/tab-panels/block.json +0 -1
- package/build-module/tab-panels/edit.mjs +2 -4
- package/build-module/tab-panels/edit.mjs.map +2 -2
- package/build-module/table-of-contents/edit.mjs +0 -1
- package/build-module/table-of-contents/edit.mjs.map +2 -2
- package/build-module/tabs/block.json +0 -5
- package/build-module/tabs/edit.mjs +7 -47
- package/build-module/tabs/edit.mjs.map +2 -2
- package/build-module/tabs/tab-toolbar-controls.mjs +46 -0
- package/build-module/tabs/tab-toolbar-controls.mjs.map +7 -0
- package/build-module/tabs/use-tab-actions.mjs +66 -0
- package/build-module/tabs/use-tab-actions.mjs.map +7 -0
- package/build-module/tabs/use-tab-list-items-sync.mjs +25 -7
- package/build-module/tabs/use-tab-list-items-sync.mjs.map +2 -2
- package/build-module/tag-cloud/edit.mjs +2 -6
- package/build-module/tag-cloud/edit.mjs.map +2 -2
- package/build-module/template-part/edit/advanced-controls.mjs +0 -1
- package/build-module/template-part/edit/advanced-controls.mjs.map +2 -2
- package/build-module/template-part/edit/import-controls.mjs +1 -2
- package/build-module/template-part/edit/import-controls.mjs.map +2 -2
- package/build-module/term-name/block.json +1 -3
- package/build-module/term-name/deprecated.mjs +74 -0
- package/build-module/term-name/deprecated.mjs.map +7 -0
- package/build-module/term-name/edit.mjs +11 -28
- package/build-module/term-name/edit.mjs.map +2 -2
- package/build-module/term-name/index.mjs +3 -1
- package/build-module/term-name/index.mjs.map +2 -2
- package/build-module/terms-query/edit/inspector-controls/include-control.mjs +0 -1
- package/build-module/terms-query/edit/inspector-controls/include-control.mjs.map +2 -2
- package/build-module/terms-query/edit/inspector-controls/inherit-control.mjs +0 -1
- package/build-module/terms-query/edit/inspector-controls/inherit-control.mjs.map +2 -2
- package/build-module/terms-query/edit/inspector-controls/max-terms-control.mjs +0 -1
- package/build-module/terms-query/edit/inspector-controls/max-terms-control.mjs.map +2 -2
- package/build-module/terms-query/edit/inspector-controls/order-control.mjs +0 -1
- package/build-module/terms-query/edit/inspector-controls/order-control.mjs.map +2 -2
- package/build-module/terms-query/edit/inspector-controls/taxonomy-control.mjs +0 -1
- package/build-module/terms-query/edit/inspector-controls/taxonomy-control.mjs.map +2 -2
- package/build-module/text-columns/edit.mjs +0 -1
- package/build-module/text-columns/edit.mjs.map +2 -2
- package/build-module/utils/waveform-player.mjs +144 -23
- package/build-module/utils/waveform-player.mjs.map +2 -2
- package/build-module/utils/waveform-utils.mjs +310 -16
- package/build-module/utils/waveform-utils.mjs.map +2 -2
- package/build-module/verse/block.json +3 -1
- package/build-module/video/block.json +6 -0
- package/build-module/video/edit-common-settings.mjs +0 -1
- package/build-module/video/edit-common-settings.mjs.map +2 -2
- package/build-module/video/edit.mjs +17 -1
- package/build-module/video/edit.mjs.map +2 -2
- package/build-module/video/index.mjs +2 -0
- package/build-module/video/index.mjs.map +2 -2
- package/build-module/video/save.mjs +7 -1
- package/build-module/video/save.mjs.map +2 -2
- package/build-module/video/tracks-editor.mjs +0 -1
- package/build-module/video/tracks-editor.mjs.map +2 -2
- package/build-module/video/variations.mjs +50 -0
- package/build-module/video/variations.mjs.map +7 -0
- package/build-style/accordion-panel/style-rtl.css +1 -2
- package/build-style/accordion-panel/style.css +1 -2
- package/build-style/audio/style-rtl.css +6 -0
- package/build-style/audio/style.css +6 -0
- package/build-style/audio/theme-rtl.css +6 -0
- package/build-style/audio/theme.css +6 -0
- package/build-style/columns/style-rtl.css +6 -0
- package/build-style/columns/style.css +6 -0
- package/build-style/common-rtl.css +6 -4
- package/build-style/common.css +6 -4
- package/build-style/editor-rtl.css +84 -24
- package/build-style/editor.css +84 -24
- package/build-style/embed/style-rtl.css +6 -0
- package/build-style/embed/style.css +6 -0
- package/build-style/embed/theme-rtl.css +6 -0
- package/build-style/embed/theme.css +6 -0
- package/build-style/freeform/editor-rtl.css +6 -0
- package/build-style/freeform/editor.css +6 -0
- package/build-style/gallery/editor-rtl.css +27 -3
- package/build-style/gallery/editor.css +27 -3
- package/build-style/gallery/style-rtl.css +6 -0
- package/build-style/gallery/style.css +6 -0
- package/build-style/gallery/theme-rtl.css +6 -0
- package/build-style/gallery/theme.css +6 -0
- package/build-style/html/editor-rtl.css +13 -0
- package/build-style/html/editor.css +13 -0
- package/build-style/icon/editor-rtl.css +80 -7
- package/build-style/icon/editor.css +80 -7
- package/build-style/image/editor-rtl.css +10 -0
- package/build-style/image/editor.css +10 -0
- package/build-style/image/style-rtl.css +6 -1
- package/build-style/image/style.css +6 -1
- package/build-style/image/theme-rtl.css +6 -0
- package/build-style/image/theme.css +6 -0
- package/build-style/latest-posts/style-rtl.css +26 -15
- package/build-style/latest-posts/style.css +26 -15
- package/build-style/more/editor-rtl.css +2 -2
- package/build-style/more/editor.css +2 -2
- package/build-style/navigation/editor-rtl.css +9 -4
- package/build-style/navigation/editor.css +9 -4
- package/build-style/navigation/style-rtl.css +6 -0
- package/build-style/navigation/style.css +6 -0
- package/build-style/navigation-link/editor-rtl.css +1 -1
- package/build-style/navigation-link/editor.css +1 -1
- package/build-style/navigation-submenu/editor-rtl.css +6 -0
- package/build-style/navigation-submenu/editor.css +6 -0
- package/build-style/nextpage/editor-rtl.css +2 -2
- package/build-style/nextpage/editor.css +2 -2
- package/build-style/page-list/editor-rtl.css +6 -0
- package/build-style/page-list/editor.css +6 -0
- package/build-style/playlist/editor-rtl.css +6 -0
- package/build-style/playlist/editor.css +6 -0
- package/build-style/playlist/style-rtl.css +158 -20
- package/build-style/playlist/style.css +158 -20
- package/build-style/playlist-track/style-rtl.css +10 -0
- package/build-style/playlist-track/style.css +10 -0
- package/build-style/post-template/style-rtl.css +6 -0
- package/build-style/post-template/style.css +6 -0
- package/build-style/query/editor-rtl.css +6 -0
- package/build-style/query/editor.css +6 -0
- package/build-style/rss/style-rtl.css +6 -0
- package/build-style/rss/style.css +6 -0
- package/build-style/shortcode/editor-rtl.css +6 -0
- package/build-style/shortcode/editor.css +6 -0
- package/build-style/style-rtl.css +192 -39
- package/build-style/style.css +192 -39
- package/build-style/table/editor-rtl.css +6 -0
- package/build-style/table/editor.css +6 -0
- package/build-style/table/theme-rtl.css +6 -0
- package/build-style/table/theme.css +6 -0
- package/build-style/template-part/editor-rtl.css +6 -0
- package/build-style/template-part/editor.css +6 -0
- package/build-style/theme-rtl.css +6 -0
- package/build-style/theme.css +6 -0
- package/build-style/video/editor-rtl.css +1 -1
- package/build-style/video/editor.css +1 -1
- package/build-style/video/style-rtl.css +6 -0
- package/build-style/video/style.css +6 -0
- package/build-style/video/theme-rtl.css +6 -0
- package/build-style/video/theme.css +6 -0
- package/build-types/table-of-contents/list.d.ts +1 -1
- package/build-types/table-of-contents/list.d.ts.map +1 -1
- package/package.json +48 -44
- package/src/accordion/README.md +2 -1
- package/src/accordion/block.json +1 -0
- package/src/accordion/edit.js +0 -1
- package/src/accordion/view.js +24 -0
- package/src/accordion-heading/README.md +1 -1
- package/src/accordion-heading/deprecated.js +122 -1
- package/src/accordion-heading/edit.js +12 -1
- package/src/accordion-heading/save.js +12 -1
- package/src/accordion-item/README.md +1 -1
- package/src/accordion-item/index.php +2 -1
- package/src/accordion-panel/edit.js +1 -1
- package/src/accordion-panel/style.scss +1 -4
- package/src/archives/edit.js +0 -1
- package/src/audio/edit.js +0 -1
- package/src/avatar/edit.js +0 -1
- package/src/avatar/user-control.js +0 -1
- package/src/button/edit.js +21 -15
- package/src/categories/edit.js +0 -1
- package/src/code/transforms.js +6 -4
- package/src/column/edit.js +0 -1
- package/src/columns/edit.js +0 -1
- package/src/columns/transforms.js +9 -2
- package/src/comment-author-avatar/edit.js +0 -1
- package/src/comments-pagination/comments-pagination-arrow-controls.js +0 -1
- package/src/common.scss +0 -4
- package/src/cover/README.md +60 -0
- package/src/cover/block.json +11 -0
- package/src/cover/edit/block-controls.js +21 -11
- package/src/cover/edit/embed-video-url-input.js +5 -4
- package/src/cover/edit/index.js +9 -11
- package/src/cover/edit/inspector-controls.js +0 -2
- package/src/cover/embed-video-utils.js +38 -13
- package/src/cover/test/edit.js +4 -4
- package/src/details/transforms.js +2 -2
- package/src/embed/edit.js +4 -5
- package/src/embed/embed-placeholder.js +16 -20
- package/src/file/edit.js +8 -8
- package/src/file/inspector.js +0 -2
- package/src/file/transforms.js +28 -60
- package/src/form/edit.js +0 -2
- package/src/freeform/convert-to-blocks-button.js +33 -0
- package/src/freeform/edit.js +11 -21
- package/src/freeform/index.js +1 -9
- package/src/gallery/README.md +4 -1
- package/src/gallery/block.json +8 -3
- package/src/gallery/dynamic-gallery.js +384 -0
- package/src/gallery/dynamic-source.js +117 -0
- package/src/gallery/edit.js +155 -49
- package/src/gallery/editor.scss +32 -4
- package/src/gallery/gallery.js +0 -7
- package/src/gallery/gap-styles.js +79 -20
- package/src/gallery/index.js +2 -0
- package/src/gallery/index.php +379 -42
- package/src/gallery/save.js +22 -11
- package/src/gallery/test/dynamic-source.js +90 -0
- package/src/gallery/use-dynamic-gallery.js +275 -0
- package/src/gallery/variations.js +37 -0
- package/src/group/edit.js +2 -3
- package/src/group/transforms.js +4 -8
- package/src/heading/edit.js +19 -14
- package/src/home-link/index.php +1 -1
- package/src/html/README.md +2 -1
- package/src/html/block.json +2 -2
- package/src/html/edit.js +86 -14
- package/src/html/editor.scss +10 -0
- package/src/html/index.js +3 -4
- package/src/html/modal.js +5 -9
- package/src/html/save.js +4 -7
- package/src/html/test/index.js +143 -0
- package/src/html/transforms.js +11 -6
- package/src/icon/components/custom-inserter/icon-grid.js +40 -11
- package/src/icon/components/custom-inserter/index.js +98 -25
- package/src/icon/edit.js +11 -17
- package/src/icon/editor.scss +33 -8
- package/src/icon/index.php +38 -45
- package/src/image/README.md +1 -1
- package/src/image/block.json +1 -1
- package/src/image/editor.scss +11 -0
- package/src/image/image.js +105 -169
- package/src/image/style.scss +0 -1
- package/src/image/test/use-open-image-media-editor-modal.js +19 -4
- package/src/image/transforms.js +128 -0
- package/src/index.js +19 -9
- package/src/latest-comments/edit.js +0 -2
- package/src/latest-posts/README.md +2 -2
- package/src/latest-posts/block.json +8 -9
- package/src/latest-posts/constants.js +0 -1
- package/src/latest-posts/deprecated.js +112 -9
- package/src/latest-posts/edit.js +38 -53
- package/src/latest-posts/index.php +60 -19
- package/src/latest-posts/style.scss +12 -2
- package/src/latest-posts/test/deprecated.js +153 -0
- package/src/list/ordered-list-settings.js +0 -1
- package/src/list-item/edit.js +1 -1
- package/src/list-item/hooks/use-enter.js +15 -22
- package/src/list-item/hooks/use-space.js +4 -6
- package/src/media-text/edit.js +0 -1
- package/src/media-text/editor.scss +1 -0
- package/src/missing/edit.js +1 -3
- package/src/more/editor.scss +1 -1
- package/src/navigation/edit/index.js +0 -1
- package/src/navigation/edit/overlay-menu-preview-controls.js +0 -1
- package/src/navigation/edit/overlay-menu-preview.js +0 -1
- package/src/navigation/edit/overlay-template-part-selector.js +0 -1
- package/src/navigation/edit/overlay-visibility-control.js +0 -1
- package/src/navigation/editor.scss +1 -2
- package/src/navigation-link/editor.scss +1 -1
- package/src/navigation-link/index.php +6 -3
- package/src/navigation-link/shared/test/controls.js +0 -4
- package/src/navigation-link/shared/test/use-entity-binding.js +8 -12
- package/src/navigation-link/shared/test/use-handle-link-change.test.js +0 -4
- package/src/navigation-link/shared/test/use-link-preview.test.js +17 -4
- package/src/navigation-link/shared/use-link-preview.js +24 -4
- package/src/navigation-overlay-close/edit.js +0 -1
- package/src/navigation-submenu/index.php +6 -3
- package/src/nextpage/editor.scss +1 -1
- package/src/page-list/edit.js +0 -1
- package/src/page-list/index.php +1 -1
- package/src/paragraph/README.md +1 -0
- package/src/paragraph/block.json +1 -0
- package/src/paragraph/use-enter.js +4 -11
- package/src/playlist/README.md +17 -20
- package/src/playlist/block.json +28 -15
- package/src/playlist/context.js +9 -0
- package/src/playlist/edit.js +298 -97
- package/src/playlist/editor.scss +6 -0
- package/src/playlist/index.js +1 -1
- package/src/playlist/index.php +91 -36
- package/src/playlist/style.scss +51 -6
- package/src/playlist/test/edit.js +13 -12
- package/src/playlist/utils.js +24 -12
- package/src/playlist/view.js +101 -20
- package/src/playlist-track/README.md +3 -5
- package/src/playlist-track/block.json +4 -5
- package/src/playlist-track/edit.js +116 -83
- package/src/playlist-track/index.php +24 -17
- package/src/playlist-track/style.scss +10 -0
- package/src/playlist-track/test/edit.js +169 -0
- package/src/post-author/edit.js +0 -2
- package/src/post-content/README.md +1 -0
- package/src/post-content/block.json +1 -0
- package/src/post-excerpt/edit.js +0 -1
- package/src/post-featured-image/overlay-controls.js +0 -1
- package/src/post-navigation-link/edit.js +0 -2
- package/src/post-template/README.md +1 -0
- package/src/post-template/block.json +2 -1
- package/src/post-template/edit.js +9 -0
- package/src/pullquote/README.md +1 -0
- package/src/pullquote/block.json +3 -1
- package/src/query/README.md +2 -1
- package/src/query/block.json +3 -2
- package/src/query/edit/inspector-controls/author-control.js +0 -1
- package/src/query/edit/inspector-controls/format-controls.js +0 -1
- package/src/query/edit/inspector-controls/index.js +43 -6
- package/src/query/edit/inspector-controls/offset-controls.js +0 -1
- package/src/query/edit/inspector-controls/order-control.js +0 -1
- package/src/query/edit/inspector-controls/pages-control.js +0 -1
- package/src/query/edit/inspector-controls/parent-control.js +0 -1
- package/src/query/edit/inspector-controls/per-page-control.js +0 -1
- package/src/query/edit/inspector-controls/sticky-control.js +0 -1
- package/src/query/edit/inspector-controls/taxonomy-controls.js +0 -1
- package/src/query/edit/query-content.js +19 -3
- package/src/query/index.js +1 -0
- package/src/query-pagination/query-pagination-arrow-controls.js +0 -1
- package/src/query-pagination-numbers/edit.js +0 -1
- package/src/quote/README.md +1 -0
- package/src/quote/block.json +3 -1
- package/src/quote/transforms.js +6 -8
- package/src/rss/edit.js +0 -4
- package/src/rss/index.php +1 -1
- package/src/search/edit.js +0 -4
- package/src/separator/edit.js +0 -1
- package/src/site-logo/edit.js +38 -78
- package/src/social-links/edit.js +0 -1
- package/src/spacer/controls.js +2 -4
- package/src/spacer/edit.js +2 -3
- package/src/tab-list/README.md +4 -5
- package/src/tab-list/block.json +5 -4
- package/src/tab-list/edit.js +133 -73
- package/src/tab-list/index.php +9 -4
- package/src/tab-list/save.js +5 -4
- package/src/tab-panel/README.md +4 -6
- package/src/tab-panel/block.json +1 -6
- package/src/tab-panel/controls.js +2 -4
- package/src/tab-panel/edit.js +19 -24
- package/src/tab-panels/README.md +5 -3
- package/src/tab-panels/block.json +0 -1
- package/src/tab-panels/edit.js +2 -4
- package/src/table-of-contents/edit.js +0 -1
- package/src/tabs/README.md +18 -9
- package/src/tabs/block.json +0 -5
- package/src/tabs/edit.js +8 -65
- package/src/tabs/tab-toolbar-controls.js +58 -0
- package/src/tabs/use-tab-actions.js +102 -0
- package/src/tabs/use-tab-list-items-sync.js +31 -12
- package/src/tag-cloud/edit.js +0 -4
- package/src/tag-cloud/index.php +1 -1
- package/src/template-part/edit/advanced-controls.js +0 -1
- package/src/template-part/edit/import-controls.js +0 -1
- package/src/template-part/index.php +1 -16
- package/src/term-name/README.md +1 -1
- package/src/term-name/block.json +1 -3
- package/src/term-name/deprecated.js +74 -0
- package/src/term-name/edit.js +2 -18
- package/src/term-name/index.js +2 -0
- package/src/terms-query/edit/inspector-controls/include-control.js +0 -1
- package/src/terms-query/edit/inspector-controls/inherit-control.js +0 -1
- package/src/terms-query/edit/inspector-controls/max-terms-control.js +0 -1
- package/src/terms-query/edit/inspector-controls/order-control.js +0 -1
- package/src/terms-query/edit/inspector-controls/taxonomy-control.js +0 -1
- package/src/text-columns/edit.js +0 -1
- package/src/utils/media-control.scss +1 -5
- package/src/utils/test/waveform-player.js +297 -38
- package/src/utils/test/waveform-utils.js +410 -9
- package/src/utils/waveform-player.js +189 -59
- package/src/utils/waveform-utils.js +443 -40
- package/src/verse/README.md +1 -0
- package/src/verse/block.json +3 -1
- package/src/video/README.md +2 -0
- package/src/video/block.json +6 -0
- package/src/video/edit-common-settings.js +0 -1
- package/src/video/edit.js +30 -1
- package/src/video/editor.scss +1 -1
- package/src/video/index.js +2 -0
- package/src/video/save.js +12 -0
- package/src/video/test/variations.js +65 -0
- package/src/video/tracks-editor.js +0 -1
- package/src/video/variations.js +65 -0
- package/build/freeform/migration-notice.cjs +0 -58
- package/build/freeform/migration-notice.cjs.map +0 -7
- package/build/tab-panel/add-tab-toolbar-control.cjs +0 -90
- package/build/tab-panel/add-tab-toolbar-control.cjs.map +0 -7
- package/build/tab-panel/remove-tab-toolbar-control.cjs +0 -99
- package/build/tab-panel/remove-tab-toolbar-control.cjs.map +0 -7
- package/build/tabs/controls.cjs +0 -45
- package/build/tabs/controls.cjs.map +0 -7
- package/build-module/freeform/migration-notice.mjs +0 -37
- package/build-module/freeform/migration-notice.mjs.map +0 -7
- package/build-module/tab-panel/add-tab-toolbar-control.mjs +0 -72
- package/build-module/tab-panel/add-tab-toolbar-control.mjs.map +0 -7
- package/build-module/tab-panel/remove-tab-toolbar-control.mjs +0 -81
- package/build-module/tab-panel/remove-tab-toolbar-control.mjs.map +0 -7
- package/build-module/tabs/controls.mjs +0 -14
- package/build-module/tabs/controls.mjs.map +0 -7
- package/src/freeform/migration-notice.js +0 -49
- package/src/tab-panel/add-tab-toolbar-control.js +0 -90
- package/src/tab-panel/remove-tab-toolbar-control.js +0 -110
- package/src/tabs/controls.js +0 -14
package/src/image/editor.scss
CHANGED
|
@@ -17,6 +17,15 @@ figure.wp-block-image:not(.wp-block) {
|
|
|
17
17
|
.wp-block-image {
|
|
18
18
|
position: relative;
|
|
19
19
|
|
|
20
|
+
// While uploading or processing client-side, hug the preview so the
|
|
21
|
+
// centered spinner lands on the image. A preview narrower than the content
|
|
22
|
+
// width (e.g. a small animated GIF being transcoded to a video) otherwise
|
|
23
|
+
// leaves the spinner off to one side. Wide and full alignments keep their
|
|
24
|
+
// own width.
|
|
25
|
+
&.is-transient:not(.alignwide):not(.alignfull) {
|
|
26
|
+
width: fit-content;
|
|
27
|
+
}
|
|
28
|
+
|
|
20
29
|
.is-applying img,
|
|
21
30
|
&.is-transient img {
|
|
22
31
|
opacity: 0.3;
|
|
@@ -120,6 +129,7 @@ figure.wp-block-image:not(.wp-block) {
|
|
|
120
129
|
width: 100%;
|
|
121
130
|
overflow: hidden;
|
|
122
131
|
|
|
132
|
+
// stylelint-disable selector-class-pattern -- react-easy-crop library class names.
|
|
123
133
|
.reactEasyCrop_Container {
|
|
124
134
|
// The linked Image block has `pointer-events: none` applied. Override it
|
|
125
135
|
// here to enable the crop action.
|
|
@@ -134,6 +144,7 @@ figure.wp-block-image:not(.wp-block) {
|
|
|
134
144
|
border-radius: 0; // Prevent's theme.json radius bleeding into cropper.
|
|
135
145
|
}
|
|
136
146
|
}
|
|
147
|
+
// stylelint-enable selector-class-pattern
|
|
137
148
|
}
|
|
138
149
|
|
|
139
150
|
.wp-block-image__crop-icon {
|
package/src/image/image.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { isBlobURL } from '@wordpress/blob';
|
|
5
4
|
import {
|
|
6
5
|
ExternalLink,
|
|
7
6
|
FocalPointPicker,
|
|
@@ -34,7 +33,6 @@ import {
|
|
|
34
33
|
MediaReplaceFlow,
|
|
35
34
|
store as blockEditorStore,
|
|
36
35
|
useSettings,
|
|
37
|
-
__experimentalImageEditor as ImageEditor,
|
|
38
36
|
__experimentalUseBorderProps as useBorderProps,
|
|
39
37
|
__experimentalGetShadowClassesAndStyles as getShadowClassesAndStyles,
|
|
40
38
|
privateApis as blockEditorPrivateApis,
|
|
@@ -84,6 +82,7 @@ const {
|
|
|
84
82
|
isDefaultBlockStyleState,
|
|
85
83
|
ResolutionTool,
|
|
86
84
|
mediaEditKey,
|
|
85
|
+
mediaSideloadFromUrlKey,
|
|
87
86
|
} = unlock( blockEditorPrivateApis );
|
|
88
87
|
|
|
89
88
|
const scaleOptions = [
|
|
@@ -416,8 +415,6 @@ export default function Image( {
|
|
|
416
415
|
{ loadedNaturalWidth, loadedNaturalHeight },
|
|
417
416
|
setLoadedNaturalSize,
|
|
418
417
|
] = useState( {} );
|
|
419
|
-
const [ isEditingImage, setIsEditingImage ] = useState( false );
|
|
420
|
-
const [ externalBlob, setExternalBlob ] = useState();
|
|
421
418
|
const [ hasImageErrored, setHasImageErrored ] = useState( false );
|
|
422
419
|
const hasNonContentControls = blockEditingMode === 'default';
|
|
423
420
|
const isContentOnlyMode = blockEditingMode === 'contentOnly';
|
|
@@ -464,31 +461,16 @@ export default function Image( {
|
|
|
464
461
|
__unstableMarkNextChangeAsNotPersistent,
|
|
465
462
|
] );
|
|
466
463
|
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
)
|
|
476
|
-
|
|
477
|
-
return;
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
if ( externalBlob ) {
|
|
481
|
-
return;
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
window
|
|
485
|
-
// Avoid cache, which seems to help avoid CORS problems.
|
|
486
|
-
.fetch( url.includes( '?' ) ? url : url + '?' )
|
|
487
|
-
.then( ( response ) => response.blob() )
|
|
488
|
-
.then( ( blob ) => setExternalBlob( blob ) )
|
|
489
|
-
// Do nothing, cannot upload.
|
|
490
|
-
.catch( () => {} );
|
|
491
|
-
}, [ id, url, isSingleSelected, externalBlob, getSettings ] );
|
|
464
|
+
/*
|
|
465
|
+
* Externally hosted images can be uploaded to the media library. The
|
|
466
|
+
* server sideloads the URL (see mediaSideloadFromUrl), so this works even
|
|
467
|
+
* when the editor is cross-origin isolated and the browser cannot read the
|
|
468
|
+
* cross-origin image's bytes itself.
|
|
469
|
+
*/
|
|
470
|
+
const canUploadExternalImage =
|
|
471
|
+
isSingleSelected &&
|
|
472
|
+
isExternalImage( id, url ) &&
|
|
473
|
+
!! getSettings()[ mediaSideloadFromUrlKey ];
|
|
492
474
|
|
|
493
475
|
// Get naturalWidth and naturalHeight from image, and fall back to loaded natural
|
|
494
476
|
// width and height. This resolves an issue in Safari where the loaded natural
|
|
@@ -605,43 +587,24 @@ export default function Image( {
|
|
|
605
587
|
}
|
|
606
588
|
|
|
607
589
|
function uploadExternal() {
|
|
608
|
-
const
|
|
609
|
-
if ( !
|
|
590
|
+
const mediaSideloadFromUrl = getSettings()[ mediaSideloadFromUrlKey ];
|
|
591
|
+
if ( ! mediaSideloadFromUrl ) {
|
|
610
592
|
return;
|
|
611
593
|
}
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
onFileChange( [ img ] ) {
|
|
594
|
+
mediaSideloadFromUrl( {
|
|
595
|
+
url,
|
|
596
|
+
onSuccess( img ) {
|
|
616
597
|
onSelectImage( img );
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
}
|
|
621
|
-
|
|
622
|
-
// With client-side media processing, onFileChange fires
|
|
623
|
-
// for each generated sub-size. Only show the notice once.
|
|
624
|
-
if ( ! notified ) {
|
|
625
|
-
notified = true;
|
|
626
|
-
setExternalBlob();
|
|
627
|
-
createSuccessNotice( __( 'Image uploaded.' ), {
|
|
628
|
-
type: 'snackbar',
|
|
629
|
-
} );
|
|
630
|
-
}
|
|
598
|
+
createSuccessNotice( __( 'Image uploaded.' ), {
|
|
599
|
+
type: 'snackbar',
|
|
600
|
+
} );
|
|
631
601
|
},
|
|
632
|
-
allowedTypes: ALLOWED_MEDIA_TYPES,
|
|
633
602
|
onError( message ) {
|
|
634
603
|
createErrorNotice( message, { type: 'snackbar' } );
|
|
635
604
|
},
|
|
636
605
|
} );
|
|
637
606
|
}
|
|
638
607
|
|
|
639
|
-
useEffect( () => {
|
|
640
|
-
if ( ! isSingleSelected ) {
|
|
641
|
-
setIsEditingImage( false );
|
|
642
|
-
}
|
|
643
|
-
}, [ isSingleSelected ] );
|
|
644
|
-
|
|
645
608
|
const canEditImage =
|
|
646
609
|
id &&
|
|
647
610
|
naturalWidth &&
|
|
@@ -651,7 +614,7 @@ export default function Image( {
|
|
|
651
614
|
const allowCrop =
|
|
652
615
|
isSingleSelected &&
|
|
653
616
|
canEditImage &&
|
|
654
|
-
|
|
617
|
+
!! openImageMediaEditorModal &&
|
|
655
618
|
! isContentOnlyMode &&
|
|
656
619
|
! isUploading;
|
|
657
620
|
|
|
@@ -663,8 +626,8 @@ export default function Image( {
|
|
|
663
626
|
}
|
|
664
627
|
|
|
665
628
|
// TODO: Can allow more units after figuring out how they should interact
|
|
666
|
-
// with the ResizableBox
|
|
667
|
-
//
|
|
629
|
+
// with the ResizableBox component. Calculations later on for that
|
|
630
|
+
// component are currently assuming px units.
|
|
668
631
|
const dimensionsUnitsOptions = useCustomUnits( {
|
|
669
632
|
availableUnits: [ 'px' ],
|
|
670
633
|
} );
|
|
@@ -881,7 +844,6 @@ export default function Image( {
|
|
|
881
844
|
|
|
882
845
|
const showUrlInput =
|
|
883
846
|
isSingleSelected &&
|
|
884
|
-
! isEditingImage &&
|
|
885
847
|
! lockHrefControls &&
|
|
886
848
|
! lockUrlControls &&
|
|
887
849
|
! isDecorative;
|
|
@@ -891,10 +853,9 @@ export default function Image( {
|
|
|
891
853
|
|
|
892
854
|
const showBlockControls = showUrlInput || allowCrop || showCoverControls;
|
|
893
855
|
|
|
894
|
-
const
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
// For contentOnly mode, put this button in its own area so it has borders around it.
|
|
856
|
+
const mediaControls = isSingleSelected && ! lockUrlControls && (
|
|
857
|
+
<>
|
|
858
|
+
{ /* For contentOnly mode, put this button in its own area so it has borders around it. */ }
|
|
898
859
|
<BlockControls group={ isContentOnlyMode ? 'inline' : 'other' }>
|
|
899
860
|
<MediaReplaceFlow
|
|
900
861
|
mediaId={ id }
|
|
@@ -908,7 +869,8 @@ export default function Image( {
|
|
|
908
869
|
variant="toolbar"
|
|
909
870
|
/>
|
|
910
871
|
</BlockControls>
|
|
911
|
-
|
|
872
|
+
</>
|
|
873
|
+
);
|
|
912
874
|
|
|
913
875
|
const hasDataFormBlockFields =
|
|
914
876
|
window?.__experimentalContentOnlyInspectorFields;
|
|
@@ -936,14 +898,8 @@ export default function Image( {
|
|
|
936
898
|
{ allowCrop && (
|
|
937
899
|
<ToolbarButton
|
|
938
900
|
ref={ cropButtonRef }
|
|
939
|
-
onClick={
|
|
940
|
-
|
|
941
|
-
? openImageMediaEditorModal
|
|
942
|
-
: () => setIsEditingImage( true )
|
|
943
|
-
}
|
|
944
|
-
aria-haspopup={
|
|
945
|
-
openImageMediaEditorModal ? 'dialog' : undefined
|
|
946
|
-
}
|
|
901
|
+
onClick={ openImageMediaEditorModal }
|
|
902
|
+
aria-haspopup="dialog"
|
|
947
903
|
icon={ crop }
|
|
948
904
|
label={ __( 'Crop' ) }
|
|
949
905
|
/>
|
|
@@ -957,7 +913,7 @@ export default function Image( {
|
|
|
957
913
|
) }
|
|
958
914
|
</BlockControls>
|
|
959
915
|
) }
|
|
960
|
-
{
|
|
916
|
+
{ canUploadExternalImage && (
|
|
961
917
|
<BlockControls>
|
|
962
918
|
<ToolbarGroup>
|
|
963
919
|
<ToolbarButton
|
|
@@ -1194,108 +1150,88 @@ export default function Image( {
|
|
|
1194
1150
|
|
|
1195
1151
|
const borderProps = useBorderProps( attributes );
|
|
1196
1152
|
const shadowProps = getShadowClassesAndStyles( attributes );
|
|
1197
|
-
const isRounded = attributes.className?.includes( 'is-style-rounded' );
|
|
1198
1153
|
|
|
1199
1154
|
const { postType, postId, queryId } = context;
|
|
1200
1155
|
const isDescendentOfQueryLoop = Number.isFinite( queryId );
|
|
1201
1156
|
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
width
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
id={ id }
|
|
1276
|
-
url={ url }
|
|
1277
|
-
{ ...pixelSize }
|
|
1278
|
-
naturalHeight={ naturalHeight }
|
|
1279
|
-
naturalWidth={ naturalWidth }
|
|
1280
|
-
onSaveImage={ ( imageAttributes ) =>
|
|
1281
|
-
setAttributes( imageAttributes )
|
|
1282
|
-
}
|
|
1283
|
-
onFinishEditing={ () => {
|
|
1284
|
-
setIsEditingImage( false );
|
|
1285
|
-
} }
|
|
1286
|
-
borderProps={ isRounded ? undefined : borderProps }
|
|
1287
|
-
/>
|
|
1288
|
-
</ImageWrapper>
|
|
1289
|
-
);
|
|
1290
|
-
} else {
|
|
1291
|
-
img = <ImageWrapper href={ href }>{ img }</ImageWrapper>;
|
|
1292
|
-
}
|
|
1157
|
+
const img = (
|
|
1158
|
+
<ImageWrapper href={ href }>
|
|
1159
|
+
{ temporaryURL && hasImageErrored ? (
|
|
1160
|
+
// Show a placeholder during upload when the blob URL can't be loaded. This can
|
|
1161
|
+
// happen when the user uploads a HEIC image in a browser that doesn't support them.
|
|
1162
|
+
<Placeholder
|
|
1163
|
+
className="wp-block-image__placeholder"
|
|
1164
|
+
withIllustration
|
|
1165
|
+
>
|
|
1166
|
+
<Spinner />
|
|
1167
|
+
</Placeholder>
|
|
1168
|
+
) : (
|
|
1169
|
+
<>
|
|
1170
|
+
<img
|
|
1171
|
+
src={ temporaryURL || url }
|
|
1172
|
+
alt={ defaultedAlt }
|
|
1173
|
+
onError={ onImageError }
|
|
1174
|
+
onLoad={ onImageLoad }
|
|
1175
|
+
ref={ setRefs }
|
|
1176
|
+
className={ borderProps.className }
|
|
1177
|
+
width={ naturalWidth }
|
|
1178
|
+
height={ naturalHeight }
|
|
1179
|
+
style={ {
|
|
1180
|
+
aspectRatio,
|
|
1181
|
+
...( resizeDelta
|
|
1182
|
+
? {
|
|
1183
|
+
width:
|
|
1184
|
+
pixelSize.width + resizeDelta.width,
|
|
1185
|
+
height:
|
|
1186
|
+
pixelSize.height +
|
|
1187
|
+
resizeDelta.height,
|
|
1188
|
+
}
|
|
1189
|
+
: ( () => {
|
|
1190
|
+
const style = {};
|
|
1191
|
+
if ( width === 'auto' ) {
|
|
1192
|
+
style.width = 'auto';
|
|
1193
|
+
} else if (
|
|
1194
|
+
width !== undefined &&
|
|
1195
|
+
width !== null
|
|
1196
|
+
) {
|
|
1197
|
+
style.width =
|
|
1198
|
+
typeof width === 'number'
|
|
1199
|
+
? `${ width }px`
|
|
1200
|
+
: width;
|
|
1201
|
+
}
|
|
1202
|
+
if (
|
|
1203
|
+
height === 'auto' ||
|
|
1204
|
+
height === undefined ||
|
|
1205
|
+
height === null
|
|
1206
|
+
) {
|
|
1207
|
+
style.height = 'auto';
|
|
1208
|
+
} else {
|
|
1209
|
+
style.height =
|
|
1210
|
+
typeof height === 'number'
|
|
1211
|
+
? `${ height }px`
|
|
1212
|
+
: height;
|
|
1213
|
+
}
|
|
1214
|
+
return style;
|
|
1215
|
+
} )() ),
|
|
1216
|
+
objectFit: scale,
|
|
1217
|
+
objectPosition:
|
|
1218
|
+
focalPoint && scale
|
|
1219
|
+
? mediaPosition( focalPoint )
|
|
1220
|
+
: undefined,
|
|
1221
|
+
...borderProps.style,
|
|
1222
|
+
...shadowProps.style,
|
|
1223
|
+
} }
|
|
1224
|
+
/>
|
|
1225
|
+
{ isUploading && <Spinner /> }
|
|
1226
|
+
</>
|
|
1227
|
+
) }
|
|
1228
|
+
</ImageWrapper>
|
|
1229
|
+
);
|
|
1293
1230
|
|
|
1294
1231
|
let resizableBox;
|
|
1295
1232
|
if (
|
|
1296
1233
|
isResizable &&
|
|
1297
1234
|
isSingleSelected &&
|
|
1298
|
-
! isEditingImage &&
|
|
1299
1235
|
! isUploading &&
|
|
1300
1236
|
! SIZED_LAYOUTS.includes( parentLayoutType )
|
|
1301
1237
|
) {
|
|
@@ -1420,7 +1356,7 @@ export default function Image( {
|
|
|
1420
1356
|
if ( ! url && ! temporaryURL ) {
|
|
1421
1357
|
return (
|
|
1422
1358
|
<>
|
|
1423
|
-
{
|
|
1359
|
+
{ mediaControls }
|
|
1424
1360
|
{ controls }
|
|
1425
1361
|
</>
|
|
1426
1362
|
);
|
|
@@ -1455,7 +1391,7 @@ export default function Image( {
|
|
|
1455
1391
|
|
|
1456
1392
|
return (
|
|
1457
1393
|
<>
|
|
1458
|
-
{
|
|
1394
|
+
{ mediaControls }
|
|
1459
1395
|
{ controls }
|
|
1460
1396
|
{ featuredImageControl }
|
|
1461
1397
|
{ img }
|
package/src/image/style.scss
CHANGED
|
@@ -117,7 +117,6 @@
|
|
|
117
117
|
|
|
118
118
|
// If a browser supports it, we will switch to using a circular SVG mask.
|
|
119
119
|
@supports (mask-image: none) or (-webkit-mask-image: none) {
|
|
120
|
-
/* stylelint-disable-next-line function-url-quotes -- We need quotes for the data URL to use the SVG inline. */
|
|
121
120
|
mask-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="50"/></svg>');
|
|
122
121
|
mask-mode: alpha;
|
|
123
122
|
mask-repeat: no-repeat;
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @jest-environment jsdom
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
1
|
/**
|
|
6
2
|
* External dependencies
|
|
7
3
|
*/
|
|
@@ -109,6 +105,25 @@ describe( 'useOpenImageMediaEditorModal', () => {
|
|
|
109
105
|
jest.clearAllMocks();
|
|
110
106
|
} );
|
|
111
107
|
|
|
108
|
+
it( 'returns no opener when the media editor modal setting is unavailable', () => {
|
|
109
|
+
useRegistry.mockReturnValue( createRegistry() );
|
|
110
|
+
mockMediaEditorModalSetting( undefined );
|
|
111
|
+
|
|
112
|
+
const { result } = renderHook( () =>
|
|
113
|
+
useOpenImageMediaEditorModal( {
|
|
114
|
+
attributes: {
|
|
115
|
+
id: 1,
|
|
116
|
+
url: 'original.jpg',
|
|
117
|
+
alt: '',
|
|
118
|
+
caption: '',
|
|
119
|
+
},
|
|
120
|
+
setAttributes: jest.fn(),
|
|
121
|
+
} )
|
|
122
|
+
);
|
|
123
|
+
|
|
124
|
+
expect( result.current ).toBeUndefined();
|
|
125
|
+
} );
|
|
126
|
+
|
|
112
127
|
it( 'passes an onClose handler for returning focus when the media editor closes', async () => {
|
|
113
128
|
const cropButton = document.createElement( 'button' );
|
|
114
129
|
const otherButton = document.createElement( 'button' );
|
package/src/image/transforms.js
CHANGED
|
@@ -3,6 +3,95 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { createBlobURL, isBlobURL } from '@wordpress/blob';
|
|
5
5
|
import { createBlock, getBlockAttributes } from '@wordpress/blocks';
|
|
6
|
+
import { select } from '@wordpress/data';
|
|
7
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Returns the subset of block attributes that should be carried over when
|
|
11
|
+
* converting an animated-GIF Image block into its converted Video block.
|
|
12
|
+
*
|
|
13
|
+
* The conversion swaps one block for another via `createBlock`, which would
|
|
14
|
+
* otherwise drop everything the author set on the original block. This carries
|
|
15
|
+
* the attributes both blocks support: block alignment, the HTML anchor, custom
|
|
16
|
+
* class names, and margin spacing.
|
|
17
|
+
*
|
|
18
|
+
* Image-only attributes such as links (`href`/`linkDestination`), sizing
|
|
19
|
+
* (`sizeSlug`/`scale`), and `border`/`shadow` styles are intentionally not
|
|
20
|
+
* carried: the Video block has no equivalent, so copying them would leave
|
|
21
|
+
* attributes the target block cannot represent.
|
|
22
|
+
*
|
|
23
|
+
* @param {Object} attributes Source block attributes.
|
|
24
|
+
* @return {Object} Attributes to spread into the converted block.
|
|
25
|
+
*/
|
|
26
|
+
function getCarriedGifConversionAttributes( attributes ) {
|
|
27
|
+
const { align, anchor, className, style } = attributes;
|
|
28
|
+
const margin = style?.spacing?.margin;
|
|
29
|
+
|
|
30
|
+
return {
|
|
31
|
+
...( align && { align } ),
|
|
32
|
+
...( anchor && { anchor } ),
|
|
33
|
+
...( className && { className } ),
|
|
34
|
+
...( margin && { style: { spacing: { margin } } } ),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Returns the sideloaded video companion of an animated GIF image attachment,
|
|
40
|
+
* or `null` when the media is not a converted animated GIF.
|
|
41
|
+
*
|
|
42
|
+
* An animated GIF uploaded through the editor gets a muted, looping video
|
|
43
|
+
* transcode sideloaded next to it and recorded (as basenames) in the
|
|
44
|
+
* attachment's `media_details.animated_video` / `animated_video_poster`.
|
|
45
|
+
*
|
|
46
|
+
* Block transforms match and run synchronously, so this reads the attachment
|
|
47
|
+
* record straight from the core-data store: it only returns the companion once
|
|
48
|
+
* the record is resolved. The Image block resolves the record while the block
|
|
49
|
+
* is selected, which is also when the block switcher can offer the transform.
|
|
50
|
+
*
|
|
51
|
+
* @param {number} id Image attachment ID.
|
|
52
|
+
* @param {string} url Image block URL, used to cheaply skip non-GIF media.
|
|
53
|
+
* @return {Object|null} Companion details (absolute `src`/`poster` URLs and
|
|
54
|
+
* the GIF's intrinsic `width`/`height`), or `null`.
|
|
55
|
+
*/
|
|
56
|
+
function getAnimatedGifVideoCompanion( id, url ) {
|
|
57
|
+
if ( ! id ) {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
/*
|
|
61
|
+
* Only animated GIFs have a video companion. Gate on the `.gif` extension
|
|
62
|
+
* so an ordinary image never reaches into the attachment record just to
|
|
63
|
+
* discover it has no companion. Strip any query string or fragment first
|
|
64
|
+
* so a URL like `cat.gif?ver=2` still matches.
|
|
65
|
+
*/
|
|
66
|
+
const urlPath = url?.split( /[?#]/ )[ 0 ];
|
|
67
|
+
if ( ! urlPath?.toLowerCase().endsWith( '.gif' ) ) {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
const record = select( coreStore ).getEntityRecord(
|
|
71
|
+
'postType',
|
|
72
|
+
'attachment',
|
|
73
|
+
id,
|
|
74
|
+
{ context: 'view' }
|
|
75
|
+
);
|
|
76
|
+
const details = record?.media_details;
|
|
77
|
+
if ( ! details?.animated_video || ! record?.source_url ) {
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
// Companion files are sideloaded next to the GIF, so they share its
|
|
81
|
+
// directory; build their URLs from the GIF's own source URL.
|
|
82
|
+
const dir = record.source_url.slice(
|
|
83
|
+
0,
|
|
84
|
+
record.source_url.lastIndexOf( '/' ) + 1
|
|
85
|
+
);
|
|
86
|
+
return {
|
|
87
|
+
src: dir + details.animated_video,
|
|
88
|
+
poster: details.animated_video_poster
|
|
89
|
+
? dir + details.animated_video_poster
|
|
90
|
+
: undefined,
|
|
91
|
+
width: details.width,
|
|
92
|
+
height: details.height,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
6
95
|
|
|
7
96
|
export function stripFirstImage( attributes, { shortcode } ) {
|
|
8
97
|
const { body } = document.implementation.createHTMLDocument( '' );
|
|
@@ -253,6 +342,45 @@ const transforms = {
|
|
|
253
342
|
},
|
|
254
343
|
},
|
|
255
344
|
],
|
|
345
|
+
to: [
|
|
346
|
+
{
|
|
347
|
+
// Offer converting an animated GIF into the Video block's "GIF"
|
|
348
|
+
// variation: a muted, looping, autoplaying video transcoded from
|
|
349
|
+
// the GIF and sideloaded next to it when it was uploaded. Only
|
|
350
|
+
// matches when that companion video exists, so ordinary images
|
|
351
|
+
// never see this transform.
|
|
352
|
+
type: 'block',
|
|
353
|
+
blocks: [ 'core/video' ],
|
|
354
|
+
isMatch: ( { id, url } ) =>
|
|
355
|
+
!! getAnimatedGifVideoCompanion( id, url ),
|
|
356
|
+
transform( attributes ) {
|
|
357
|
+
const { id, url, caption } = attributes;
|
|
358
|
+
const companion = getAnimatedGifVideoCompanion( id, url );
|
|
359
|
+
|
|
360
|
+
return createBlock( 'core/video', {
|
|
361
|
+
...getCarriedGifConversionAttributes( attributes ),
|
|
362
|
+
id,
|
|
363
|
+
src: companion.src,
|
|
364
|
+
poster: companion.poster,
|
|
365
|
+
caption,
|
|
366
|
+
controls: false,
|
|
367
|
+
loop: true,
|
|
368
|
+
autoplay: true,
|
|
369
|
+
muted: true,
|
|
370
|
+
playsInline: true,
|
|
371
|
+
/*
|
|
372
|
+
* Carry the GIF's intrinsic dimensions so the <video>
|
|
373
|
+
* keeps its aspect ratio from the first paint. Without
|
|
374
|
+
* them the element collapses to the browser-default size
|
|
375
|
+
* and then jumps once the poster/metadata load, which
|
|
376
|
+
* shows up as a brief duplicated image during the swap.
|
|
377
|
+
*/
|
|
378
|
+
width: companion.width,
|
|
379
|
+
height: companion.height,
|
|
380
|
+
} );
|
|
381
|
+
},
|
|
382
|
+
},
|
|
383
|
+
],
|
|
256
384
|
};
|
|
257
385
|
|
|
258
386
|
export default transforms;
|
package/src/index.js
CHANGED
|
@@ -197,6 +197,8 @@ const getAllBlocks = () => {
|
|
|
197
197
|
pageList,
|
|
198
198
|
pageListItem,
|
|
199
199
|
pattern,
|
|
200
|
+
playlist,
|
|
201
|
+
playlistTrack,
|
|
200
202
|
preformatted,
|
|
201
203
|
pullquote,
|
|
202
204
|
reusableBlock,
|
|
@@ -208,6 +210,10 @@ const getAllBlocks = () => {
|
|
|
208
210
|
socialLinks,
|
|
209
211
|
spacer,
|
|
210
212
|
table,
|
|
213
|
+
tabs,
|
|
214
|
+
tabList,
|
|
215
|
+
tabPanels,
|
|
216
|
+
tabPanel,
|
|
211
217
|
tagCloud,
|
|
212
218
|
textColumns,
|
|
213
219
|
verse,
|
|
@@ -281,16 +287,10 @@ const getAllBlocks = () => {
|
|
|
281
287
|
}
|
|
282
288
|
|
|
283
289
|
if ( window?.__experimentalEnableBlockExperiments ) {
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
blocks.push( tabPanel );
|
|
287
|
-
blocks.push( tabPanels );
|
|
288
|
-
blocks.push( playlist );
|
|
289
|
-
blocks.push( playlistTrack );
|
|
290
|
+
// Blocks added here are only registered when the "Block experiments"
|
|
291
|
+
// option is enabled in the Gutenberg > Experiments settings page.
|
|
290
292
|
}
|
|
291
293
|
|
|
292
|
-
// Always register the classic block. Inserter availability is controlled
|
|
293
|
-
// by the block's `supports.inserter` value in `freeform/init`.
|
|
294
294
|
blocks.push( classic );
|
|
295
295
|
|
|
296
296
|
return blocks.filter( Boolean );
|
|
@@ -345,13 +345,23 @@ export const registerCoreBlocks = (
|
|
|
345
345
|
...( ( bootstrappedBlockType?.apiVersion ?? 0 ) < 3 && {
|
|
346
346
|
apiVersion: 3,
|
|
347
347
|
} ),
|
|
348
|
+
// Always pass the postId context so the server-side render can
|
|
349
|
+
// reproduce the same output as the front end, while preserving
|
|
350
|
+
// any context declared in the block's PHP registration.
|
|
351
|
+
usesContext: Array.from(
|
|
352
|
+
new Set( [
|
|
353
|
+
...( bootstrappedBlockType?.usesContext ?? [] ),
|
|
354
|
+
'postId',
|
|
355
|
+
] )
|
|
356
|
+
),
|
|
348
357
|
// Inspector controls are rendered by the auto-register hook in block-editor
|
|
349
|
-
edit: function Edit( { attributes } ) {
|
|
358
|
+
edit: function Edit( { attributes, context } ) {
|
|
350
359
|
const disabledRef = useDisabled();
|
|
351
360
|
const blockProps = useBlockProps( { ref: disabledRef } );
|
|
352
361
|
const { content, status, error } = useServerSideRender( {
|
|
353
362
|
block: blockName,
|
|
354
363
|
attributes,
|
|
364
|
+
urlQueryArgs: { post_id: context?.postId },
|
|
355
365
|
} );
|
|
356
366
|
|
|
357
367
|
if ( status === 'loading' ) {
|