@wordpress/block-library 10.1.1-next.v.202607070741.0 → 10.3.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 +25 -0
- package/build/accordion/block.json +1 -0
- package/build/accordion-panel/block.json +1 -0
- package/build/button/edit.cjs +18 -8
- package/build/button/edit.cjs.map +2 -2
- package/build/code/edit.cjs +3 -1
- package/build/code/edit.cjs.map +2 -2
- package/build/cover/block.json +12 -0
- package/build/cover/edit/block-controls.cjs +14 -5
- 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 +76 -32
- package/build/cover/edit/index.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 -3
- package/build/details/transforms.cjs.map +2 -2
- package/build/embed/edit.cjs +1 -1
- package/build/embed/edit.cjs.map +2 -2
- package/build/embed/embed-placeholder.cjs +1 -2
- package/build/embed/embed-placeholder.cjs.map +2 -2
- package/build/file/edit.cjs +4 -3
- package/build/file/edit.cjs.map +2 -2
- package/build/file/transforms.cjs +25 -60
- package/build/file/transforms.cjs.map +2 -2
- package/build/gallery/block.json +4 -2
- package/build/gallery/dynamic-gallery.cjs +104 -61
- package/build/gallery/dynamic-gallery.cjs.map +3 -3
- package/build/gallery/edit.cjs +1 -1
- package/build/gallery/edit.cjs.map +3 -3
- package/build/gallery/gap-styles.cjs +49 -13
- package/build/gallery/gap-styles.cjs.map +3 -3
- package/build/gallery/use-dynamic-gallery.cjs +15 -8
- package/build/gallery/use-dynamic-gallery.cjs.map +2 -2
- package/build/group/transforms.cjs +1 -1
- package/build/group/transforms.cjs.map +2 -2
- package/build/heading/edit.cjs +1 -1
- package/build/heading/edit.cjs.map +2 -2
- package/build/html/modal.cjs +63 -54
- package/build/html/modal.cjs.map +3 -3
- package/build/icon/block.json +5 -3
- 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/edit.cjs +1 -35
- package/build/image/edit.cjs.map +2 -2
- package/build/image/image.cjs +23 -18
- 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/image/use-open-image-media-editor-modal.cjs +6 -2
- package/build/image/use-open-image-media-editor-modal.cjs.map +2 -2
- package/build/index.cjs +18 -8
- package/build/index.cjs.map +2 -2
- package/build/latest-posts/edit.cjs +5 -8
- package/build/latest-posts/edit.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-indent-list-item.cjs +10 -2
- package/build/list-item/hooks/use-indent-list-item.cjs.map +2 -2
- package/build/list-item/hooks/use-space.cjs +3 -2
- package/build/list-item/hooks/use-space.cjs.map +3 -3
- package/build/math/edit.cjs +39 -56
- package/build/math/edit.cjs.map +3 -3
- package/build/media-text/edit.cjs +2 -1
- package/build/media-text/edit.cjs.map +2 -2
- package/build/more/edit.cjs +2 -2
- package/build/more/edit.cjs.map +2 -2
- package/build/navigation/edit/index.cjs +30 -16
- package/build/navigation/edit/index.cjs.map +3 -3
- package/build/navigation/edit/use-layout-custom-properties.cjs +72 -0
- package/build/navigation/edit/use-layout-custom-properties.cjs.map +7 -0
- package/build/navigation/view.cjs +9 -6
- package/build/navigation/view.cjs.map +2 -2
- package/build/navigation-link/edit.cjs +3 -3
- package/build/navigation-link/edit.cjs.map +2 -2
- package/build/navigation-link/link-ui/index.cjs +2 -2
- package/build/navigation-link/link-ui/index.cjs.map +2 -2
- package/build/paragraph/edit.cjs +5 -2
- package/build/paragraph/edit.cjs.map +3 -3
- package/build/paragraph/index.cjs +4 -1
- package/build/paragraph/index.cjs.map +2 -2
- package/build/paragraph/use-enter.cjs +3 -7
- package/build/paragraph/use-enter.cjs.map +3 -3
- package/build/playlist/block.json +29 -10
- package/build/playlist/context.cjs +2 -1
- package/build/playlist/context.cjs.map +2 -2
- package/build/playlist/edit.cjs +328 -39
- 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 +37 -8
- package/build/playlist/utils.cjs.map +2 -2
- package/build/playlist/view.cjs +83 -13
- package/build/playlist/view.cjs.map +2 -2
- package/build/playlist-track/block.json +4 -2
- package/build/playlist-track/edit.cjs +115 -70
- package/build/playlist-track/edit.cjs.map +2 -2
- package/build/post-content/block.json +1 -0
- package/build/post-content/edit.cjs +36 -15
- package/build/post-content/edit.cjs.map +2 -2
- package/build/post-featured-image/edit.cjs +3 -2
- package/build/post-featured-image/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/post-terms/edit.cjs +2 -2
- package/build/post-terms/edit.cjs.map +2 -2
- package/build/post-title/edit.cjs +2 -2
- package/build/post-title/edit.cjs.map +2 -2
- package/build/preformatted/edit.cjs +3 -1
- package/build/preformatted/edit.cjs.map +2 -2
- package/build/pullquote/block.json +3 -1
- package/build/pullquote/edit.cjs +5 -3
- package/build/pullquote/edit.cjs.map +2 -2
- package/build/query/block.json +3 -2
- package/build/query/edit/inspector-controls/index.cjs +42 -5
- package/build/query/edit/inspector-controls/index.cjs.map +2 -2
- package/build/query/edit/inspector-controls/offset-controls.cjs +1 -2
- package/build/query/edit/inspector-controls/offset-controls.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/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/quote/block.json +3 -1
- package/build/quote/transforms.cjs +1 -3
- package/build/quote/transforms.cjs.map +2 -2
- package/build/read-more/edit.cjs +3 -1
- package/build/read-more/edit.cjs.map +2 -2
- package/build/rss/edit.cjs +0 -1
- package/build/rss/edit.cjs.map +2 -2
- package/build/site-tagline/edit.cjs +3 -1
- package/build/site-tagline/edit.cjs.map +2 -2
- package/build/site-title/edit.cjs +3 -1
- package/build/site-title/edit.cjs.map +2 -2
- package/build/social-links/edit.cjs +11 -4
- package/build/social-links/edit.cjs.map +2 -2
- package/build/tab-list/block.json +4 -3
- package/build/tab-list/edit.cjs +67 -11
- package/build/tab-list/edit.cjs.map +3 -3
- package/build/tab-list/tab-movers.cjs +87 -0
- package/build/tab-list/tab-movers.cjs.map +7 -0
- package/build/tab-panel/block.json +1 -6
- package/build/tab-panel/edit.cjs +16 -24
- package/build/tab-panel/edit.cjs.map +2 -2
- package/build/tab-panels/block.json +0 -1
- package/build/table/edit.cjs +1 -1
- package/build/table/edit.cjs.map +2 -2
- package/build/tabs/block.json +0 -5
- package/build/tabs/edit.cjs +4 -39
- package/build/tabs/edit.cjs.map +3 -3
- package/build/tabs/use-tab-actions.cjs +23 -1
- package/build/tabs/use-tab-actions.cjs.map +2 -2
- package/build/tabs/use-tab-list-items-sync.cjs +19 -1
- package/build/tabs/use-tab-list-items-sync.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/utils/caption.cjs +2 -2
- package/build/utils/caption.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/edit.cjs +3 -1
- package/build/verse/edit.cjs.map +2 -2
- package/build/video/edit.cjs +2 -11
- package/build/video/edit.cjs.map +3 -3
- package/build/video/tracks-editor.cjs +0 -1
- package/build/video/tracks-editor.cjs.map +2 -2
- package/build-module/accordion/block.json +1 -0
- package/build-module/accordion-panel/block.json +1 -0
- package/build-module/button/edit.mjs +19 -14
- package/build-module/button/edit.mjs.map +2 -2
- package/build-module/code/edit.mjs +3 -1
- package/build-module/code/edit.mjs.map +2 -2
- package/build-module/cover/block.json +12 -0
- package/build-module/cover/edit/block-controls.mjs +14 -5
- 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 +79 -35
- package/build-module/cover/edit/index.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 -7
- package/build-module/details/transforms.mjs.map +2 -2
- package/build-module/embed/edit.mjs +1 -1
- package/build-module/embed/edit.mjs.map +2 -2
- package/build-module/embed/embed-placeholder.mjs +1 -2
- 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/transforms.mjs +25 -60
- package/build-module/file/transforms.mjs.map +2 -2
- package/build-module/gallery/block.json +4 -2
- package/build-module/gallery/dynamic-gallery.mjs +104 -61
- package/build-module/gallery/dynamic-gallery.mjs.map +2 -2
- package/build-module/gallery/edit.mjs +3 -3
- package/build-module/gallery/edit.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/use-dynamic-gallery.mjs +16 -9
- package/build-module/gallery/use-dynamic-gallery.mjs.map +2 -2
- package/build-module/group/transforms.mjs +2 -5
- package/build-module/group/transforms.mjs.map +2 -2
- package/build-module/heading/edit.mjs +1 -1
- package/build-module/heading/edit.mjs.map +2 -2
- package/build-module/html/modal.mjs +68 -55
- package/build-module/html/modal.mjs.map +2 -2
- package/build-module/icon/block.json +5 -3
- 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/edit.mjs +1 -35
- package/build-module/image/edit.mjs.map +2 -2
- package/build-module/image/image.mjs +23 -18
- 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/image/use-open-image-media-editor-modal.mjs +6 -2
- package/build-module/image/use-open-image-media-editor-modal.mjs.map +2 -2
- package/build-module/index.mjs +18 -8
- package/build-module/index.mjs.map +2 -2
- package/build-module/latest-posts/edit.mjs +5 -8
- package/build-module/latest-posts/edit.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-indent-list-item.mjs +10 -2
- package/build-module/list-item/hooks/use-indent-list-item.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/math/edit.mjs +41 -60
- package/build-module/math/edit.mjs.map +2 -2
- package/build-module/media-text/edit.mjs +2 -1
- package/build-module/media-text/edit.mjs.map +2 -2
- package/build-module/more/edit.mjs +2 -2
- package/build-module/more/edit.mjs.map +2 -2
- package/build-module/navigation/edit/index.mjs +30 -16
- package/build-module/navigation/edit/index.mjs.map +2 -2
- package/build-module/navigation/edit/use-layout-custom-properties.mjs +51 -0
- package/build-module/navigation/edit/use-layout-custom-properties.mjs.map +7 -0
- package/build-module/navigation/view.mjs +9 -6
- package/build-module/navigation/view.mjs.map +2 -2
- package/build-module/navigation-link/edit.mjs +3 -3
- package/build-module/navigation-link/edit.mjs.map +2 -2
- package/build-module/navigation-link/link-ui/index.mjs +2 -2
- package/build-module/navigation-link/link-ui/index.mjs.map +2 -2
- package/build-module/paragraph/edit.mjs +6 -2
- package/build-module/paragraph/edit.mjs.map +2 -2
- package/build-module/paragraph/index.mjs +4 -1
- package/build-module/paragraph/index.mjs.map +2 -2
- 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 +29 -10
- package/build-module/playlist/context.mjs +2 -1
- package/build-module/playlist/context.mjs.map +2 -2
- package/build-module/playlist/edit.mjs +331 -41
- 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 +35 -7
- package/build-module/playlist/utils.mjs.map +2 -2
- package/build-module/playlist/view.mjs +89 -14
- package/build-module/playlist/view.mjs.map +2 -2
- package/build-module/playlist-track/block.json +4 -2
- package/build-module/playlist-track/edit.mjs +117 -71
- package/build-module/playlist-track/edit.mjs.map +2 -2
- package/build-module/post-content/block.json +1 -0
- package/build-module/post-content/edit.mjs +37 -15
- package/build-module/post-content/edit.mjs.map +2 -2
- package/build-module/post-featured-image/edit.mjs +3 -2
- package/build-module/post-featured-image/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/post-terms/edit.mjs +2 -2
- package/build-module/post-terms/edit.mjs.map +2 -2
- package/build-module/post-title/edit.mjs +2 -2
- package/build-module/post-title/edit.mjs.map +2 -2
- package/build-module/preformatted/edit.mjs +3 -1
- package/build-module/preformatted/edit.mjs.map +2 -2
- package/build-module/pullquote/block.json +3 -1
- package/build-module/pullquote/edit.mjs +5 -3
- package/build-module/pullquote/edit.mjs.map +2 -2
- package/build-module/query/block.json +3 -2
- package/build-module/query/edit/inspector-controls/index.mjs +44 -6
- package/build-module/query/edit/inspector-controls/index.mjs.map +2 -2
- package/build-module/query/edit/inspector-controls/offset-controls.mjs +2 -3
- package/build-module/query/edit/inspector-controls/offset-controls.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/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/quote/block.json +3 -1
- package/build-module/quote/transforms.mjs +2 -4
- package/build-module/quote/transforms.mjs.map +2 -2
- package/build-module/read-more/edit.mjs +3 -1
- package/build-module/read-more/edit.mjs.map +2 -2
- package/build-module/rss/edit.mjs +0 -1
- package/build-module/rss/edit.mjs.map +2 -2
- package/build-module/site-tagline/edit.mjs +3 -1
- package/build-module/site-tagline/edit.mjs.map +2 -2
- package/build-module/site-title/edit.mjs +3 -1
- package/build-module/site-title/edit.mjs.map +2 -2
- package/build-module/social-links/edit.mjs +11 -4
- package/build-module/social-links/edit.mjs.map +2 -2
- package/build-module/tab-list/block.json +4 -3
- package/build-module/tab-list/edit.mjs +74 -13
- package/build-module/tab-list/edit.mjs.map +2 -2
- package/build-module/tab-list/tab-movers.mjs +59 -0
- package/build-module/tab-list/tab-movers.mjs.map +7 -0
- package/build-module/tab-panel/block.json +1 -6
- package/build-module/tab-panel/edit.mjs +17 -25
- package/build-module/tab-panel/edit.mjs.map +2 -2
- package/build-module/tab-panels/block.json +0 -1
- package/build-module/table/edit.mjs +1 -1
- package/build-module/table/edit.mjs.map +2 -2
- package/build-module/tabs/block.json +0 -5
- package/build-module/tabs/edit.mjs +5 -45
- package/build-module/tabs/edit.mjs.map +2 -2
- package/build-module/tabs/use-tab-actions.mjs +23 -1
- package/build-module/tabs/use-tab-actions.mjs.map +2 -2
- package/build-module/tabs/use-tab-list-items-sync.mjs +19 -1
- package/build-module/tabs/use-tab-list-items-sync.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/utils/caption.mjs +2 -2
- package/build-module/utils/caption.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/edit.mjs +3 -1
- package/build-module/verse/edit.mjs.map +2 -2
- package/build-module/video/edit.mjs +2 -11
- package/build-module/video/edit.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-style/cover/editor-rtl.css +3 -0
- package/build-style/cover/editor.css +3 -0
- package/build-style/editor-rtl.css +61 -59
- package/build-style/editor.css +61 -59
- package/build-style/icon/editor-rtl.css +80 -10
- package/build-style/icon/editor.css +80 -10
- package/build-style/image/editor-rtl.css +3 -32
- package/build-style/image/editor.css +3 -32
- package/build-style/more/editor-rtl.css +2 -2
- package/build-style/more/editor.css +2 -2
- package/build-style/navigation/editor-rtl.css +3 -4
- package/build-style/navigation/editor.css +3 -4
- package/build-style/navigation-link/editor-rtl.css +1 -1
- package/build-style/navigation-link/editor.css +1 -1
- package/build-style/nextpage/editor-rtl.css +2 -2
- package/build-style/nextpage/editor.css +2 -2
- package/build-style/playlist/editor-rtl.css +4 -3
- package/build-style/playlist/editor.css +4 -3
- package/build-style/playlist/style-rtl.css +81 -5
- package/build-style/playlist/style.css +81 -5
- package/build-style/playlist-track/style-rtl.css +10 -0
- package/build-style/playlist-track/style.css +10 -0
- package/build-style/pullquote/editor-rtl.css +4 -0
- package/build-style/pullquote/editor.css +4 -0
- package/build-style/style-rtl.css +91 -5
- package/build-style/style.css +91 -5
- package/build-style/tab-list/editor-rtl.css +101 -0
- package/build-style/tab-list/editor.css +101 -0
- package/build-style/video/editor-rtl.css +1 -1
- package/build-style/video/editor.css +1 -1
- 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 +47 -45
- package/src/accordion/README.md +1 -0
- package/src/accordion/block.json +1 -0
- package/src/accordion-panel/block.json +1 -0
- package/src/breadcrumbs/index.php +3 -1
- package/src/button/edit.js +21 -15
- package/src/button/index.php +1 -1
- package/src/code/edit.js +7 -2
- package/src/cover/README.md +60 -0
- package/src/cover/block.json +12 -0
- package/src/cover/edit/block-controls.js +26 -11
- package/src/cover/edit/embed-video-url-input.js +5 -4
- package/src/cover/edit/index.js +109 -46
- package/src/cover/editor.scss +6 -0
- package/src/cover/embed-video-utils.js +38 -13
- package/src/cover/index.php +9 -2
- package/src/details/transforms.js +2 -7
- package/src/editor.scss +1 -0
- package/src/embed/edit.js +3 -1
- package/src/embed/embed-placeholder.js +9 -8
- package/src/file/edit.js +8 -8
- package/src/file/transforms.js +28 -60
- package/src/form/index.php +6 -4
- package/src/gallery/README.md +1 -1
- package/src/gallery/block.json +4 -2
- package/src/gallery/dynamic-gallery.js +133 -74
- package/src/gallery/edit.js +3 -3
- package/src/gallery/gap-styles.js +79 -20
- package/src/gallery/index.php +103 -43
- package/src/gallery/use-dynamic-gallery.js +27 -12
- package/src/group/transforms.js +2 -5
- package/src/heading/edit.js +1 -1
- package/src/html/modal.js +13 -2
- package/src/icon/README.md +1 -3
- package/src/icon/block.json +5 -3
- 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 -11
- package/src/image/README.md +1 -1
- package/src/image/block.json +1 -1
- package/src/image/edit.js +1 -57
- package/src/image/editor.scss +6 -44
- package/src/image/image.js +56 -27
- package/src/image/test/use-open-image-media-editor-modal.js +37 -1
- package/src/image/transforms.js +128 -0
- package/src/image/use-open-image-media-editor-modal.js +8 -1
- package/src/index.js +19 -7
- package/src/latest-posts/edit.js +5 -8
- package/src/latest-posts/index.php +49 -18
- package/src/list-item/edit.js +1 -1
- package/src/list-item/hooks/use-enter.js +15 -22
- package/src/list-item/hooks/use-indent-list-item.js +10 -1
- package/src/list-item/hooks/use-space.js +4 -6
- package/src/math/edit.js +42 -59
- package/src/media-text/edit.js +1 -0
- package/src/media-text/editor.scss +1 -0
- package/src/media-text/index.php +11 -2
- package/src/more/edit.js +7 -4
- package/src/more/editor.scss +1 -1
- package/src/navigation/edit/index.js +52 -36
- package/src/navigation/edit/test/layout-custom-properties.js +138 -0
- package/src/navigation/edit/use-layout-custom-properties.js +84 -0
- package/src/navigation/editor.scss +1 -2
- package/src/navigation/index.php +123 -12
- package/src/navigation/test/view.js +51 -0
- package/src/navigation/view.js +15 -14
- package/src/navigation-link/edit.js +11 -7
- package/src/navigation-link/editor.scss +1 -1
- package/src/navigation-link/index.php +70 -3
- package/src/navigation-link/link-ui/index.js +2 -1
- package/src/navigation-link/test/__snapshots__/hooks.js.snap +1 -1
- package/src/navigation-submenu/index.php +6 -3
- package/src/nextpage/editor.scss +1 -1
- package/src/page-list/index.php +4 -3
- package/src/paragraph/edit.js +9 -2
- package/src/paragraph/index.js +4 -1
- package/src/paragraph/use-enter.js +4 -11
- package/src/pattern/index.php +5 -5
- package/src/playlist/README.md +17 -18
- package/src/playlist/block.json +29 -10
- package/src/playlist/context.js +1 -0
- package/src/playlist/edit.js +395 -59
- package/src/playlist/editor.scss +4 -5
- package/src/playlist/index.js +1 -1
- package/src/playlist/index.php +71 -22
- package/src/playlist/style.scss +54 -1
- package/src/playlist/test/edit-component.js +139 -0
- package/src/playlist/test/edit.js +43 -2
- package/src/playlist/utils.js +49 -10
- package/src/playlist/view.js +97 -16
- package/src/playlist-track/README.md +3 -3
- package/src/playlist-track/block.json +4 -2
- package/src/playlist-track/edit.js +116 -75
- package/src/playlist-track/index.php +26 -11
- package/src/playlist-track/style.scss +10 -0
- package/src/playlist-track/test/edit.js +253 -0
- package/src/post-content/README.md +1 -0
- package/src/post-content/block.json +1 -0
- package/src/post-content/edit.js +45 -16
- package/src/post-excerpt/index.php +4 -1
- package/src/post-featured-image/edit.js +3 -2
- package/src/post-featured-image/index.php +4 -1
- 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/post-terms/edit.js +7 -4
- package/src/post-title/edit.js +5 -3
- package/src/preformatted/edit.js +7 -2
- package/src/pullquote/README.md +1 -0
- package/src/pullquote/block.json +3 -1
- package/src/pullquote/edit.js +9 -4
- package/src/pullquote/editor.scss +6 -0
- package/src/query/README.md +2 -1
- package/src/query/block.json +3 -2
- package/src/query/edit/inspector-controls/index.js +47 -4
- package/src/query/edit/inspector-controls/offset-controls.js +2 -3
- package/src/query/edit/inspector-controls/pages-control.js +0 -1
- package/src/query/edit/query-content.js +19 -3
- package/src/query/index.js +1 -0
- package/src/quote/README.md +1 -0
- package/src/quote/block.json +3 -1
- package/src/quote/transforms.js +2 -4
- package/src/read-more/edit.js +7 -2
- package/src/rss/edit.js +0 -1
- package/src/rss/index.php +10 -4
- package/src/site-tagline/edit.js +7 -2
- package/src/site-title/edit.js +7 -2
- package/src/social-link/index.php +19 -9
- package/src/social-links/edit.js +21 -12
- package/src/tab-list/README.md +4 -5
- package/src/tab-list/block.json +4 -3
- package/src/tab-list/edit.js +92 -28
- package/src/tab-list/editor.scss +9 -0
- package/src/tab-list/index.php +9 -4
- package/src/tab-list/tab-movers.js +72 -0
- package/src/tab-panel/README.md +4 -6
- package/src/tab-panel/block.json +1 -6
- package/src/tab-panel/edit.js +20 -33
- package/src/tab-panels/README.md +5 -3
- package/src/tab-panels/block.json +0 -1
- package/src/table/edit.js +1 -1
- package/src/table-of-contents/index.php +386 -1
- package/src/tabs/README.md +18 -9
- package/src/tabs/block.json +0 -5
- package/src/tabs/edit.js +7 -64
- package/src/tabs/use-tab-actions.js +32 -3
- package/src/tabs/use-tab-list-items-sync.js +24 -4
- package/src/tag-cloud/index.php +3 -2
- package/src/template-part/index.php +3 -17
- 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/utils/caption.js +7 -4
- package/src/utils/media-control.scss +1 -5
- package/src/utils/test/waveform-player.js +297 -34
- package/src/utils/test/waveform-utils.js +473 -5
- package/src/utils/waveform-player.js +189 -59
- package/src/utils/waveform-utils.js +443 -40
- package/src/verse/edit.js +7 -2
- package/src/video/edit.js +0 -8
- package/src/video/editor.scss +1 -1
- package/src/video/index.php +2 -2
- package/src/video/tracks-editor.js +0 -1
- package/build/image/animated-gif-convert-control.cjs +0 -105
- package/build/image/animated-gif-convert-control.cjs.map +0 -7
- package/build/utils/gif-conversion-attributes.cjs +0 -40
- package/build/utils/gif-conversion-attributes.cjs.map +0 -7
- package/build/video/gif-restore-control.cjs +0 -73
- package/build/video/gif-restore-control.cjs.map +0 -7
- package/build-module/image/animated-gif-convert-control.mjs +0 -87
- package/build-module/image/animated-gif-convert-control.mjs.map +0 -7
- package/build-module/utils/gif-conversion-attributes.mjs +0 -15
- package/build-module/utils/gif-conversion-attributes.mjs.map +0 -7
- package/build-module/video/gif-restore-control.mjs +0 -55
- package/build-module/video/gif-restore-control.mjs.map +0 -7
- package/src/image/animated-gif-convert-control.js +0 -135
- package/src/image/test/animated-gif-convert-control.js +0 -276
- package/src/utils/gif-conversion-attributes.js +0 -30
- package/src/utils/test/gif-conversion-attributes.js +0 -60
- package/src/video/gif-restore-control.js +0 -92
|
@@ -576,8 +576,7 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
|
|
|
576
576
|
grid-column: span 2;
|
|
577
577
|
|
|
578
578
|
&.open {
|
|
579
|
-
|
|
580
|
-
outline: 1px solid transparent; // Box shadow is removed in high contrast mode, a transparent outline is made opaque.
|
|
579
|
+
border-color: $gray-200;
|
|
581
580
|
background-color: $white;
|
|
582
581
|
}
|
|
583
582
|
}
|
package/src/navigation/index.php
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* will always have a value even for legacy blocks. We check the legacy openSubmenusOnClick
|
|
17
17
|
* attribute first to preserve original behavior for blocks saved before the migration.
|
|
18
18
|
*
|
|
19
|
-
* @since
|
|
19
|
+
* @since 7.0.0
|
|
20
20
|
*
|
|
21
21
|
* @param array $attributes Block attributes containing submenuVisibility and/or openSubmenusOnClick.
|
|
22
22
|
* @return string The visibility mode: 'hover', 'click', or 'always'.
|
|
@@ -40,6 +40,45 @@ function block_core_navigation_get_submenu_visibility( $attributes ) {
|
|
|
40
40
|
return $submenu_visibility ?? 'hover';
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
/**
|
|
44
|
+
* Returns the custom properties used by the Navigation block for a layout.
|
|
45
|
+
*
|
|
46
|
+
* @since 7.1.0
|
|
47
|
+
*
|
|
48
|
+
* @param array $layout Layout configuration.
|
|
49
|
+
* @return array Navigation layout custom property declarations.
|
|
50
|
+
*/
|
|
51
|
+
function block_core_navigation_get_layout_custom_property_declarations( $layout ) {
|
|
52
|
+
$justification_values = array(
|
|
53
|
+
'left' => 'flex-start',
|
|
54
|
+
'center' => 'center',
|
|
55
|
+
'right' => 'flex-end',
|
|
56
|
+
'space-between' => 'space-between',
|
|
57
|
+
);
|
|
58
|
+
$justify_content = is_array( $layout ) ? ( $layout['justifyContent'] ?? 'left' ) : 'left';
|
|
59
|
+
if ( ! is_string( $justify_content ) || ! isset( $justification_values[ $justify_content ] ) ) {
|
|
60
|
+
$justify_content = 'left';
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
$justification = $justification_values[ $justify_content ];
|
|
64
|
+
$is_vertical = is_array( $layout ) && 'vertical' === ( $layout['orientation'] ?? null );
|
|
65
|
+
$align = 'center';
|
|
66
|
+
$justify = $justification;
|
|
67
|
+
|
|
68
|
+
if ( $is_vertical ) {
|
|
69
|
+
$align = in_array( $justify_content, array( 'center', 'right' ), true ) ? $justification : 'flex-start';
|
|
70
|
+
$justify = 'left' === $justify_content ? 'initial' : $justification;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return array(
|
|
74
|
+
'--navigation-layout-justification-setting' => $justification,
|
|
75
|
+
'--navigation-layout-direction' => $is_vertical ? 'column' : 'row',
|
|
76
|
+
'--navigation-layout-wrap' => is_array( $layout ) && 'nowrap' === ( $layout['flexWrap'] ?? null ) ? 'nowrap' : 'wrap',
|
|
77
|
+
'--navigation-layout-justify' => $justify,
|
|
78
|
+
'--navigation-layout-align' => $align,
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
|
|
43
82
|
/**
|
|
44
83
|
* Helper functions used to render the navigation block.
|
|
45
84
|
*
|
|
@@ -576,12 +615,13 @@ class WP_Navigation_Block_Renderer {
|
|
|
576
615
|
'space-between' => 'items-justified-space-between',
|
|
577
616
|
);
|
|
578
617
|
|
|
579
|
-
$layout_class
|
|
618
|
+
$layout_class = '';
|
|
619
|
+
$nav_justify_content = $attributes['layout']['justifyContent'] ?? null;
|
|
580
620
|
if (
|
|
581
|
-
|
|
582
|
-
isset( $layout_justification[ $
|
|
621
|
+
is_string( $nav_justify_content ) &&
|
|
622
|
+
isset( $layout_justification[ $nav_justify_content ] )
|
|
583
623
|
) {
|
|
584
|
-
$layout_class .= $layout_justification[ $
|
|
624
|
+
$layout_class .= $layout_justification[ $nav_justify_content ];
|
|
585
625
|
}
|
|
586
626
|
if ( isset( $attributes['layout']['orientation'] ) && 'vertical' === $attributes['layout']['orientation'] ) {
|
|
587
627
|
$layout_class .= ' is-vertical';
|
|
@@ -1211,7 +1251,7 @@ function block_core_navigation_add_directives_to_submenu( $tags, $block_attribut
|
|
|
1211
1251
|
)
|
|
1212
1252
|
) ) {
|
|
1213
1253
|
$tags->set_attribute( 'data-wp-on--click', 'actions.toggleMenuOnClick' );
|
|
1214
|
-
$tags->set_attribute( 'data-wp-bind--aria-expanded', 'state.
|
|
1254
|
+
$tags->set_attribute( 'data-wp-bind--aria-expanded', 'state.isSubmenuOpen' );
|
|
1215
1255
|
// The `aria-expanded` attribute for SSR is already added in the submenu block.
|
|
1216
1256
|
}
|
|
1217
1257
|
// Add directives to the submenu.
|
|
@@ -1558,13 +1598,18 @@ function register_block_core_navigation() {
|
|
|
1558
1598
|
add_action( 'init', 'register_block_core_navigation' );
|
|
1559
1599
|
|
|
1560
1600
|
/**
|
|
1561
|
-
* Adds
|
|
1601
|
+
* Adds Navigation block support classes to inner list containers.
|
|
1562
1602
|
*
|
|
1563
1603
|
* State block support adds the generated `wp-states-*` class to the outer
|
|
1564
1604
|
* block wrapper. The Navigation block renders its menu items inside an inner
|
|
1565
1605
|
* `wp-block-navigation__container` list, so the same state class is also needed
|
|
1566
1606
|
* there for state styles to apply directly to the menu list.
|
|
1567
1607
|
*
|
|
1608
|
+
* Navigation also uses layout classes on its outer wrapper to define custom
|
|
1609
|
+
* properties consumed by its inner containers. Viewport layout styles cannot
|
|
1610
|
+
* change those classes, so equivalent custom properties and a scoping class
|
|
1611
|
+
* are generated for each configured viewport layout.
|
|
1612
|
+
*
|
|
1568
1613
|
* Currently this is required as a workaround because of how difficult it is for nav
|
|
1569
1614
|
* child blocks to inherit styles through the complex responsive nav block html. The
|
|
1570
1615
|
* bug in https://github.com/WordPress/gutenberg/issues/62690 also prevents inheritance.
|
|
@@ -1575,25 +1620,83 @@ add_action( 'init', 'register_block_core_navigation' );
|
|
|
1575
1620
|
* @param array $block The full block, including name and attributes.
|
|
1576
1621
|
* @return string The updated block content.
|
|
1577
1622
|
*/
|
|
1578
|
-
function
|
|
1623
|
+
function block_core_navigation_add_support_classes_to_container( $block_content, $block ) {
|
|
1579
1624
|
if ( 'core/navigation' !== ( $block['blockName'] ?? null ) || empty( $block_content ) ) {
|
|
1580
1625
|
return $block_content;
|
|
1581
1626
|
}
|
|
1582
1627
|
|
|
1628
|
+
$attributes = is_array( $block['attrs'] ?? null ) ? $block['attrs'] : array();
|
|
1629
|
+
$style = is_array( $attributes['style'] ?? null ) ? $attributes['style'] : array();
|
|
1630
|
+
if (
|
|
1631
|
+
defined( 'IS_GUTENBERG_PLUGIN' ) &&
|
|
1632
|
+
IS_GUTENBERG_PLUGIN &&
|
|
1633
|
+
function_exists( 'gutenberg_resolve_style_state_aliases' )
|
|
1634
|
+
) {
|
|
1635
|
+
$style = gutenberg_resolve_style_state_aliases( $style, 'core/navigation' );
|
|
1636
|
+
}
|
|
1637
|
+
|
|
1638
|
+
$global_settings = wp_get_global_settings();
|
|
1639
|
+
$viewport_settings = $global_settings['viewport'] ?? null;
|
|
1640
|
+
$responsive_media_queries = array();
|
|
1641
|
+
if ( method_exists( 'WP_Theme_JSON_Gutenberg', 'get_viewport_media_queries' ) ) {
|
|
1642
|
+
$responsive_media_queries = WP_Theme_JSON_Gutenberg::get_viewport_media_queries( $viewport_settings );
|
|
1643
|
+
} elseif ( method_exists( 'WP_Theme_JSON', 'get_viewport_media_queries' ) ) {
|
|
1644
|
+
$responsive_media_queries = WP_Theme_JSON::get_viewport_media_queries( $viewport_settings );
|
|
1645
|
+
}
|
|
1646
|
+
|
|
1647
|
+
$styles = array();
|
|
1648
|
+
$base_layout = is_array( $attributes['layout'] ?? null ) ? $attributes['layout'] : array();
|
|
1649
|
+
foreach ( $responsive_media_queries as $breakpoint => $media_query ) {
|
|
1650
|
+
$viewport_style = is_array( $style[ $breakpoint ] ?? null ) ? $style[ $breakpoint ] : array();
|
|
1651
|
+
$viewport_layout = is_array( $viewport_style['layout'] ?? null ) ? $viewport_style['layout'] : array();
|
|
1652
|
+
if ( empty( $viewport_layout ) ) {
|
|
1653
|
+
continue;
|
|
1654
|
+
}
|
|
1655
|
+
|
|
1656
|
+
$styles[] = array(
|
|
1657
|
+
'declarations' => block_core_navigation_get_layout_custom_property_declarations(
|
|
1658
|
+
array_replace( $base_layout, $viewport_layout )
|
|
1659
|
+
),
|
|
1660
|
+
'rules_group' => $media_query,
|
|
1661
|
+
);
|
|
1662
|
+
}
|
|
1663
|
+
|
|
1583
1664
|
$processor = new WP_HTML_Tag_Processor( $block_content );
|
|
1584
1665
|
if ( ! $processor->next_tag() ) {
|
|
1585
1666
|
return $block_content;
|
|
1586
1667
|
}
|
|
1587
1668
|
|
|
1588
1669
|
$class_attribute = $processor->get_attribute( 'class' );
|
|
1589
|
-
|
|
1670
|
+
$state_class = null;
|
|
1671
|
+
if ( is_string( $class_attribute ) && preg_match( '/\bwp-states-[a-f0-9]{8}\b/', $class_attribute, $matches ) ) {
|
|
1672
|
+
$state_class = $matches[0];
|
|
1673
|
+
}
|
|
1674
|
+
|
|
1675
|
+
$layout_class = null;
|
|
1676
|
+
if ( ! empty( $styles ) ) {
|
|
1677
|
+
$layout_class = wp_unique_id( 'wp-block-navigation-' );
|
|
1678
|
+
// The inner selector includes both Navigation classes so it overrides the
|
|
1679
|
+
// default layout custom properties set by `.wp-block-navigation.items-*`.
|
|
1680
|
+
$selector = ".wp-block-navigation.{$layout_class},.wp-block-navigation.wp-block-navigation__container.{$layout_class}";
|
|
1681
|
+
foreach ( $styles as &$style_rule ) {
|
|
1682
|
+
$style_rule['selector'] = $selector;
|
|
1683
|
+
}
|
|
1684
|
+
unset( $style_rule );
|
|
1685
|
+
|
|
1686
|
+
$processor->add_class( $layout_class );
|
|
1687
|
+
wp_style_engine_get_stylesheet_from_css_rules(
|
|
1688
|
+
$styles,
|
|
1689
|
+
array( 'context' => 'block-supports' )
|
|
1690
|
+
);
|
|
1691
|
+
}
|
|
1692
|
+
|
|
1693
|
+
if ( null === $state_class && null === $layout_class ) {
|
|
1590
1694
|
return $block_content;
|
|
1591
1695
|
}
|
|
1592
1696
|
|
|
1593
|
-
$state_class = $matches[0];
|
|
1594
1697
|
while ( $processor->next_tag() ) {
|
|
1595
1698
|
// Custom overlay content can include nested Navigation blocks.
|
|
1596
|
-
// Avoid applying the outer Navigation
|
|
1699
|
+
// Avoid applying the outer Navigation classes to an inner nav block.
|
|
1597
1700
|
if ( $processor->has_class( 'wp-block-navigation' ) && ! $processor->has_class( 'wp-block-navigation__container' ) ) {
|
|
1598
1701
|
break;
|
|
1599
1702
|
}
|
|
@@ -1602,6 +1705,14 @@ function block_core_navigation_add_state_class_to_container( $block_content, $bl
|
|
|
1602
1705
|
continue;
|
|
1603
1706
|
}
|
|
1604
1707
|
|
|
1708
|
+
if ( null !== $layout_class ) {
|
|
1709
|
+
$processor->add_class( $layout_class );
|
|
1710
|
+
}
|
|
1711
|
+
|
|
1712
|
+
if ( null === $state_class ) {
|
|
1713
|
+
continue;
|
|
1714
|
+
}
|
|
1715
|
+
|
|
1605
1716
|
$class_attribute = $processor->get_attribute( 'class' );
|
|
1606
1717
|
if ( is_string( $class_attribute ) && preg_match( '/\bwp-states-[a-f0-9]{8}\b/', $class_attribute ) ) {
|
|
1607
1718
|
continue;
|
|
@@ -1613,7 +1724,7 @@ function block_core_navigation_add_state_class_to_container( $block_content, $bl
|
|
|
1613
1724
|
return $processor->get_updated_html();
|
|
1614
1725
|
}
|
|
1615
1726
|
|
|
1616
|
-
add_filter( 'render_block', '
|
|
1727
|
+
add_filter( 'render_block', 'block_core_navigation_add_support_classes_to_container', 11, 2 );
|
|
1617
1728
|
|
|
1618
1729
|
/**
|
|
1619
1730
|
* Filter that changes the parsed attribute values of navigation blocks contain typographic presets to contain the values directly.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
let mockRegisteredStore;
|
|
2
|
+
let mockCurrentContext;
|
|
3
|
+
|
|
4
|
+
jest.mock( '@wordpress/interactivity', () => ( {
|
|
5
|
+
store: ( name, config ) => {
|
|
6
|
+
mockRegisteredStore = config;
|
|
7
|
+
return config;
|
|
8
|
+
},
|
|
9
|
+
getContext: () => mockCurrentContext,
|
|
10
|
+
getElement: () => ( { ref: {} } ),
|
|
11
|
+
withSyncEvent: ( fn ) => fn,
|
|
12
|
+
} ) );
|
|
13
|
+
|
|
14
|
+
describe( 'Navigation view script', () => {
|
|
15
|
+
beforeEach( async () => {
|
|
16
|
+
jest.resetModules();
|
|
17
|
+
mockRegisteredStore = null;
|
|
18
|
+
mockCurrentContext = null;
|
|
19
|
+
// Import the view.js script to register the store
|
|
20
|
+
await import( '../view.js' );
|
|
21
|
+
} );
|
|
22
|
+
|
|
23
|
+
it( 'updates submenuOpenedBy.hover when hovering a submenu inside an open overlay', () => {
|
|
24
|
+
// Mock the context for a submenu inside an open overlay
|
|
25
|
+
mockCurrentContext = {
|
|
26
|
+
type: 'submenu',
|
|
27
|
+
submenuOpenedBy: { click: false, hover: false, focus: false },
|
|
28
|
+
overlayOpenedBy: { click: true, hover: false, focus: false },
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const { state, actions } = mockRegisteredStore;
|
|
32
|
+
|
|
33
|
+
// Verify initial state
|
|
34
|
+
expect( state.isSubmenuOpen ).toBe( true ); // because overlay is open
|
|
35
|
+
expect( mockCurrentContext.submenuOpenedBy.hover ).toBe( false );
|
|
36
|
+
|
|
37
|
+
// Simulate hover enter
|
|
38
|
+
actions.openMenuOnHover( { pointerType: 'mouse' } );
|
|
39
|
+
|
|
40
|
+
// Verify that hover state is tracked even though submenu is already "open" visually
|
|
41
|
+
expect( mockCurrentContext.submenuOpenedBy.hover ).toBe( true );
|
|
42
|
+
expect( state.isSubmenuOpen ).toBe( true ); // remains true
|
|
43
|
+
|
|
44
|
+
// Simulate hover leave
|
|
45
|
+
actions.closeMenuOnHover( { pointerType: 'mouse' } );
|
|
46
|
+
|
|
47
|
+
// Verify hover state is cleared
|
|
48
|
+
expect( mockCurrentContext.submenuOpenedBy.hover ).toBe( false );
|
|
49
|
+
expect( state.isSubmenuOpen ).toBe( true ); // remains true because overlay is still open
|
|
50
|
+
} );
|
|
51
|
+
} );
|
package/src/navigation/view.js
CHANGED
|
@@ -80,6 +80,17 @@ const { state, actions } = store(
|
|
|
80
80
|
? ctx.overlayOpenedBy
|
|
81
81
|
: ctx.submenuOpenedBy;
|
|
82
82
|
},
|
|
83
|
+
get isSubmenuOpen() {
|
|
84
|
+
const ctx = getContext();
|
|
85
|
+
// Once the overlay itself is open, its styles always expand
|
|
86
|
+
// every submenu regardless of hover/click/focus state, so the
|
|
87
|
+
// toggle's `aria-expanded` should reflect that immediately
|
|
88
|
+
// instead of waiting for a hover/click/focus interaction.
|
|
89
|
+
const isOverlayOpen =
|
|
90
|
+
Object.values( ctx.overlayOpenedBy || {} ).filter( Boolean )
|
|
91
|
+
.length > 0;
|
|
92
|
+
return isOverlayOpen || state.isMenuOpen;
|
|
93
|
+
},
|
|
83
94
|
},
|
|
84
95
|
actions: {
|
|
85
96
|
openMenuOnHover( event ) {
|
|
@@ -88,13 +99,8 @@ const { state, actions } = store(
|
|
|
88
99
|
if ( event?.pointerType === 'touch' ) {
|
|
89
100
|
return;
|
|
90
101
|
}
|
|
91
|
-
const { type
|
|
92
|
-
if (
|
|
93
|
-
type === 'submenu' &&
|
|
94
|
-
// Only open on hover if the overlay is closed.
|
|
95
|
-
Object.values( overlayOpenedBy || {} ).filter( Boolean )
|
|
96
|
-
.length === 0
|
|
97
|
-
) {
|
|
102
|
+
const { type } = getContext();
|
|
103
|
+
if ( type === 'submenu' ) {
|
|
98
104
|
actions.openMenu( 'hover' );
|
|
99
105
|
}
|
|
100
106
|
},
|
|
@@ -102,13 +108,8 @@ const { state, actions } = store(
|
|
|
102
108
|
if ( event?.pointerType === 'touch' ) {
|
|
103
109
|
return;
|
|
104
110
|
}
|
|
105
|
-
const { type
|
|
106
|
-
if (
|
|
107
|
-
type === 'submenu' &&
|
|
108
|
-
// Only close on hover if the overlay is closed.
|
|
109
|
-
Object.values( overlayOpenedBy || {} ).filter( Boolean )
|
|
110
|
-
.length === 0
|
|
111
|
-
) {
|
|
111
|
+
const { type } = getContext();
|
|
112
|
+
if ( type === 'submenu' ) {
|
|
112
113
|
actions.closeMenu( 'hover' );
|
|
113
114
|
}
|
|
114
115
|
},
|
|
@@ -425,12 +425,15 @@ export default function NavigationLinkEdit( {
|
|
|
425
425
|
}
|
|
426
426
|
onMerge={ mergeBlocks }
|
|
427
427
|
onReplace={ onReplace }
|
|
428
|
-
__unstableOnSplitAtEnd={
|
|
429
|
-
insertBlocksAfter
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
428
|
+
__unstableOnSplitAtEnd={
|
|
429
|
+
insertBlocksAfter
|
|
430
|
+
? () =>
|
|
431
|
+
insertBlocksAfter(
|
|
432
|
+
createBlock(
|
|
433
|
+
'core/navigation-link'
|
|
434
|
+
)
|
|
435
|
+
)
|
|
436
|
+
: undefined
|
|
434
437
|
}
|
|
435
438
|
aria-label={ __(
|
|
436
439
|
'Navigation link text'
|
|
@@ -470,7 +473,8 @@ export default function NavigationLinkEdit( {
|
|
|
470
473
|
// If there is no link and no binding, remove the auto-inserted block.
|
|
471
474
|
// This avoids empty blocks which can provided a poor UX.
|
|
472
475
|
// Don't remove if binding exists (even if entity is unavailable) so user can fix it.
|
|
473
|
-
|
|
476
|
+
// `onReplace` is undefined when the block can't be removed.
|
|
477
|
+
if ( ! url && ! hasUrlBinding && onReplace ) {
|
|
474
478
|
onReplace( [] );
|
|
475
479
|
return;
|
|
476
480
|
}
|
|
@@ -80,6 +80,66 @@ function block_core_navigation_link_build_css_colors( $context, $attributes, $is
|
|
|
80
80
|
return $colors;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
+
/**
|
|
84
|
+
* Build an array with CSS classes and inline styles defining the font sizes
|
|
85
|
+
* which will be applied to the navigation markup in the front-end.
|
|
86
|
+
*
|
|
87
|
+
* This function is no longer used internally and is kept only for backward
|
|
88
|
+
* compatibility with third-party code that may call it directly.
|
|
89
|
+
*
|
|
90
|
+
* @since 5.9.0
|
|
91
|
+
* @deprecated 7.0.0
|
|
92
|
+
*
|
|
93
|
+
* @param array $context Navigation block context.
|
|
94
|
+
* @return array Font size CSS classes and inline styles.
|
|
95
|
+
*/
|
|
96
|
+
function block_core_navigation_link_build_css_font_sizes( $context ) {
|
|
97
|
+
_deprecated_function( __FUNCTION__, '7.0.0' );
|
|
98
|
+
|
|
99
|
+
// CSS classes.
|
|
100
|
+
$font_sizes = array(
|
|
101
|
+
'css_classes' => array(),
|
|
102
|
+
'inline_styles' => '',
|
|
103
|
+
);
|
|
104
|
+
|
|
105
|
+
$has_named_font_size = array_key_exists( 'fontSize', $context );
|
|
106
|
+
$has_custom_font_size = isset( $context['style']['typography']['fontSize'] );
|
|
107
|
+
|
|
108
|
+
if ( $has_named_font_size ) {
|
|
109
|
+
// Add the font size class.
|
|
110
|
+
$font_sizes['css_classes'][] = sprintf( 'has-%s-font-size', $context['fontSize'] );
|
|
111
|
+
} elseif ( $has_custom_font_size ) {
|
|
112
|
+
// Add the custom font size inline style.
|
|
113
|
+
$font_sizes['inline_styles'] = sprintf(
|
|
114
|
+
'font-size: %s;',
|
|
115
|
+
wp_get_typography_font_size_value(
|
|
116
|
+
array(
|
|
117
|
+
'size' => $context['style']['typography']['fontSize'],
|
|
118
|
+
)
|
|
119
|
+
)
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return $font_sizes;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Returns the top-level submenu SVG chevron icon.
|
|
128
|
+
*
|
|
129
|
+
* @since 5.9.0
|
|
130
|
+
* @deprecated 7.0.0 Use block_core_shared_navigation_render_submenu_icon() instead.
|
|
131
|
+
*
|
|
132
|
+
* @return string
|
|
133
|
+
*/
|
|
134
|
+
function block_core_navigation_link_render_submenu_icon() {
|
|
135
|
+
_deprecated_function(
|
|
136
|
+
__FUNCTION__,
|
|
137
|
+
'7.0.0',
|
|
138
|
+
'block_core_shared_navigation_render_submenu_icon()'
|
|
139
|
+
);
|
|
140
|
+
return block_core_shared_navigation_render_submenu_icon();
|
|
141
|
+
}
|
|
142
|
+
|
|
83
143
|
/**
|
|
84
144
|
* Decodes a url if it's encoded, returning the same url if not.
|
|
85
145
|
*
|
|
@@ -90,6 +150,10 @@ function block_core_navigation_link_build_css_colors( $context, $attributes, $is
|
|
|
90
150
|
* @return string $url Returns the decoded url.
|
|
91
151
|
*/
|
|
92
152
|
function block_core_navigation_link_maybe_urldecode( $url ) {
|
|
153
|
+
if ( ! is_string( $url ) ) {
|
|
154
|
+
return '';
|
|
155
|
+
}
|
|
156
|
+
|
|
93
157
|
$is_url_encoded = false;
|
|
94
158
|
$query = parse_url( $url, PHP_URL_QUERY );
|
|
95
159
|
$query_params = wp_parse_args( $query );
|
|
@@ -127,9 +191,12 @@ function block_core_navigation_link_maybe_urldecode( $url ) {
|
|
|
127
191
|
function render_block_core_navigation_link( $attributes, $content, $block ) {
|
|
128
192
|
// Check if this navigation item should render based on post status.
|
|
129
193
|
if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
194
|
+
$should_render = gutenberg_block_core_shared_navigation_item_should_render( $attributes, $block );
|
|
195
|
+
} else {
|
|
196
|
+
$should_render = block_core_shared_navigation_item_should_render( $attributes, $block );
|
|
197
|
+
}
|
|
198
|
+
if ( ! $should_render ) {
|
|
199
|
+
return '';
|
|
133
200
|
}
|
|
134
201
|
|
|
135
202
|
// Don't render the block's subtree if it has no label.
|
|
@@ -248,11 +248,12 @@ function UnforwardedLinkUI( props, ref ) {
|
|
|
248
248
|
setAddingPage( true );
|
|
249
249
|
} }
|
|
250
250
|
canAddPage={
|
|
251
|
+
blockEditingMode !== 'disabled' &&
|
|
251
252
|
permissions?.canCreate &&
|
|
252
253
|
type === 'page'
|
|
253
254
|
}
|
|
254
255
|
canAddBlock={
|
|
255
|
-
blockEditingMode
|
|
256
|
+
blockEditingMode !== 'disabled'
|
|
256
257
|
}
|
|
257
258
|
/>
|
|
258
259
|
);
|
|
@@ -76,9 +76,12 @@ function block_core_navigation_submenu_get_submenu_visibility( $context ) {
|
|
|
76
76
|
function render_block_core_navigation_submenu( $attributes, $content, $block ) {
|
|
77
77
|
// Check if this navigation item should render based on post status.
|
|
78
78
|
if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
79
|
+
$should_render = gutenberg_block_core_shared_navigation_item_should_render( $attributes, $block );
|
|
80
|
+
} else {
|
|
81
|
+
$should_render = block_core_shared_navigation_item_should_render( $attributes, $block );
|
|
82
|
+
}
|
|
83
|
+
if ( ! $should_render ) {
|
|
84
|
+
return '';
|
|
82
85
|
}
|
|
83
86
|
|
|
84
87
|
// Don't render the block's subtree if it has no label.
|
package/src/nextpage/editor.scss
CHANGED
package/src/page-list/index.php
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* Returns the submenu visibility value with backward compatibility
|
|
10
10
|
* for the deprecated openSubmenusOnClick attribute.
|
|
11
11
|
*
|
|
12
|
-
* @since
|
|
12
|
+
* @since 7.0.0
|
|
13
13
|
*
|
|
14
14
|
* @param array $context Block context from parent Navigation block.
|
|
15
15
|
* @return string The visibility mode: 'hover', 'click', or 'always'.
|
|
@@ -258,8 +258,9 @@ function render_block_core_page_list( $attributes, $content, $block ) {
|
|
|
258
258
|
static $block_id = 0;
|
|
259
259
|
++$block_id;
|
|
260
260
|
|
|
261
|
-
$
|
|
262
|
-
$
|
|
261
|
+
$parent_page_id_attr = $attributes['parentPageID'] ?? null;
|
|
262
|
+
$parent_page_id = is_scalar( $parent_page_id_attr ) ? (int) $parent_page_id_attr : 0;
|
|
263
|
+
$is_nested = ! empty( $block->context['core/isInsideSubmenu'] );
|
|
263
264
|
|
|
264
265
|
$all_pages = get_pages(
|
|
265
266
|
array(
|
package/src/paragraph/edit.js
CHANGED
|
@@ -19,11 +19,14 @@ import {
|
|
|
19
19
|
useBlockProps,
|
|
20
20
|
useSettings,
|
|
21
21
|
useBlockEditingMode,
|
|
22
|
+
privateApis as blockEditorPrivateApis,
|
|
22
23
|
store as blockEditorStore,
|
|
23
24
|
} from '@wordpress/block-editor';
|
|
24
25
|
import { useSelect } from '@wordpress/data';
|
|
25
26
|
import { getBlockSupport } from '@wordpress/blocks';
|
|
26
27
|
import { formatLTR } from '@wordpress/icons';
|
|
28
|
+
import { useContext } from '@wordpress/element';
|
|
29
|
+
|
|
27
30
|
/**
|
|
28
31
|
* Internal dependencies
|
|
29
32
|
*/
|
|
@@ -31,6 +34,8 @@ import { useOnEnter } from './use-enter';
|
|
|
31
34
|
import useDeprecatedAlign from './deprecated-attributes';
|
|
32
35
|
import { unlock } from '../lock-unlock';
|
|
33
36
|
|
|
37
|
+
const { PrivateBlockContext } = unlock( blockEditorPrivateApis );
|
|
38
|
+
|
|
34
39
|
function ParagraphRTLControl( { direction, setDirection } ) {
|
|
35
40
|
return (
|
|
36
41
|
isRTL() && (
|
|
@@ -131,6 +136,7 @@ function ParagraphBlock( {
|
|
|
131
136
|
style: { direction },
|
|
132
137
|
} );
|
|
133
138
|
const blockEditingMode = useBlockEditingMode();
|
|
139
|
+
const { ariaLabel } = useContext( PrivateBlockContext );
|
|
134
140
|
|
|
135
141
|
return (
|
|
136
142
|
<>
|
|
@@ -164,11 +170,12 @@ function ParagraphBlock( {
|
|
|
164
170
|
onReplace={ onReplace }
|
|
165
171
|
onRemove={ onRemove }
|
|
166
172
|
aria-label={
|
|
167
|
-
|
|
173
|
+
ariaLabel ??
|
|
174
|
+
( RichText.isEmpty( content )
|
|
168
175
|
? __(
|
|
169
176
|
'Empty block; start writing or type forward slash to choose a block'
|
|
170
177
|
)
|
|
171
|
-
: __( 'Block: Paragraph' )
|
|
178
|
+
: __( 'Block: Paragraph' ) )
|
|
172
179
|
}
|
|
173
180
|
data-empty={ RichText.isEmpty( content ) }
|
|
174
181
|
placeholder={ placeholder || __( 'Type / to choose a block' ) }
|
package/src/paragraph/index.js
CHANGED
|
@@ -16,7 +16,7 @@ import save from './save';
|
|
|
16
16
|
import transforms from './transforms';
|
|
17
17
|
import { unlock } from '../lock-unlock';
|
|
18
18
|
|
|
19
|
-
const { fieldsKey, formKey } = unlock( blocksPrivateApis );
|
|
19
|
+
const { fieldsKey, formKey, editableRootKey } = unlock( blocksPrivateApis );
|
|
20
20
|
|
|
21
21
|
const { name } = metadata;
|
|
22
22
|
|
|
@@ -24,6 +24,9 @@ export { metadata, name };
|
|
|
24
24
|
|
|
25
25
|
export const settings = {
|
|
26
26
|
icon,
|
|
27
|
+
// Opt into the editing host behaviour privately. It's a Symbol setting
|
|
28
|
+
// rather than a public `supports` key so it stays an internal detail.
|
|
29
|
+
[ editableRootKey ]: true,
|
|
27
30
|
example: {
|
|
28
31
|
attributes: {
|
|
29
32
|
content: __(
|
|
@@ -2,10 +2,8 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { useRef } from '@wordpress/element';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
privateApis as composePrivateApis,
|
|
8
|
-
} from '@wordpress/compose';
|
|
5
|
+
import { useRefEffect } from '@wordpress/compose';
|
|
6
|
+
import { privateApis as richTextPrivateApis } from '@wordpress/rich-text';
|
|
9
7
|
import { ENTER } from '@wordpress/keycodes';
|
|
10
8
|
import { useSelect, useDispatch, useRegistry } from '@wordpress/data';
|
|
11
9
|
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
@@ -21,7 +19,7 @@ import {
|
|
|
21
19
|
*/
|
|
22
20
|
import { unlock } from '../lock-unlock';
|
|
23
21
|
|
|
24
|
-
const {
|
|
22
|
+
const { subscribeOwnedListener } = unlock( richTextPrivateApis );
|
|
25
23
|
|
|
26
24
|
export function useOnEnter( props ) {
|
|
27
25
|
const { batch } = useRegistry();
|
|
@@ -131,11 +129,6 @@ export function useOnEnter( props ) {
|
|
|
131
129
|
|
|
132
130
|
// Capture phase so we run before writing-flow's ancestor-bubble
|
|
133
131
|
// keydown handlers that gate on `event.defaultPrevented`.
|
|
134
|
-
return
|
|
135
|
-
element,
|
|
136
|
-
'keydown',
|
|
137
|
-
onKeyDown,
|
|
138
|
-
true
|
|
139
|
-
);
|
|
132
|
+
return subscribeOwnedListener( element, 'keydown', onKeyDown, true );
|
|
140
133
|
}, [] );
|
|
141
134
|
}
|
package/src/pattern/index.php
CHANGED
|
@@ -33,18 +33,18 @@ function register_block_core_pattern() {
|
|
|
33
33
|
function render_block_core_pattern( $attributes ) {
|
|
34
34
|
static $seen_refs = array();
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
$slug = $attributes['slug'] ?? null;
|
|
37
|
+
if ( empty( $slug ) || ! is_string( $slug ) ) {
|
|
37
38
|
return '';
|
|
38
39
|
}
|
|
39
40
|
|
|
40
|
-
$slug = $attributes['slug'];
|
|
41
41
|
$registry = WP_Block_Patterns_Registry::get_instance();
|
|
42
42
|
|
|
43
43
|
if ( ! $registry->is_registered( $slug ) ) {
|
|
44
44
|
return '';
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
if ( isset( $seen_refs[ $
|
|
47
|
+
if ( isset( $seen_refs[ $slug ] ) ) {
|
|
48
48
|
// WP_DEBUG_DISPLAY must only be honored when WP_DEBUG. This precedent
|
|
49
49
|
// is set in `wp_debug_mode()`.
|
|
50
50
|
$is_debug = WP_DEBUG && WP_DEBUG_DISPLAY;
|
|
@@ -58,14 +58,14 @@ function render_block_core_pattern( $attributes ) {
|
|
|
58
58
|
$pattern = $registry->get_registered( $slug );
|
|
59
59
|
$content = $pattern['content'];
|
|
60
60
|
|
|
61
|
-
$seen_refs[ $
|
|
61
|
+
$seen_refs[ $slug ] = true;
|
|
62
62
|
|
|
63
63
|
$content = do_blocks( $content );
|
|
64
64
|
|
|
65
65
|
global $wp_embed;
|
|
66
66
|
$content = $wp_embed->autoembed( $content );
|
|
67
67
|
|
|
68
|
-
unset( $seen_refs[ $
|
|
68
|
+
unset( $seen_refs[ $slug ] );
|
|
69
69
|
return $content;
|
|
70
70
|
}
|
|
71
71
|
|