@wordpress/block-library 11.0.0 → 11.0.2-next.v.202609171837.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/README.md +7 -7
- package/build/archives/edit.cjs.map +3 -3
- package/build/audio/edit.cjs.map +3 -3
- package/build/avatar/hooks.cjs.map +2 -2
- package/build/button/edit.cjs.map +2 -2
- package/build/categories/edit.cjs.map +3 -3
- package/build/code/block.json +1 -0
- package/build/code/save.cjs.map +2 -2
- package/build/comment-template/hooks.cjs.map +2 -2
- package/build/cover/edit/index.cjs.map +2 -2
- package/build/cover/edit/inspector-controls.cjs.map +2 -2
- package/build/cover/transforms.cjs.map +2 -2
- package/build/details/block.json +1 -0
- package/build/details/index.cjs.map +2 -2
- package/build/embed/embed-controls.cjs.map +2 -2
- package/build/file/deprecated.cjs.map +2 -2
- package/build/file/edit.cjs.map +2 -2
- package/build/file/inspector.cjs.map +3 -3
- package/build/file/save.cjs.map +2 -2
- package/build/footnotes/block.json +1 -0
- package/build/footnotes/edit.cjs.map +2 -2
- package/build/gallery/dynamic-gallery.cjs.map +3 -3
- package/build/gallery/edit.cjs +64 -37
- package/build/gallery/edit.cjs.map +3 -3
- package/build/gallery/{flex-styles.cjs → gallery-styles.cjs} +31 -32
- package/build/gallery/gallery-styles.cjs.map +7 -0
- package/build/gallery/responsive-styles.cjs +27 -5
- package/build/gallery/responsive-styles.cjs.map +2 -2
- package/build/heading/block.json +2 -0
- package/build/heading/index.cjs.map +2 -2
- package/build/html/modal.cjs +3 -6
- package/build/html/modal.cjs.map +2 -2
- package/build/image/edit.cjs.map +2 -2
- package/build/image/image.cjs.map +2 -2
- package/build/index.cjs.map +2 -2
- package/build/latest-comments/edit.cjs.map +3 -3
- package/build/latest-posts/edit.cjs.map +2 -2
- package/build/list/ordered-list-settings.cjs.map +3 -3
- package/build/list-item/hooks/use-enter.cjs.map +2 -2
- package/build/math/block.json +2 -0
- package/build/math/deprecated.cjs +29 -12
- package/build/math/deprecated.cjs.map +2 -2
- package/build/math/edit.cjs +67 -46
- package/build/math/edit.cjs.map +2 -2
- package/build/math/save.cjs +2 -2
- package/build/math/save.cjs.map +2 -2
- package/build/media-text/constants.cjs +3 -0
- package/build/media-text/constants.cjs.map +2 -2
- package/build/media-text/deprecated.cjs.map +2 -2
- package/build/media-text/edit.cjs +40 -0
- package/build/media-text/edit.cjs.map +3 -3
- package/build/media-text/image-fill.cjs.map +2 -2
- package/build/media-text/media-container.cjs +3 -3
- package/build/media-text/media-container.cjs.map +2 -2
- package/build/navigation/edit/index.cjs.map +2 -2
- package/build/navigation/edit/menu-inspector-controls.cjs.map +2 -2
- package/build/navigation/edit/overlay-template-part-selector.cjs.map +3 -3
- package/build/navigation/edit/responsive-wrapper.cjs.map +2 -2
- package/build/navigation/edit/use-generate-default-navigation-title.cjs.map +2 -2
- package/build/navigation/view.cjs +2 -2
- package/build/navigation/view.cjs.map +2 -2
- package/build/navigation-link/edit.cjs.map +2 -2
- package/build/navigation-link/shared/invalid-draft-display.cjs.map +2 -2
- package/build/navigation-submenu/edit.cjs.map +2 -2
- package/build/paragraph/block.json +1 -0
- package/build/paragraph/edit.cjs.map +2 -2
- package/build/paragraph/index.cjs +6 -0
- package/build/paragraph/index.cjs.map +3 -3
- package/build/playlist/edit.cjs +2 -1
- package/build/playlist/edit.cjs.map +3 -3
- package/build/post-author/edit.cjs.map +3 -3
- package/build/post-author-name/edit.cjs.map +2 -2
- package/build/post-content/block.json +1 -0
- package/build/post-date/edit.cjs.map +2 -2
- package/build/post-excerpt/block.json +1 -0
- package/build/post-excerpt/edit.cjs.map +2 -2
- package/build/post-featured-image/edit.cjs.map +2 -2
- package/build/post-navigation-link/edit.cjs.map +3 -3
- package/build/post-time-to-read/edit.cjs.map +2 -2
- package/build/pullquote/deprecated.cjs.map +2 -2
- package/build/query/deprecated.cjs.map +2 -2
- package/build/query/edit/inspector-controls/index.cjs.map +3 -3
- package/build/query/edit/inspector-controls/order-control.cjs.map +3 -3
- package/build/query/edit/inspector-controls/sticky-control.cjs.map +3 -3
- package/build/query/view.cjs.map +2 -2
- package/build/query-title/use-archive-label.cjs.map +2 -2
- package/build/quote/deprecated.cjs.map +2 -2
- package/build/quote/transforms.cjs.map +2 -2
- package/build/search/edit.cjs.map +3 -3
- package/build/separator/edit.cjs.map +3 -3
- package/build/social-links/edit.cjs.map +3 -3
- package/build/table/state.cjs.map +2 -2
- package/build/table-of-contents/edit.cjs.map +3 -3
- package/build/table-of-contents/utils.cjs.map +2 -2
- package/build/tabs/use-tab-actions.cjs.map +2 -2
- package/build/tag-cloud/edit.cjs.map +3 -3
- package/build/template-part/edit/advanced-controls.cjs.map +3 -3
- package/build/template-part/edit/import-controls.cjs.map +3 -3
- package/build/template-part/edit/index.cjs.map +2 -2
- package/build/template-part/edit/inner-blocks.cjs.map +2 -2
- package/build/template-part/edit/placeholder.cjs.map +2 -2
- package/build/term-count/use-term-count.cjs.map +2 -2
- package/build/term-description/use-term-description.cjs.map +2 -2
- package/build/term-name/use-term-name.cjs.map +2 -2
- package/build/terms-query/edit/inspector-controls/index.cjs.map +2 -2
- package/build/terms-query/edit/inspector-controls/inherit-control.cjs.map +2 -2
- package/build/terms-query/edit/inspector-controls/order-control.cjs.map +3 -3
- package/build/terms-query/edit/inspector-controls/taxonomy-control.cjs.map +3 -3
- package/build/utils/hooks.cjs.map +2 -2
- package/build/utils/media-control.cjs +5 -1
- package/build/utils/media-control.cjs.map +2 -2
- package/build/utils/poster-image.cjs.map +2 -2
- package/build/verse/block.json +1 -0
- package/build/video/edit-common-settings.cjs.map +3 -3
- package/build/video/tracks-editor.cjs.map +3 -3
- package/build-module/archives/edit.mjs +2 -2
- package/build-module/archives/edit.mjs.map +2 -2
- package/build-module/audio/edit.mjs +2 -2
- package/build-module/audio/edit.mjs.map +2 -2
- package/build-module/avatar/hooks.mjs.map +2 -2
- package/build-module/button/edit.mjs.map +2 -2
- package/build-module/categories/edit.mjs +2 -2
- package/build-module/categories/edit.mjs.map +2 -2
- package/build-module/code/block.json +1 -0
- package/build-module/code/save.mjs.map +2 -2
- package/build-module/comment-template/hooks.mjs.map +2 -2
- package/build-module/cover/edit/index.mjs.map +2 -2
- package/build-module/cover/edit/inspector-controls.mjs.map +2 -2
- package/build-module/cover/transforms.mjs.map +2 -2
- package/build-module/details/block.json +1 -0
- package/build-module/details/index.mjs.map +2 -2
- package/build-module/embed/embed-controls.mjs.map +2 -2
- package/build-module/file/deprecated.mjs.map +2 -2
- package/build-module/file/edit.mjs.map +2 -2
- package/build-module/file/inspector.mjs +2 -2
- package/build-module/file/inspector.mjs.map +2 -2
- package/build-module/file/save.mjs.map +2 -2
- package/build-module/footnotes/block.json +1 -0
- package/build-module/footnotes/edit.mjs.map +2 -2
- package/build-module/gallery/dynamic-gallery.mjs +2 -2
- package/build-module/gallery/dynamic-gallery.mjs.map +2 -2
- package/build-module/gallery/edit.mjs +67 -40
- package/build-module/gallery/edit.mjs.map +2 -2
- package/build-module/gallery/{flex-styles.mjs → gallery-styles.mjs} +29 -30
- package/build-module/gallery/gallery-styles.mjs.map +7 -0
- package/build-module/gallery/responsive-styles.mjs +25 -4
- package/build-module/gallery/responsive-styles.mjs.map +2 -2
- package/build-module/heading/block.json +2 -0
- package/build-module/heading/index.mjs.map +2 -2
- package/build-module/html/modal.mjs +3 -6
- package/build-module/html/modal.mjs.map +2 -2
- package/build-module/image/edit.mjs.map +2 -2
- package/build-module/image/image.mjs.map +2 -2
- package/build-module/index.mjs.map +2 -2
- package/build-module/latest-comments/edit.mjs +2 -2
- package/build-module/latest-comments/edit.mjs.map +2 -2
- package/build-module/latest-posts/edit.mjs.map +2 -2
- package/build-module/list/ordered-list-settings.mjs +2 -2
- package/build-module/list/ordered-list-settings.mjs.map +2 -2
- package/build-module/list-item/hooks/use-enter.mjs.map +2 -2
- package/build-module/math/block.json +2 -0
- package/build-module/math/deprecated.mjs +29 -12
- package/build-module/math/deprecated.mjs.map +2 -2
- package/build-module/math/edit.mjs +68 -47
- package/build-module/math/edit.mjs.map +2 -2
- package/build-module/math/save.mjs +2 -2
- package/build-module/math/save.mjs.map +2 -2
- package/build-module/media-text/constants.mjs +2 -0
- package/build-module/media-text/constants.mjs.map +2 -2
- package/build-module/media-text/deprecated.mjs.map +2 -2
- package/build-module/media-text/edit.mjs +42 -1
- package/build-module/media-text/edit.mjs.map +2 -2
- package/build-module/media-text/image-fill.mjs.map +2 -2
- package/build-module/media-text/media-container.mjs +1 -1
- package/build-module/media-text/media-container.mjs.map +2 -2
- package/build-module/navigation/edit/index.mjs.map +2 -2
- package/build-module/navigation/edit/menu-inspector-controls.mjs.map +2 -2
- package/build-module/navigation/edit/overlay-template-part-selector.mjs +2 -2
- package/build-module/navigation/edit/overlay-template-part-selector.mjs.map +2 -2
- package/build-module/navigation/edit/responsive-wrapper.mjs.map +2 -2
- package/build-module/navigation/edit/use-generate-default-navigation-title.mjs.map +2 -2
- package/build-module/navigation/view.mjs +2 -2
- package/build-module/navigation/view.mjs.map +2 -2
- package/build-module/navigation-link/edit.mjs.map +2 -2
- package/build-module/navigation-link/shared/invalid-draft-display.mjs.map +2 -2
- package/build-module/navigation-submenu/edit.mjs.map +2 -2
- package/build-module/paragraph/block.json +1 -0
- package/build-module/paragraph/edit.mjs.map +2 -2
- package/build-module/paragraph/index.mjs +6 -0
- package/build-module/paragraph/index.mjs.map +2 -2
- package/build-module/playlist/edit.mjs +5 -4
- package/build-module/playlist/edit.mjs.map +2 -2
- package/build-module/post-author/edit.mjs +2 -2
- package/build-module/post-author/edit.mjs.map +2 -2
- package/build-module/post-author-name/edit.mjs.map +2 -2
- package/build-module/post-content/block.json +1 -0
- package/build-module/post-date/edit.mjs.map +2 -2
- package/build-module/post-excerpt/block.json +1 -0
- package/build-module/post-excerpt/edit.mjs.map +2 -2
- package/build-module/post-featured-image/edit.mjs.map +2 -2
- package/build-module/post-navigation-link/edit.mjs +2 -2
- package/build-module/post-navigation-link/edit.mjs.map +2 -2
- package/build-module/post-time-to-read/edit.mjs.map +2 -2
- package/build-module/pullquote/deprecated.mjs.map +2 -2
- package/build-module/query/deprecated.mjs.map +2 -2
- package/build-module/query/edit/inspector-controls/index.mjs +2 -2
- package/build-module/query/edit/inspector-controls/index.mjs.map +2 -2
- package/build-module/query/edit/inspector-controls/order-control.mjs +2 -2
- package/build-module/query/edit/inspector-controls/order-control.mjs.map +2 -2
- package/build-module/query/edit/inspector-controls/sticky-control.mjs +2 -2
- package/build-module/query/edit/inspector-controls/sticky-control.mjs.map +2 -2
- package/build-module/query/view.mjs.map +2 -2
- package/build-module/query-title/use-archive-label.mjs.map +2 -2
- package/build-module/quote/deprecated.mjs.map +2 -2
- package/build-module/quote/transforms.mjs.map +2 -2
- package/build-module/search/edit.mjs +3 -3
- package/build-module/search/edit.mjs.map +2 -2
- package/build-module/separator/edit.mjs +5 -2
- package/build-module/separator/edit.mjs.map +2 -2
- package/build-module/social-links/edit.mjs +2 -2
- package/build-module/social-links/edit.mjs.map +2 -2
- package/build-module/table/state.mjs.map +2 -2
- package/build-module/table-of-contents/edit.mjs +2 -2
- package/build-module/table-of-contents/edit.mjs.map +2 -2
- package/build-module/table-of-contents/utils.mjs.map +2 -2
- package/build-module/tabs/use-tab-actions.mjs.map +2 -2
- package/build-module/tag-cloud/edit.mjs +2 -2
- package/build-module/tag-cloud/edit.mjs.map +2 -2
- package/build-module/template-part/edit/advanced-controls.mjs +5 -2
- package/build-module/template-part/edit/advanced-controls.mjs.map +2 -2
- package/build-module/template-part/edit/import-controls.mjs +2 -2
- package/build-module/template-part/edit/import-controls.mjs.map +2 -2
- package/build-module/template-part/edit/index.mjs.map +2 -2
- package/build-module/template-part/edit/inner-blocks.mjs.map +2 -2
- package/build-module/template-part/edit/placeholder.mjs.map +2 -2
- package/build-module/term-count/use-term-count.mjs.map +2 -2
- package/build-module/term-description/use-term-description.mjs.map +2 -2
- package/build-module/term-name/use-term-name.mjs.map +2 -2
- package/build-module/terms-query/edit/inspector-controls/index.mjs.map +2 -2
- package/build-module/terms-query/edit/inspector-controls/inherit-control.mjs.map +2 -2
- package/build-module/terms-query/edit/inspector-controls/order-control.mjs +2 -2
- 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 +2 -2
- package/build-module/terms-query/edit/inspector-controls/taxonomy-control.mjs.map +2 -2
- package/build-module/utils/hooks.mjs.map +2 -2
- package/build-module/utils/media-control.mjs +5 -1
- package/build-module/utils/media-control.mjs.map +2 -2
- package/build-module/utils/poster-image.mjs.map +2 -2
- package/build-module/verse/block.json +1 -0
- package/build-module/video/edit-common-settings.mjs +2 -2
- package/build-module/video/edit-common-settings.mjs.map +2 -2
- package/build-module/video/tracks-editor.mjs +2 -2
- package/build-module/video/tracks-editor.mjs.map +2 -2
- package/build-style/button/style-rtl.css +2 -1
- package/build-style/button/style.css +2 -1
- package/build-style/columns/style-rtl.css +1 -1
- package/build-style/columns/style.css +1 -1
- package/build-style/comments/editor-rtl.css +1 -1
- package/build-style/comments/editor.css +1 -1
- package/build-style/comments/style-rtl.css +1 -1
- package/build-style/comments/style.css +1 -1
- package/build-style/common-rtl.css +1 -1
- package/build-style/common.css +1 -1
- package/build-style/cover/style-rtl.css +6 -0
- package/build-style/cover/style.css +6 -0
- package/build-style/editor-rtl.css +9 -5
- package/build-style/editor.css +9 -5
- package/build-style/embed/editor-rtl.css +2 -1
- package/build-style/embed/editor.css +2 -1
- package/build-style/gallery/style-rtl.css +1 -2
- package/build-style/gallery/style.css +1 -2
- package/build-style/image/style-rtl.css +6 -9
- package/build-style/image/style.css +6 -9
- package/build-style/math/editor-rtl.css +5 -0
- package/build-style/math/editor.css +5 -0
- package/build-style/navigation/editor-rtl.css +1 -0
- package/build-style/navigation/editor.css +1 -0
- package/build-style/navigation/style-rtl.css +1 -1
- package/build-style/navigation/style.css +1 -1
- package/build-style/post-title/style-rtl.css +2 -2
- package/build-style/post-title/style.css +2 -2
- package/build-style/query-pagination/editor-rtl.css +0 -3
- package/build-style/query-pagination/editor.css +0 -3
- package/build-style/search/theme-rtl.css +1 -1
- package/build-style/search/theme.css +1 -1
- package/build-style/style-rtl.css +23 -19
- package/build-style/style.css +23 -19
- package/build-style/theme-rtl.css +1 -1
- package/build-style/theme.css +1 -1
- package/build-style/verse/style-rtl.css +2 -1
- package/build-style/verse/style.css +2 -1
- package/package.json +40 -40
- package/src/archives/edit.jsx +2 -2
- package/src/audio/edit.jsx +2 -2
- package/src/avatar/hooks.js +2 -2
- package/src/button/edit.jsx +1 -1
- package/src/button/style.scss +2 -2
- package/src/calendar/index.php +1 -1
- package/src/categories/edit.jsx +2 -2
- package/src/code/README.md +1 -0
- package/src/code/block.json +1 -0
- package/src/code/save.jsx +1 -1
- package/src/columns/style.scss +2 -3
- package/src/comment-template/hooks.js +1 -1
- package/src/comments/style.scss +1 -1
- package/src/common.scss +1 -2
- package/src/cover/edit/index.jsx +2 -2
- package/src/cover/edit/inspector-controls.jsx +2 -2
- package/src/cover/style.scss +10 -0
- package/src/cover/test/{edit.jsdom.test.js → edit.browser.test.js} +104 -145
- package/src/cover/transforms.js +3 -3
- package/src/details/README.md +1 -0
- package/src/details/block.json +1 -0
- package/src/details/index.js +1 -1
- package/src/embed/editor.scss +2 -2
- package/src/embed/embed-controls.jsx +2 -2
- package/src/file/deprecated.jsx +3 -3
- package/src/file/edit.jsx +5 -3
- package/src/file/inspector.jsx +3 -3
- package/src/file/save.jsx +2 -2
- package/src/footnotes/README.md +1 -0
- package/src/footnotes/block.json +1 -0
- package/src/footnotes/edit.jsx +1 -1
- package/src/gallery/dynamic-gallery.jsx +4 -4
- package/src/gallery/edit.jsx +121 -68
- package/src/gallery/gallery-styles.js +117 -0
- package/src/gallery/index.php +181 -67
- package/src/gallery/responsive-styles.js +59 -5
- package/src/gallery/test/edit.jsdom.test.js +71 -3
- package/src/gallery/test/responsive-styles.js +59 -5
- package/src/heading/README.md +2 -0
- package/src/heading/block.json +2 -0
- package/src/heading/index.js +2 -2
- package/src/html/modal.jsx +0 -3
- package/src/image/edit.jsx +1 -1
- package/src/image/image.jsx +7 -7
- package/src/image/index.php +10 -4
- package/src/image/style.scss +1 -0
- package/src/image/test/use-open-image-media-editor-modal.jsdom.test.js +1 -1
- package/src/index.jsx +1 -1
- package/src/latest-comments/edit.jsx +2 -2
- package/src/latest-posts/edit.jsx +1 -1
- package/src/list/ordered-list-settings.jsx +2 -2
- package/src/list-item/hooks/use-enter.js +1 -1
- package/src/math/README.md +2 -2
- package/src/math/block.json +2 -0
- package/src/math/deprecated.jsx +38 -12
- package/src/math/edit.jsx +49 -20
- package/src/math/editor.scss +5 -0
- package/src/math/save.jsx +20 -4
- package/src/media-text/constants.js +1 -0
- package/src/media-text/deprecated.jsx +3 -3
- package/src/media-text/edit.jsx +48 -3
- package/src/media-text/image-fill.js +2 -2
- package/src/media-text/media-container.jsx +1 -1
- package/src/navigation/edit/index.jsx +1 -1
- package/src/navigation/edit/menu-inspector-controls.jsx +2 -2
- package/src/navigation/edit/overlay-template-part-selector.jsx +3 -3
- package/src/navigation/edit/responsive-wrapper.jsx +1 -1
- package/src/navigation/edit/use-generate-default-navigation-title.js +2 -2
- package/src/navigation/editor.scss +1 -0
- package/src/navigation/index.php +12 -0
- package/src/navigation/style.scss +1 -1
- package/src/navigation/test/use-navigation-menu.jsdom.test.js +6 -28
- package/src/navigation/test/view.jsdom.test.js +23 -0
- package/src/navigation/view.js +9 -6
- package/src/navigation-link/edit.jsx +1 -1
- package/src/navigation-link/shared/invalid-draft-display.jsx +2 -2
- package/src/navigation-link/test/__snapshots__/hooks.jsdom.test.js.snap +41 -11
- package/src/navigation-submenu/edit.jsx +1 -1
- package/src/paragraph/README.md +1 -0
- package/src/paragraph/block.json +1 -0
- package/src/paragraph/edit.jsx +1 -1
- package/src/paragraph/index.js +7 -0
- package/src/pattern/index.php +2 -2
- package/src/playlist/edit.jsx +6 -4
- package/src/playlist-track/test/edit.jsdom.test.jsx +2 -3
- package/src/post-author/edit.jsx +2 -2
- package/src/post-author-name/edit.jsx +1 -1
- package/src/post-content/README.md +1 -0
- package/src/post-content/block.json +1 -0
- package/src/post-date/edit.jsx +2 -2
- package/src/post-excerpt/README.md +1 -0
- package/src/post-excerpt/block.json +1 -0
- package/src/post-excerpt/edit.jsx +1 -1
- package/src/post-featured-image/edit.jsx +2 -2
- package/src/post-navigation-link/edit.jsx +4 -4
- package/src/post-time-to-read/edit.jsx +2 -2
- package/src/post-title/style.scss +2 -3
- package/src/pullquote/deprecated.jsx +1 -1
- package/src/query/deprecated.jsx +1 -1
- package/src/query/edit/inspector-controls/index.jsx +4 -4
- package/src/query/edit/inspector-controls/order-control.jsx +2 -2
- package/src/query/edit/inspector-controls/sticky-control.jsx +2 -2
- package/src/query/view.js +6 -9
- package/src/query-pagination/editor.scss +0 -3
- package/src/query-title/use-archive-label.js +1 -1
- package/src/quote/deprecated.jsx +2 -2
- package/src/quote/transforms.js +3 -3
- package/src/search/edit.jsx +6 -6
- package/src/search/theme.scss +1 -1
- package/src/separator/edit.jsx +7 -4
- package/src/social-links/edit.jsx +2 -2
- package/src/table/state.js +1 -1
- package/src/table-of-contents/edit.jsx +6 -6
- package/src/table-of-contents/utils.ts +2 -2
- package/src/tabs/use-tab-actions.js +1 -1
- package/src/tag-cloud/edit.jsx +2 -2
- package/src/template-part/edit/advanced-controls.jsx +5 -2
- package/src/template-part/edit/import-controls.jsx +2 -2
- package/src/template-part/edit/index.jsx +2 -2
- package/src/template-part/edit/inner-blocks.jsx +1 -1
- package/src/template-part/edit/placeholder.jsx +2 -2
- package/src/term-count/use-term-count.js +1 -1
- package/src/term-description/use-term-description.js +1 -1
- package/src/term-name/use-term-name.js +1 -1
- package/src/terms-query/edit/inspector-controls/index.jsx +2 -2
- package/src/terms-query/edit/inspector-controls/inherit-control.jsx +1 -1
- package/src/terms-query/edit/inspector-controls/order-control.jsx +2 -2
- package/src/terms-query/edit/inspector-controls/taxonomy-control.jsx +2 -2
- package/src/utils/hooks.js +1 -1
- package/src/utils/media-control.jsx +16 -10
- package/src/utils/poster-image.jsx +2 -2
- package/src/utils/test/waveform-player.jsdom.test.jsx +36 -38
- package/src/utils/test/{waveform-utils.jsdom.test.js → waveform-utils.browser.test.js} +64 -44
- package/src/verse/README.md +1 -0
- package/src/verse/block.json +1 -0
- package/src/verse/style.scss +2 -2
- package/src/video/edit-common-settings.jsx +3 -3
- package/src/video/tracks-editor.jsx +2 -2
- package/build/gallery/flex-styles.cjs.map +0 -7
- package/build-module/gallery/flex-styles.mjs.map +0 -7
- package/src/gallery/flex-styles.js +0 -99
package/src/image/edit.jsx
CHANGED
package/src/image/image.jsx
CHANGED
|
@@ -331,7 +331,7 @@ export default function Image( {
|
|
|
331
331
|
'attachment',
|
|
332
332
|
id,
|
|
333
333
|
{ context: 'view' }
|
|
334
|
-
|
|
334
|
+
)
|
|
335
335
|
: null;
|
|
336
336
|
|
|
337
337
|
// Check if the attachment resolution failed with a specific error.
|
|
@@ -348,7 +348,7 @@ export default function Image( {
|
|
|
348
348
|
id,
|
|
349
349
|
{ context: 'view' },
|
|
350
350
|
]
|
|
351
|
-
|
|
351
|
+
)
|
|
352
352
|
: null;
|
|
353
353
|
|
|
354
354
|
return {
|
|
@@ -837,7 +837,7 @@ export default function Image( {
|
|
|
837
837
|
/* translators: %s: Label of the bindings source. */
|
|
838
838
|
__( 'Connected to %s' ),
|
|
839
839
|
altBindingSource.label
|
|
840
|
-
|
|
840
|
+
)
|
|
841
841
|
: __( 'Connected to dynamic data' ),
|
|
842
842
|
lockTitleControls:
|
|
843
843
|
!! titleBinding &&
|
|
@@ -851,7 +851,7 @@ export default function Image( {
|
|
|
851
851
|
/* translators: %s: Label of the bindings source. */
|
|
852
852
|
__( 'Connected to %s' ),
|
|
853
853
|
titleBindingSource.label
|
|
854
|
-
|
|
854
|
+
)
|
|
855
855
|
: __( 'Connected to dynamic data' ),
|
|
856
856
|
};
|
|
857
857
|
},
|
|
@@ -1156,7 +1156,7 @@ export default function Image( {
|
|
|
1156
1156
|
'This image has been marked as decorative; its file name is %s'
|
|
1157
1157
|
),
|
|
1158
1158
|
filename
|
|
1159
|
-
|
|
1159
|
+
)
|
|
1160
1160
|
: __( 'This image has been marked as decorative.' );
|
|
1161
1161
|
} else if ( alt ) {
|
|
1162
1162
|
defaultedAlt = alt;
|
|
@@ -1209,7 +1209,7 @@ export default function Image( {
|
|
|
1209
1209
|
height:
|
|
1210
1210
|
pixelSize.height +
|
|
1211
1211
|
resizeDelta.height,
|
|
1212
|
-
|
|
1212
|
+
}
|
|
1213
1213
|
: ( () => {
|
|
1214
1214
|
const style = {};
|
|
1215
1215
|
if ( width === 'auto' ) {
|
|
@@ -1242,7 +1242,7 @@ export default function Image( {
|
|
|
1242
1242
|
style.height = 'auto';
|
|
1243
1243
|
}
|
|
1244
1244
|
return style;
|
|
1245
|
-
|
|
1245
|
+
} )() ),
|
|
1246
1246
|
objectFit: scale,
|
|
1247
1247
|
objectPosition:
|
|
1248
1248
|
focalPoint && scale
|
package/src/image/index.php
CHANGED
|
@@ -290,12 +290,12 @@ function block_core_image_render_lightbox( $block_content, array $block, WP_Bloc
|
|
|
290
290
|
$body_content = $processor->get_updated_html();
|
|
291
291
|
|
|
292
292
|
// Adds a button alongside image in the body content.
|
|
293
|
+
// Extract the img tag using preg_match for structured access.
|
|
293
294
|
$img = null;
|
|
294
295
|
preg_match( '/<img[^>]+>/', $body_content, $img );
|
|
295
296
|
|
|
296
|
-
$
|
|
297
|
-
$
|
|
298
|
-
. '<button
|
|
297
|
+
if ( isset( $img[0] ) ) {
|
|
298
|
+
$button_html = '<button
|
|
299
299
|
class="lightbox-trigger"
|
|
300
300
|
type="button"
|
|
301
301
|
aria-haspopup="dialog"
|
|
@@ -310,7 +310,13 @@ function block_core_image_render_lightbox( $block_content, array $block, WP_Bloc
|
|
|
310
310
|
</svg>
|
|
311
311
|
</button>';
|
|
312
312
|
|
|
313
|
-
|
|
313
|
+
// Build the replacement: img tag + button.
|
|
314
|
+
// Use str_replace for literal replacement instead of preg_replace to avoid
|
|
315
|
+
// PCRE backreference interpretation of $ and \ sequences in user-controlled
|
|
316
|
+
// image attributes (e.g., alt="Just $5 today").
|
|
317
|
+
$button = $img[0] . $button_html;
|
|
318
|
+
$body_content = str_replace( $img[0], $button, $body_content );
|
|
319
|
+
}
|
|
314
320
|
|
|
315
321
|
add_action( 'wp_footer', 'block_core_image_print_lightbox_overlay' );
|
|
316
322
|
|
package/src/image/style.scss
CHANGED
|
@@ -649,7 +649,7 @@ describe( 'useOpenImageMediaEditorModal', () => {
|
|
|
649
649
|
id: 2,
|
|
650
650
|
alt_text: 'Updated alt',
|
|
651
651
|
caption: { raw: '' },
|
|
652
|
-
|
|
652
|
+
},
|
|
653
653
|
resolveGetEntityRecord: ( kind, name, attachmentId ) =>
|
|
654
654
|
attachmentId === 2 ? updatedAttachment : undefined,
|
|
655
655
|
},
|
package/src/index.jsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { InspectorControls, useBlockProps } from '@wordpress/block-editor';
|
|
2
2
|
import {
|
|
3
3
|
RangeControl,
|
|
4
|
-
SelectControl,
|
|
4
|
+
SelectControl as WCSelectControl,
|
|
5
5
|
Spinner,
|
|
6
6
|
ToggleControl,
|
|
7
7
|
__experimentalToolsPanel as ToolsPanel,
|
|
@@ -106,7 +106,7 @@ export default function LatestComments( { attributes, setAttributes, name } ) {
|
|
|
106
106
|
}
|
|
107
107
|
isShownByDefault
|
|
108
108
|
>
|
|
109
|
-
<
|
|
109
|
+
<WCSelectControl
|
|
110
110
|
label={ __( 'Display content' ) }
|
|
111
111
|
value={ displayContent }
|
|
112
112
|
options={ [
|
|
@@ -3,7 +3,7 @@ import { InspectorControls } from '@wordpress/block-editor';
|
|
|
3
3
|
import {
|
|
4
4
|
TextControl,
|
|
5
5
|
ToggleControl,
|
|
6
|
-
SelectControl,
|
|
6
|
+
SelectControl as WCSelectControl,
|
|
7
7
|
__experimentalToolsPanel as ToolsPanel,
|
|
8
8
|
__experimentalToolsPanelItem as ToolsPanelItem,
|
|
9
9
|
} from '@wordpress/components';
|
|
@@ -58,7 +58,7 @@ const OrderedListSettings = ( { setAttributes, reversed, start, type } ) => {
|
|
|
58
58
|
} )
|
|
59
59
|
}
|
|
60
60
|
>
|
|
61
|
-
<
|
|
61
|
+
<WCSelectControl
|
|
62
62
|
label={ __( 'List style' ) }
|
|
63
63
|
options={ LIST_STYLE_OPTIONS }
|
|
64
64
|
value={ type || 'decimal' }
|
package/src/math/README.md
CHANGED
|
@@ -15,7 +15,7 @@ _Defined via the [`attributes`](https://developer.wordpress.org/block-editor/ref
|
|
|
15
15
|
|
|
16
16
|
| Attribute | [Type](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-attributes/#type-validation) | [Default](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-attributes/#default-value) | Description |
|
|
17
17
|
|-----------|------|---------|-------------|
|
|
18
|
-
| `latex` | `string` | — | [Role](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-attributes/#role): `content` |
|
|
18
|
+
| `latex` | `string` | — | [Source](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-attributes/#value-source): `text`. [Selector](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-attributes/#value-source): `math annotation[encoding="application/x-tex"]`. [Role](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-attributes/#role): `content` |
|
|
19
19
|
| `mathML` | `string` | — | [Source](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-attributes/#value-source): `html`. [Selector](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-attributes/#value-source): `math` |
|
|
20
20
|
|
|
21
21
|
## Supports
|
|
@@ -39,7 +39,7 @@ _Defined via the [`supports`](https://developer.wordpress.org/block-editor/refer
|
|
|
39
39
|
This is a [**static block**](https://developer.wordpress.org/block-editor/getting-started/fundamentals/static-dynamic-rendering/). The markup is saved directly in the post content.
|
|
40
40
|
|
|
41
41
|
```html
|
|
42
|
-
<!-- wp:math
|
|
42
|
+
<!-- wp:math -->
|
|
43
43
|
<div class="wp-block-math"><math display="block"><semantics><mrow><mi>x</mi><mo>=</mo><mfrac><mrow><mo lspace="0em" rspace="0em">−</mo><mi>b</mi><mo>±</mo><msqrt><mrow><msup><mi>b</mi><mn>2</mn></msup><mo>−</mo><mn>4</mn><mi>a</mi><mi>c</mi></mrow></msqrt></mrow><mrow><mn>2</mn><mi>a</mi></mrow></mfrac></mrow><annotation encoding="application/x-tex">x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}</annotation></semantics></math></div>
|
|
44
44
|
<!-- /wp:math -->
|
|
45
45
|
```
|
package/src/math/block.json
CHANGED
package/src/math/deprecated.jsx
CHANGED
|
@@ -1,18 +1,44 @@
|
|
|
1
1
|
import { useBlockProps } from '@wordpress/block-editor';
|
|
2
2
|
|
|
3
|
+
// Earlier versions stored the LaTeX source in the block comment. Content that
|
|
4
|
+
// could not be rendered was saved with an empty `<math>`, so the source is
|
|
5
|
+
// only available from the comment attribute for such blocks.
|
|
6
|
+
const legacyAttributes = {
|
|
7
|
+
latex: {
|
|
8
|
+
type: 'string',
|
|
9
|
+
role: 'content',
|
|
10
|
+
},
|
|
11
|
+
mathML: {
|
|
12
|
+
type: 'string',
|
|
13
|
+
source: 'html',
|
|
14
|
+
selector: 'math',
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
// v2: The LaTeX source was stored in the block comment.
|
|
19
|
+
const v2 = {
|
|
20
|
+
attributes: legacyAttributes,
|
|
21
|
+
save( { attributes } ) {
|
|
22
|
+
const { latex, mathML } = attributes;
|
|
23
|
+
|
|
24
|
+
if ( ! latex ) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<div { ...useBlockProps.save() }>
|
|
30
|
+
<math
|
|
31
|
+
display="block"
|
|
32
|
+
dangerouslySetInnerHTML={ { __html: mathML } }
|
|
33
|
+
/>
|
|
34
|
+
</div>
|
|
35
|
+
);
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
|
|
3
39
|
// v1: Add a wrapper div around the math element.
|
|
4
40
|
const v1 = {
|
|
5
|
-
attributes:
|
|
6
|
-
latex: {
|
|
7
|
-
type: 'string',
|
|
8
|
-
role: 'content',
|
|
9
|
-
},
|
|
10
|
-
mathML: {
|
|
11
|
-
type: 'string',
|
|
12
|
-
source: 'html',
|
|
13
|
-
selector: 'math',
|
|
14
|
-
},
|
|
15
|
-
},
|
|
41
|
+
attributes: legacyAttributes,
|
|
16
42
|
save( { attributes } ) {
|
|
17
43
|
const { latex, mathML } = attributes;
|
|
18
44
|
|
|
@@ -38,4 +64,4 @@ const v1 = {
|
|
|
38
64
|
*
|
|
39
65
|
* See block-deprecation.md
|
|
40
66
|
*/
|
|
41
|
-
export default [ v1 ];
|
|
67
|
+
export default [ v2, v1 ];
|
package/src/math/edit.jsx
CHANGED
|
@@ -4,37 +4,43 @@ import {
|
|
|
4
4
|
store as blockEditorStore,
|
|
5
5
|
} from '@wordpress/block-editor';
|
|
6
6
|
import { Popover } from '@wordpress/components';
|
|
7
|
-
import { ValidatedTextareaControl } from '@wordpress/ui';
|
|
7
|
+
import { ValidatedTextareaControl, Link } from '@wordpress/ui';
|
|
8
8
|
import { useState, useEffect, useRef } from '@wordpress/element';
|
|
9
9
|
import { useDispatch } from '@wordpress/data';
|
|
10
|
+
import { useEvent } from '@wordpress/compose';
|
|
10
11
|
|
|
11
12
|
export default function MathEdit( { attributes, setAttributes, isSelected } ) {
|
|
12
13
|
const { latex, mathML } = attributes;
|
|
13
14
|
const [ blockRef, setBlockRef ] = useState();
|
|
14
15
|
const [ error, setError ] = useState( null );
|
|
15
16
|
const [ latexToMathML, setLatexToMathML ] = useState();
|
|
16
|
-
const initialLatex = useRef( latex );
|
|
17
17
|
const formRef = useRef();
|
|
18
18
|
const { __unstableMarkNextChangeAsNotPersistent } =
|
|
19
19
|
useDispatch( blockEditorStore );
|
|
20
20
|
|
|
21
|
+
// Re-render once the converter loads, so MathML saved from a corrupted
|
|
22
|
+
// source is repaired and a source typed before the converter loaded is
|
|
23
|
+
// rendered. The converter loads asynchronously, and the user can type in
|
|
24
|
+
// the meantime, so read the source at that time rather than on mount.
|
|
25
|
+
const renderLatest = useEvent( ( convert ) => {
|
|
26
|
+
if ( ! latex ) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
try {
|
|
30
|
+
const newMathML = convert( latex, { displayMode: true } );
|
|
31
|
+
__unstableMarkNextChangeAsNotPersistent();
|
|
32
|
+
setAttributes( { mathML: newMathML } );
|
|
33
|
+
} catch ( err ) {
|
|
34
|
+
setError( err.message );
|
|
35
|
+
}
|
|
36
|
+
} );
|
|
37
|
+
|
|
21
38
|
useEffect( () => {
|
|
22
39
|
import( '@wordpress/latex-to-mathml' ).then( ( module ) => {
|
|
23
40
|
setLatexToMathML( () => module.default );
|
|
24
|
-
|
|
25
|
-
__unstableMarkNextChangeAsNotPersistent();
|
|
26
|
-
setAttributes( {
|
|
27
|
-
mathML: module.default( initialLatex.current, {
|
|
28
|
-
displayMode: true,
|
|
29
|
-
} ),
|
|
30
|
-
} );
|
|
31
|
-
}
|
|
41
|
+
renderLatest( module.default );
|
|
32
42
|
} );
|
|
33
|
-
}, [
|
|
34
|
-
initialLatex,
|
|
35
|
-
setAttributes,
|
|
36
|
-
__unstableMarkNextChangeAsNotPersistent,
|
|
37
|
-
] );
|
|
43
|
+
}, [ renderLatest ] );
|
|
38
44
|
|
|
39
45
|
const blockProps = useBlockProps( {
|
|
40
46
|
ref: setBlockRef,
|
|
@@ -52,7 +58,15 @@ export default function MathEdit( { attributes, setAttributes, isSelected } ) {
|
|
|
52
58
|
dangerouslySetInnerHTML={ { __html: mathML } }
|
|
53
59
|
/>
|
|
54
60
|
) : (
|
|
55
|
-
|
|
61
|
+
// Show the source until it renders, as the front end does.
|
|
62
|
+
<math display="block">
|
|
63
|
+
<semantics>
|
|
64
|
+
{ /* eslint-disable-next-line react/no-unknown-property -- MathML attribute. */ }
|
|
65
|
+
<annotation encoding="application/x-tex">
|
|
66
|
+
{ latex || '\u200B' }
|
|
67
|
+
</annotation>
|
|
68
|
+
</semantics>
|
|
69
|
+
</math>
|
|
56
70
|
) }
|
|
57
71
|
{ isSelected && (
|
|
58
72
|
<Popover
|
|
@@ -67,12 +81,11 @@ export default function MathEdit( { attributes, setAttributes, isSelected } ) {
|
|
|
67
81
|
>
|
|
68
82
|
<form
|
|
69
83
|
ref={ formRef }
|
|
70
|
-
style={ { padding: '
|
|
84
|
+
style={ { padding: '16px', minWidth: '300px' } }
|
|
71
85
|
onSubmit={ ( event ) => event.preventDefault() }
|
|
72
86
|
>
|
|
73
87
|
<ValidatedTextareaControl
|
|
74
88
|
label={ __( 'LaTeX math syntax' ) }
|
|
75
|
-
hideLabelFromVision
|
|
76
89
|
value={ latex ?? '' }
|
|
77
90
|
className="wp-block-math__textarea-control"
|
|
78
91
|
customValidity={
|
|
@@ -82,7 +95,12 @@ export default function MathEdit( { attributes, setAttributes, isSelected } ) {
|
|
|
82
95
|
}
|
|
83
96
|
onValueChange={ ( newLatex ) => {
|
|
84
97
|
if ( ! latexToMathML ) {
|
|
85
|
-
|
|
98
|
+
// The source is read back from the MathML,
|
|
99
|
+
// so clear a stale render along with it.
|
|
100
|
+
setAttributes( {
|
|
101
|
+
latex: newLatex,
|
|
102
|
+
mathML: '',
|
|
103
|
+
} );
|
|
86
104
|
return;
|
|
87
105
|
}
|
|
88
106
|
let newMathML = '';
|
|
@@ -99,8 +117,19 @@ export default function MathEdit( { attributes, setAttributes, isSelected } ) {
|
|
|
99
117
|
latex: newLatex,
|
|
100
118
|
} );
|
|
101
119
|
} }
|
|
102
|
-
placeholder={ __(
|
|
120
|
+
placeholder={ __(
|
|
121
|
+
'e.g., x^2, \\frac{a}{b}, \\sqrt{x}'
|
|
122
|
+
) }
|
|
103
123
|
/>
|
|
124
|
+
<Link
|
|
125
|
+
openInNewTab
|
|
126
|
+
className="wp-block-math__learn-more"
|
|
127
|
+
href={ __(
|
|
128
|
+
'https://wordpress.org/documentation/article/math-block/'
|
|
129
|
+
) }
|
|
130
|
+
>
|
|
131
|
+
{ __( 'Learn more about LaTeX syntax' ) }
|
|
132
|
+
</Link>
|
|
104
133
|
</form>
|
|
105
134
|
</Popover>
|
|
106
135
|
) }
|
package/src/math/editor.scss
CHANGED
package/src/math/save.jsx
CHANGED
|
@@ -7,12 +7,28 @@ export default function save( { attributes } ) {
|
|
|
7
7
|
return null;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
// The LaTeX source lives in the `<annotation>` inside the MathML, where
|
|
11
|
+
// it is HTML-escaped, so `wp_kses` leaves characters such as `&` and `<`
|
|
12
|
+
// alone. Until the source renders, save it on its own: with the
|
|
13
|
+
// annotation as the only child of `<semantics>`, browsers display the
|
|
14
|
+
// source text.
|
|
10
15
|
return (
|
|
11
16
|
<div { ...useBlockProps.save() }>
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
17
|
+
{ mathML ? (
|
|
18
|
+
<math
|
|
19
|
+
display="block"
|
|
20
|
+
dangerouslySetInnerHTML={ { __html: mathML } }
|
|
21
|
+
/>
|
|
22
|
+
) : (
|
|
23
|
+
<math display="block">
|
|
24
|
+
<semantics>
|
|
25
|
+
{ /* eslint-disable-next-line react/no-unknown-property -- MathML attribute. */ }
|
|
26
|
+
<annotation encoding="application/x-tex">
|
|
27
|
+
{ latex }
|
|
28
|
+
</annotation>
|
|
29
|
+
</semantics>
|
|
30
|
+
</math>
|
|
31
|
+
) }
|
|
16
32
|
</div>
|
|
17
33
|
);
|
|
18
34
|
}
|
|
@@ -15,7 +15,7 @@ const v1ToV5ImageFillStyles = ( url, focalPoint ) => {
|
|
|
15
15
|
backgroundPosition: focalPoint
|
|
16
16
|
? `${ focalPoint.x * 100 }% ${ focalPoint.y * 100 }%`
|
|
17
17
|
: `50% 50%`,
|
|
18
|
-
|
|
18
|
+
}
|
|
19
19
|
: {};
|
|
20
20
|
};
|
|
21
21
|
|
|
@@ -26,9 +26,9 @@ const v6ToV7ImageFillStyles = ( url, focalPoint ) => {
|
|
|
26
26
|
backgroundPosition: focalPoint
|
|
27
27
|
? `${ Math.round( focalPoint.x * 100 ) }% ${ Math.round(
|
|
28
28
|
focalPoint.y * 100
|
|
29
|
-
|
|
29
|
+
) }%`
|
|
30
30
|
: `50% 50%`,
|
|
31
|
-
|
|
31
|
+
}
|
|
32
32
|
: {};
|
|
33
33
|
};
|
|
34
34
|
|
package/src/media-text/edit.jsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import clsx from 'clsx';
|
|
2
2
|
import { __ } from '@wordpress/i18n';
|
|
3
|
-
import { useSelect } from '@wordpress/data';
|
|
3
|
+
import { useDispatch, useSelect } from '@wordpress/data';
|
|
4
4
|
import { useState, useRef } from '@wordpress/element';
|
|
5
5
|
import {
|
|
6
6
|
BlockControls,
|
|
@@ -26,8 +26,11 @@ import {
|
|
|
26
26
|
import { isBlobURL, getBlobTypeByURL } from '@wordpress/blob';
|
|
27
27
|
import { pullLeft, pullRight } from '@wordpress/icons';
|
|
28
28
|
import { useEntityProp, store as coreStore } from '@wordpress/core-data';
|
|
29
|
+
import { store as noticesStore } from '@wordpress/notices';
|
|
30
|
+
import { getFilename } from '@wordpress/url';
|
|
29
31
|
import MediaContainer from './media-container';
|
|
30
32
|
import {
|
|
33
|
+
ALLOWED_MEDIA_TYPES,
|
|
31
34
|
DEFAULT_MEDIA_SIZE_SLUG,
|
|
32
35
|
WIDTH_CONSTRAINT_PERCENTAGE,
|
|
33
36
|
LINK_DESTINATION_NONE,
|
|
@@ -36,6 +39,7 @@ import {
|
|
|
36
39
|
} from './constants';
|
|
37
40
|
import { unlock } from '../lock-unlock';
|
|
38
41
|
import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
|
|
42
|
+
import { MediaControl } from '../utils/media-control';
|
|
39
43
|
|
|
40
44
|
const { ResolutionTool } = unlock( blockEditorPrivateApis );
|
|
41
45
|
|
|
@@ -221,7 +225,7 @@ function MediaTextEdit( {
|
|
|
221
225
|
{
|
|
222
226
|
context: 'view',
|
|
223
227
|
}
|
|
224
|
-
|
|
228
|
+
)
|
|
225
229
|
: undefined,
|
|
226
230
|
};
|
|
227
231
|
},
|
|
@@ -240,7 +244,7 @@ function MediaTextEdit( {
|
|
|
240
244
|
{
|
|
241
245
|
context: 'view',
|
|
242
246
|
}
|
|
243
|
-
|
|
247
|
+
)
|
|
244
248
|
: null,
|
|
245
249
|
};
|
|
246
250
|
},
|
|
@@ -332,6 +336,46 @@ function MediaTextEdit( {
|
|
|
332
336
|
};
|
|
333
337
|
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
|
|
334
338
|
|
|
339
|
+
const { createErrorNotice } = useDispatch( noticesStore );
|
|
340
|
+
|
|
341
|
+
const onUploadError = ( message ) => {
|
|
342
|
+
createErrorNotice( message, { type: 'snackbar' } );
|
|
343
|
+
};
|
|
344
|
+
|
|
345
|
+
const mediaInspectorPanel = isSelected ? (
|
|
346
|
+
<InspectorControls group="content">
|
|
347
|
+
<ToolsPanel
|
|
348
|
+
label={ __( 'Media' ) }
|
|
349
|
+
resetAll={ () => onSelectMedia( undefined ) }
|
|
350
|
+
dropdownMenuProps={ dropdownMenuProps }
|
|
351
|
+
>
|
|
352
|
+
<ToolsPanelItem
|
|
353
|
+
label={ __( 'Media' ) }
|
|
354
|
+
hasValue={ () => !! mediaUrl || !! useFeaturedImage }
|
|
355
|
+
onDeselect={ () => onSelectMedia( undefined ) }
|
|
356
|
+
isShownByDefault
|
|
357
|
+
>
|
|
358
|
+
<MediaControl
|
|
359
|
+
mediaId={ mediaId }
|
|
360
|
+
mediaUrl={ mediaUrl || featuredImageURL }
|
|
361
|
+
filename={
|
|
362
|
+
image?.media_details?.sizes?.full?.file ||
|
|
363
|
+
image?.slug ||
|
|
364
|
+
getFilename( mediaUrl )
|
|
365
|
+
}
|
|
366
|
+
allowedTypes={ ALLOWED_MEDIA_TYPES }
|
|
367
|
+
onSelect={ onSelectMedia }
|
|
368
|
+
onError={ onUploadError }
|
|
369
|
+
onReset={ () => onSelectMedia( undefined ) }
|
|
370
|
+
useFeaturedImage={ useFeaturedImage }
|
|
371
|
+
onToggleFeaturedImage={ toggleUseFeaturedImage }
|
|
372
|
+
emptyLabel={ __( 'Add media' ) }
|
|
373
|
+
/>
|
|
374
|
+
</ToolsPanelItem>
|
|
375
|
+
</ToolsPanel>
|
|
376
|
+
</InspectorControls>
|
|
377
|
+
) : null;
|
|
378
|
+
|
|
335
379
|
const mediaTextGeneralSettings = (
|
|
336
380
|
<ToolsPanel
|
|
337
381
|
label={ __( 'Settings' ) }
|
|
@@ -480,6 +524,7 @@ function MediaTextEdit( {
|
|
|
480
524
|
|
|
481
525
|
return (
|
|
482
526
|
<>
|
|
527
|
+
{ mediaInspectorPanel }
|
|
483
528
|
<InspectorControls>{ mediaTextGeneralSettings }</InspectorControls>
|
|
484
529
|
<BlockControls group="block">
|
|
485
530
|
{ blockEditingMode === 'default' && (
|
|
@@ -15,11 +15,11 @@ import { createBlobURL, isBlobURL } from '@wordpress/blob';
|
|
|
15
15
|
import { store as noticesStore } from '@wordpress/notices';
|
|
16
16
|
import { media as icon } from '@wordpress/icons';
|
|
17
17
|
import { imageFillStyles } from './image-fill';
|
|
18
|
+
import { ALLOWED_MEDIA_TYPES } from './constants';
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
21
|
* Constants
|
|
21
22
|
*/
|
|
22
|
-
const ALLOWED_MEDIA_TYPES = [ 'image', 'video' ];
|
|
23
23
|
const noop = () => {};
|
|
24
24
|
|
|
25
25
|
const ResizableBoxContainer = forwardRef(
|
|
@@ -770,7 +770,7 @@ function Navigation( {
|
|
|
770
770
|
submenuVisibility !== 'always'
|
|
771
771
|
? __(
|
|
772
772
|
'The current menu options offer reduced accessibility for users and are not recommended. Enabling either "Open on Click" or "Show arrow" offers enhanced accessibility by allowing keyboard users to browse submenus selectively.'
|
|
773
|
-
|
|
773
|
+
)
|
|
774
774
|
: '';
|
|
775
775
|
|
|
776
776
|
const isFirstRender = useRef( true ); // Don't speak on first render.
|
|
@@ -60,10 +60,10 @@ const MainContent = ( {
|
|
|
60
60
|
/* translators: %s: The name of a menu. */
|
|
61
61
|
__( 'Structure for Navigation Menu: %s' ),
|
|
62
62
|
navigationMenu?.title || __( 'Untitled menu' )
|
|
63
|
-
|
|
63
|
+
)
|
|
64
64
|
: __(
|
|
65
65
|
'You have not yet created any menus. Displaying a list of your Pages'
|
|
66
|
-
|
|
66
|
+
);
|
|
67
67
|
|
|
68
68
|
return (
|
|
69
69
|
<div className="wp-block-navigation__menu-inspector-controls">
|
|
@@ -3,7 +3,7 @@ import { useInstanceId } from '@wordpress/compose';
|
|
|
3
3
|
import { useEntityRecords, store as coreStore } from '@wordpress/core-data';
|
|
4
4
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
5
5
|
import {
|
|
6
|
-
SelectControl,
|
|
6
|
+
SelectControl as WCSelectControl,
|
|
7
7
|
Button,
|
|
8
8
|
FlexBlock,
|
|
9
9
|
FlexItem,
|
|
@@ -255,7 +255,7 @@ export default function OverlayTemplatePartSelector( {
|
|
|
255
255
|
selectedTemplatePart.title?.rendered
|
|
256
256
|
? decodeEntities( selectedTemplatePart.title.rendered )
|
|
257
257
|
: selectedTemplatePart.slug
|
|
258
|
-
|
|
258
|
+
)
|
|
259
259
|
: __( 'Edit overlay' );
|
|
260
260
|
}, [ selectedTemplatePart ] );
|
|
261
261
|
|
|
@@ -301,7 +301,7 @@ export default function OverlayTemplatePartSelector( {
|
|
|
301
301
|
className="wp-block-navigation__overlay-selector-controls"
|
|
302
302
|
>
|
|
303
303
|
<FlexBlock>
|
|
304
|
-
<
|
|
304
|
+
<WCSelectControl
|
|
305
305
|
label={ __( 'Overlay template' ) }
|
|
306
306
|
hideLabelFromVision
|
|
307
307
|
aria-labelledby={ headingId }
|