@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
|
@@ -35,7 +35,9 @@ function useIndentListItem(clientId) {
|
|
|
35
35
|
getSelectionStart,
|
|
36
36
|
getSelectionEnd,
|
|
37
37
|
hasMultiSelection,
|
|
38
|
-
getMultiSelectedBlockClientIds
|
|
38
|
+
getMultiSelectedBlockClientIds,
|
|
39
|
+
getBlockRootClientId,
|
|
40
|
+
getBlockAttributes
|
|
39
41
|
} = (0, import_data.useSelect)(import_block_editor.store);
|
|
40
42
|
return (0, import_element.useCallback)(() => {
|
|
41
43
|
const _hasMultiSelection = hasMultiSelection();
|
|
@@ -45,8 +47,14 @@ function useIndentListItem(clientId) {
|
|
|
45
47
|
);
|
|
46
48
|
const previousSiblingId = getPreviousBlockClientId(clientId);
|
|
47
49
|
const newListItem = (0, import_blocks.cloneBlock)(getBlock(previousSiblingId));
|
|
50
|
+
const parentListId = getBlockRootClientId(clientId);
|
|
51
|
+
const parentListAttributes = getBlockAttributes(parentListId);
|
|
48
52
|
if (!newListItem.innerBlocks?.length) {
|
|
49
|
-
newListItem.innerBlocks = [
|
|
53
|
+
newListItem.innerBlocks = [
|
|
54
|
+
(0, import_blocks.createBlock)("core/list", {
|
|
55
|
+
ordered: parentListAttributes.ordered
|
|
56
|
+
})
|
|
57
|
+
];
|
|
50
58
|
}
|
|
51
59
|
newListItem.innerBlocks[newListItem.innerBlocks.length - 1].innerBlocks.push(...clonedBlocks);
|
|
52
60
|
const selectionStart = getSelectionStart();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/list-item/hooks/use-indent-list-item.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useCallback } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { createBlock, cloneBlock } from '@wordpress/blocks';\n\nexport default function useIndentListItem( clientId ) {\n\tconst { replaceBlocks, selectionChange, multiSelect } =\n\t\tuseDispatch( blockEditorStore );\n\tconst {\n\t\tgetBlock,\n\t\tgetPreviousBlockClientId,\n\t\tgetSelectionStart,\n\t\tgetSelectionEnd,\n\t\thasMultiSelection,\n\t\tgetMultiSelectedBlockClientIds,\n\t} = useSelect( blockEditorStore );\n\treturn useCallback( () => {\n\t\tconst _hasMultiSelection = hasMultiSelection();\n\t\tconst clientIds = _hasMultiSelection\n\t\t\t? getMultiSelectedBlockClientIds()\n\t\t\t: [ clientId ];\n\t\tconst clonedBlocks = clientIds.map( ( _clientId ) =>\n\t\t\tcloneBlock( getBlock( _clientId ) )\n\t\t);\n\t\tconst previousSiblingId = getPreviousBlockClientId( clientId );\n\t\tconst newListItem = cloneBlock( getBlock( previousSiblingId ) );\n\t\t// If the sibling has no innerBlocks, create a new `list` block.\n\t\tif ( ! newListItem.innerBlocks?.length ) {\n\t\t\tnewListItem.innerBlocks = [
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAA4B;AAC5B,kBAAuC;AACvC,0BAA0C;AAC1C,oBAAwC;AAEzB,SAAR,kBAAoC,UAAW;AACrD,QAAM,EAAE,eAAe,iBAAiB,YAAY,QACnD,yBAAa,oBAAAA,KAAiB;AAC/B,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,QAAI,uBAAW,oBAAAA,KAAiB;AAChC,aAAO,4BAAa,MAAM;AACzB,UAAM,qBAAqB,kBAAkB;AAC7C,UAAM,YAAY,qBACf,+BAA+B,IAC/B,CAAE,QAAS;AACd,UAAM,eAAe,UAAU;AAAA,MAAK,CAAE,kBACrC,0BAAY,SAAU,SAAU,CAAE;AAAA,IACnC;AACA,UAAM,oBAAoB,yBAA0B,QAAS;AAC7D,UAAM,kBAAc,0BAAY,SAAU,iBAAkB,CAAE;AAE9D,QAAK,CAAE,YAAY,aAAa,QAAS;AACxC,kBAAY,cAAc,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useCallback } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { createBlock, cloneBlock } from '@wordpress/blocks';\n\nexport default function useIndentListItem( clientId ) {\n\tconst { replaceBlocks, selectionChange, multiSelect } =\n\t\tuseDispatch( blockEditorStore );\n\tconst {\n\t\tgetBlock,\n\t\tgetPreviousBlockClientId,\n\t\tgetSelectionStart,\n\t\tgetSelectionEnd,\n\t\thasMultiSelection,\n\t\tgetMultiSelectedBlockClientIds,\n\t\tgetBlockRootClientId,\n\t\tgetBlockAttributes,\n\t} = useSelect( blockEditorStore );\n\treturn useCallback( () => {\n\t\tconst _hasMultiSelection = hasMultiSelection();\n\t\tconst clientIds = _hasMultiSelection\n\t\t\t? getMultiSelectedBlockClientIds()\n\t\t\t: [ clientId ];\n\t\tconst clonedBlocks = clientIds.map( ( _clientId ) =>\n\t\t\tcloneBlock( getBlock( _clientId ) )\n\t\t);\n\t\tconst previousSiblingId = getPreviousBlockClientId( clientId );\n\t\tconst newListItem = cloneBlock( getBlock( previousSiblingId ) );\n\t\t// Get the parent list's attributes to inherit the ordered property\n\t\tconst parentListId = getBlockRootClientId( clientId );\n\t\tconst parentListAttributes = getBlockAttributes( parentListId );\n\t\t// If the sibling has no innerBlocks, create a new `list` block.\n\t\tif ( ! newListItem.innerBlocks?.length ) {\n\t\t\tnewListItem.innerBlocks = [\n\t\t\t\tcreateBlock( 'core/list', {\n\t\t\t\t\tordered: parentListAttributes.ordered,\n\t\t\t\t} ),\n\t\t\t];\n\t\t}\n\t\t// A list item usually has one `list`, but it's possible to have\n\t\t// more. So we need to preserve the previous `list` blocks and\n\t\t// merge the new blocks to the last `list`.\n\t\tnewListItem.innerBlocks[\n\t\t\tnewListItem.innerBlocks.length - 1\n\t\t].innerBlocks.push( ...clonedBlocks );\n\n\t\t// We get the selection start/end here, because when\n\t\t// we replace blocks, the selection is updated too.\n\t\tconst selectionStart = getSelectionStart();\n\t\tconst selectionEnd = getSelectionEnd();\n\t\t// Replace the previous sibling of the block being indented and the indented blocks,\n\t\t// with a new block whose attributes are equal to the ones of the previous sibling and\n\t\t// whose descendants are the children of the previous sibling, followed by the indented blocks.\n\t\treplaceBlocks( [ previousSiblingId, ...clientIds ], [ newListItem ] );\n\t\tif ( ! _hasMultiSelection ) {\n\t\t\tselectionChange(\n\t\t\t\tclonedBlocks[ 0 ].clientId,\n\t\t\t\tselectionEnd.attributeKey,\n\t\t\t\tselectionEnd.clientId === selectionStart.clientId\n\t\t\t\t\t? selectionStart.offset\n\t\t\t\t\t: selectionEnd.offset,\n\t\t\t\tselectionEnd.offset\n\t\t\t);\n\t\t} else {\n\t\t\tmultiSelect(\n\t\t\t\tclonedBlocks[ 0 ].clientId,\n\t\t\t\tclonedBlocks[ clonedBlocks.length - 1 ].clientId\n\t\t\t);\n\t\t}\n\n\t\treturn true;\n\t}, [ clientId ] );\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAA4B;AAC5B,kBAAuC;AACvC,0BAA0C;AAC1C,oBAAwC;AAEzB,SAAR,kBAAoC,UAAW;AACrD,QAAM,EAAE,eAAe,iBAAiB,YAAY,QACnD,yBAAa,oBAAAA,KAAiB;AAC/B,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,QAAI,uBAAW,oBAAAA,KAAiB;AAChC,aAAO,4BAAa,MAAM;AACzB,UAAM,qBAAqB,kBAAkB;AAC7C,UAAM,YAAY,qBACf,+BAA+B,IAC/B,CAAE,QAAS;AACd,UAAM,eAAe,UAAU;AAAA,MAAK,CAAE,kBACrC,0BAAY,SAAU,SAAU,CAAE;AAAA,IACnC;AACA,UAAM,oBAAoB,yBAA0B,QAAS;AAC7D,UAAM,kBAAc,0BAAY,SAAU,iBAAkB,CAAE;AAE9D,UAAM,eAAe,qBAAsB,QAAS;AACpD,UAAM,uBAAuB,mBAAoB,YAAa;AAE9D,QAAK,CAAE,YAAY,aAAa,QAAS;AACxC,kBAAY,cAAc;AAAA,YACzB,2BAAa,aAAa;AAAA,UACzB,SAAS,qBAAqB;AAAA,QAC/B,CAAE;AAAA,MACH;AAAA,IACD;AAIA,gBAAY,YACX,YAAY,YAAY,SAAS,CAClC,EAAE,YAAY,KAAM,GAAG,YAAa;AAIpC,UAAM,iBAAiB,kBAAkB;AACzC,UAAM,eAAe,gBAAgB;AAIrC,kBAAe,CAAE,mBAAmB,GAAG,SAAU,GAAG,CAAE,WAAY,CAAE;AACpE,QAAK,CAAE,oBAAqB;AAC3B;AAAA,QACC,aAAc,CAAE,EAAE;AAAA,QAClB,aAAa;AAAA,QACb,aAAa,aAAa,eAAe,WACtC,eAAe,SACf,aAAa;AAAA,QAChB,aAAa;AAAA,MACd;AAAA,IACD,OAAO;AACN;AAAA,QACC,aAAc,CAAE,EAAE;AAAA,QAClB,aAAc,aAAa,SAAS,CAAE,EAAE;AAAA,MACzC;AAAA,IACD;AAEA,WAAO;AAAA,EACR,GAAG,CAAE,QAAS,CAAE;AACjB;",
|
|
6
6
|
"names": ["blockEditorStore"]
|
|
7
7
|
}
|
|
@@ -34,13 +34,14 @@ __export(use_space_exports, {
|
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(use_space_exports);
|
|
36
36
|
var import_compose = require("@wordpress/compose");
|
|
37
|
+
var import_rich_text = require("@wordpress/rich-text");
|
|
37
38
|
var import_keycodes = require("@wordpress/keycodes");
|
|
38
39
|
var import_block_editor = require("@wordpress/block-editor");
|
|
39
40
|
var import_data = require("@wordpress/data");
|
|
40
41
|
var import_use_indent_list_item = __toESM(require("./use-indent-list-item.cjs"));
|
|
41
42
|
var import_use_outdent_list_item = __toESM(require("./use-outdent-list-item.cjs"));
|
|
42
43
|
var import_lock_unlock = require("../../lock-unlock.cjs");
|
|
43
|
-
var {
|
|
44
|
+
var { subscribeOwnedListener } = (0, import_lock_unlock.unlock)(import_rich_text.privateApis);
|
|
44
45
|
function useSpace(clientId) {
|
|
45
46
|
const { getSelectionStart, getSelectionEnd, getBlockIndex } = (0, import_data.useSelect)(import_block_editor.store);
|
|
46
47
|
const indentListItem = (0, import_use_indent_list_item.default)(clientId);
|
|
@@ -69,7 +70,7 @@ function useSpace(clientId) {
|
|
|
69
70
|
}
|
|
70
71
|
}
|
|
71
72
|
}
|
|
72
|
-
return
|
|
73
|
+
return subscribeOwnedListener(
|
|
73
74
|
element,
|
|
74
75
|
"keydown",
|
|
75
76
|
onKeyDown,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/list-item/hooks/use-space.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,
|
|
6
|
-
"names": ["
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useRefEffect } from '@wordpress/compose';\nimport { privateApis as richTextPrivateApis } from '@wordpress/rich-text';\nimport { SPACE, TAB } from '@wordpress/keycodes';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport useIndentListItem from './use-indent-list-item';\nimport useOutdentListItem from './use-outdent-list-item';\nimport { unlock } from '../../lock-unlock';\n\nconst { subscribeOwnedListener } = unlock( richTextPrivateApis );\n\nexport default function useSpace( clientId ) {\n\tconst { getSelectionStart, getSelectionEnd, getBlockIndex } =\n\t\tuseSelect( blockEditorStore );\n\tconst indentListItem = useIndentListItem( clientId );\n\tconst outdentListItem = useOutdentListItem();\n\n\treturn useRefEffect(\n\t\t( element ) => {\n\t\t\tfunction onKeyDown( event ) {\n\t\t\t\tconst { keyCode, shiftKey, altKey, metaKey, ctrlKey } = event;\n\n\t\t\t\tif (\n\t\t\t\t\tevent.defaultPrevented ||\n\t\t\t\t\t( keyCode !== SPACE && keyCode !== TAB ) ||\n\t\t\t\t\t// Only override when no modifiers are pressed.\n\t\t\t\t\taltKey ||\n\t\t\t\t\tmetaKey ||\n\t\t\t\t\tctrlKey\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst selectionStart = getSelectionStart();\n\t\t\t\tconst selectionEnd = getSelectionEnd();\n\t\t\t\tif (\n\t\t\t\t\tselectionStart.offset === 0 &&\n\t\t\t\t\tselectionEnd.offset === 0\n\t\t\t\t) {\n\t\t\t\t\tif ( shiftKey ) {\n\t\t\t\t\t\t// Note that backspace behaviour in defined in onMerge.\n\t\t\t\t\t\tif ( keyCode === TAB ) {\n\t\t\t\t\t\t\tif ( outdentListItem() ) {\n\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if ( getBlockIndex( clientId ) !== 0 ) {\n\t\t\t\t\t\tif ( indentListItem() ) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Capture phase so we run before writing-flow's ancestor-bubble\n\t\t\t// keydown handlers that gate on `event.defaultPrevented`.\n\t\t\treturn subscribeOwnedListener(\n\t\t\t\telement,\n\t\t\t\t'keydown',\n\t\t\t\tonKeyDown,\n\t\t\t\ttrue\n\t\t\t);\n\t\t},\n\t\t[ clientId, indentListItem ]\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAA6B;AAC7B,uBAAmD;AACnD,sBAA2B;AAC3B,0BAA0C;AAC1C,kBAA0B;AAK1B,kCAA8B;AAC9B,mCAA+B;AAC/B,yBAAuB;AAEvB,IAAM,EAAE,uBAAuB,QAAI,2BAAQ,iBAAAA,WAAoB;AAEhD,SAAR,SAA2B,UAAW;AAC5C,QAAM,EAAE,mBAAmB,iBAAiB,cAAc,QACzD,uBAAW,oBAAAC,KAAiB;AAC7B,QAAM,qBAAiB,4BAAAC,SAAmB,QAAS;AACnD,QAAM,sBAAkB,6BAAAC,SAAmB;AAE3C,aAAO;AAAA,IACN,CAAE,YAAa;AACd,eAAS,UAAW,OAAQ;AAC3B,cAAM,EAAE,SAAS,UAAU,QAAQ,SAAS,QAAQ,IAAI;AAExD,YACC,MAAM,oBACJ,YAAY,yBAAS,YAAY;AAAA,QAEnC,UACA,WACA,SACC;AACD;AAAA,QACD;AAEA,cAAM,iBAAiB,kBAAkB;AACzC,cAAM,eAAe,gBAAgB;AACrC,YACC,eAAe,WAAW,KAC1B,aAAa,WAAW,GACvB;AACD,cAAK,UAAW;AAEf,gBAAK,YAAY,qBAAM;AACtB,kBAAK,gBAAgB,GAAI;AACxB,sBAAM,eAAe;AAAA,cACtB;AAAA,YACD;AAAA,UACD,WAAY,cAAe,QAAS,MAAM,GAAI;AAC7C,gBAAK,eAAe,GAAI;AACvB,oBAAM,eAAe;AAAA,YACtB;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAIA,aAAO;AAAA,QACN;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACD;AAAA,IACD;AAAA,IACA,CAAE,UAAU,cAAe;AAAA,EAC5B;AACD;",
|
|
6
|
+
"names": ["richTextPrivateApis", "blockEditorStore", "useIndentListItem", "useOutdentListItem"]
|
|
7
7
|
}
|
package/build/math/edit.cjs
CHANGED
|
@@ -38,16 +38,16 @@ var import_block_editor = require("@wordpress/block-editor");
|
|
|
38
38
|
var import_components = require("@wordpress/components");
|
|
39
39
|
var import_element = require("@wordpress/element");
|
|
40
40
|
var import_data = require("@wordpress/data");
|
|
41
|
-
var import_a11y = require("@wordpress/a11y");
|
|
42
41
|
var import_lock_unlock = require("../lock-unlock.cjs");
|
|
43
42
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
44
|
-
var {
|
|
43
|
+
var { ValidatedTextareaControl } = (0, import_lock_unlock.unlock)(import_components.privateApis);
|
|
45
44
|
function MathEdit({ attributes, setAttributes, isSelected }) {
|
|
46
45
|
const { latex, mathML } = attributes;
|
|
47
46
|
const [blockRef, setBlockRef] = (0, import_element.useState)();
|
|
48
47
|
const [error, setError] = (0, import_element.useState)(null);
|
|
49
48
|
const [latexToMathML, setLatexToMathML] = (0, import_element.useState)();
|
|
50
49
|
const initialLatex = (0, import_element.useRef)(latex);
|
|
50
|
+
const formRef = (0, import_element.useRef)();
|
|
51
51
|
const { __unstableMarkNextChangeAsNotPersistent } = (0, import_data.useDispatch)(import_block_editor.store);
|
|
52
52
|
(0, import_element.useEffect)(() => {
|
|
53
53
|
import("@wordpress/latex-to-mathml").then((module2) => {
|
|
@@ -85,63 +85,46 @@ function MathEdit({ attributes, setAttributes, isSelected }) {
|
|
|
85
85
|
offset: 8,
|
|
86
86
|
anchor: blockRef,
|
|
87
87
|
focusOnMount: false,
|
|
88
|
+
onFocusOutside: () => formRef.current?.reportValidity(),
|
|
88
89
|
__unstableSlotName: "__unstable-block-tools-after",
|
|
89
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
className: "wp-block-math__textarea-control",
|
|
98
|
-
onChange: (newLatex) => {
|
|
99
|
-
if (!latexToMathML) {
|
|
100
|
-
setAttributes({ latex: newLatex });
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
let newMathML = "";
|
|
104
|
-
try {
|
|
105
|
-
newMathML = latexToMathML(newLatex, {
|
|
106
|
-
displayMode: true
|
|
107
|
-
});
|
|
108
|
-
setError(null);
|
|
109
|
-
} catch (err) {
|
|
110
|
-
setError(err.message);
|
|
111
|
-
(0, import_a11y.speak)(
|
|
112
|
-
(0, import_i18n.sprintf)(
|
|
113
|
-
/* translators: %s: error message returned when parsing LaTeX. */
|
|
114
|
-
(0, import_i18n.__)(
|
|
115
|
-
"Error parsing mathematical expression: %s"
|
|
116
|
-
),
|
|
117
|
-
err.message
|
|
118
|
-
)
|
|
119
|
-
);
|
|
120
|
-
}
|
|
121
|
-
setAttributes({
|
|
122
|
-
mathML: newMathML,
|
|
123
|
-
latex: newLatex
|
|
124
|
-
});
|
|
125
|
-
},
|
|
126
|
-
placeholder: (0, import_i18n.__)("e.g., x^2, \\frac{a}{b}")
|
|
127
|
-
}
|
|
128
|
-
),
|
|
129
|
-
error && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
130
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
131
|
-
WCBadge,
|
|
90
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
91
|
+
"form",
|
|
92
|
+
{
|
|
93
|
+
ref: formRef,
|
|
94
|
+
style: { padding: "4px", minWidth: "300px" },
|
|
95
|
+
onSubmit: (event) => event.preventDefault(),
|
|
96
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
97
|
+
ValidatedTextareaControl,
|
|
132
98
|
{
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
99
|
+
label: (0, import_i18n.__)("LaTeX math syntax"),
|
|
100
|
+
hideLabelFromVision: true,
|
|
101
|
+
value: latex,
|
|
102
|
+
className: "wp-block-math__textarea-control",
|
|
103
|
+
customValidity: error ? { type: "invalid", message: error } : void 0,
|
|
104
|
+
onChange: (newLatex) => {
|
|
105
|
+
if (!latexToMathML) {
|
|
106
|
+
setAttributes({ latex: newLatex });
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
let newMathML = "";
|
|
110
|
+
try {
|
|
111
|
+
newMathML = latexToMathML(newLatex, {
|
|
112
|
+
displayMode: true
|
|
113
|
+
});
|
|
114
|
+
setError(null);
|
|
115
|
+
} catch (err) {
|
|
116
|
+
setError(err.message);
|
|
117
|
+
}
|
|
118
|
+
setAttributes({
|
|
119
|
+
mathML: newMathML,
|
|
120
|
+
latex: newLatex
|
|
121
|
+
});
|
|
122
|
+
},
|
|
123
|
+
placeholder: (0, import_i18n.__)("e.g., x^2, \\frac{a}{b}")
|
|
140
124
|
}
|
|
141
|
-
)
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
] }) })
|
|
125
|
+
)
|
|
126
|
+
}
|
|
127
|
+
)
|
|
145
128
|
}
|
|
146
129
|
)
|
|
147
130
|
] });
|
package/build/math/edit.cjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/math/edit.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,
|
|
6
|
-
"names": ["componentsPrivateApis", "blockEditorStore", "module"
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tuseBlockProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport {\n\tPopover,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { useState, useEffect, useRef } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\n\nconst { ValidatedTextareaControl } = unlock( componentsPrivateApis );\n\nexport default function MathEdit( { attributes, setAttributes, isSelected } ) {\n\tconst { latex, mathML } = attributes;\n\tconst [ blockRef, setBlockRef ] = useState();\n\tconst [ error, setError ] = useState( null );\n\tconst [ latexToMathML, setLatexToMathML ] = useState();\n\tconst initialLatex = useRef( latex );\n\tconst formRef = useRef();\n\tconst { __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\n\tuseEffect( () => {\n\t\timport( '@wordpress/latex-to-mathml' ).then( ( module ) => {\n\t\t\tsetLatexToMathML( () => module.default );\n\t\t\tif ( initialLatex.current ) {\n\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\tsetAttributes( {\n\t\t\t\t\tmathML: module.default( initialLatex.current, {\n\t\t\t\t\t\tdisplayMode: true,\n\t\t\t\t\t} ),\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\t}, [\n\t\tinitialLatex,\n\t\tsetAttributes,\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t] );\n\n\tconst blockProps = useBlockProps( {\n\t\tref: setBlockRef,\n\t\tposition: 'relative',\n\t} );\n\n\treturn (\n\t\t<div { ...blockProps }>\n\t\t\t{ mathML ? (\n\t\t\t\t<math\n\t\t\t\t\t// We can't spread block props on the math element because\n\t\t\t\t\t// it only supports a limited amount of global attributes.\n\t\t\t\t\t// For example, draggable will have no effect.\n\t\t\t\t\tdisplay=\"block\"\n\t\t\t\t\tdangerouslySetInnerHTML={ { __html: mathML } }\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t'\\u200B'\n\t\t\t) }\n\t\t\t{ isSelected && (\n\t\t\t\t<Popover\n\t\t\t\t\tplacement=\"bottom-start\"\n\t\t\t\t\toffset={ 8 }\n\t\t\t\t\tanchor={ blockRef }\n\t\t\t\t\tfocusOnMount={ false }\n\t\t\t\t\t// Surface any parsing error before focus leaves the block.\n\t\t\t\t\t// An invalid field is refocused, keeping the popover open.\n\t\t\t\t\tonFocusOutside={ () => formRef.current?.reportValidity() }\n\t\t\t\t\t__unstableSlotName=\"__unstable-block-tools-after\"\n\t\t\t\t>\n\t\t\t\t\t<form\n\t\t\t\t\t\tref={ formRef }\n\t\t\t\t\t\tstyle={ { padding: '4px', minWidth: '300px' } }\n\t\t\t\t\t\tonSubmit={ ( event ) => event.preventDefault() }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ValidatedTextareaControl\n\t\t\t\t\t\t\tlabel={ __( 'LaTeX math syntax' ) }\n\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\tvalue={ latex }\n\t\t\t\t\t\t\tclassName=\"wp-block-math__textarea-control\"\n\t\t\t\t\t\t\tcustomValidity={\n\t\t\t\t\t\t\t\terror\n\t\t\t\t\t\t\t\t\t? { type: 'invalid', message: error }\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonChange={ ( newLatex ) => {\n\t\t\t\t\t\t\t\tif ( ! latexToMathML ) {\n\t\t\t\t\t\t\t\t\tsetAttributes( { latex: newLatex } );\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tlet newMathML = '';\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tnewMathML = latexToMathML( newLatex, {\n\t\t\t\t\t\t\t\t\t\tdisplayMode: true,\n\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\tsetError( null );\n\t\t\t\t\t\t\t\t} catch ( err ) {\n\t\t\t\t\t\t\t\t\tsetError( err.message );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tmathML: newMathML,\n\t\t\t\t\t\t\t\t\tlatex: newLatex,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tplaceholder={ __( 'e.g., x^2, \\\\frac{a}{b}' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</form>\n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;AAAA;AAAA,QACA,WAAU;AAAA,QACV,QAAS;AAAA,QACT,QAAS;AAAA,QACT,cAAe;AAAA,QAGf,gBAAiB,MAAM,QAAQ,SAAS,eAAe;AAAA,QACvD,oBAAmB;AAAA,QAEnB;AAAA,UAAC;AAAA;AAAA,YACA,KAAM;AAAA,YACN,OAAQ,EAAE,SAAS,OAAO,UAAU,QAAQ;AAAA,YAC5C,UAAW,CAAE,UAAW,MAAM,eAAe;AAAA,YAE7C;AAAA,cAAC;AAAA;AAAA,gBACA,WAAQ,gBAAI,mBAAoB;AAAA,gBAChC,qBAAmB;AAAA,gBACnB,OAAQ;AAAA,gBACR,WAAU;AAAA,gBACV,gBACC,QACG,EAAE,MAAM,WAAW,SAAS,MAAM,IAClC;AAAA,gBAEJ,UAAW,CAAE,aAAc;AAC1B,sBAAK,CAAE,eAAgB;AACtB,kCAAe,EAAE,OAAO,SAAS,CAAE;AACnC;AAAA,kBACD;AACA,sBAAI,YAAY;AAChB,sBAAI;AACH,gCAAY,cAAe,UAAU;AAAA,sBACpC,aAAa;AAAA,oBACd,CAAE;AACF,6BAAU,IAAK;AAAA,kBAChB,SAAU,KAAM;AACf,6BAAU,IAAI,OAAQ;AAAA,kBACvB;AACA,gCAAe;AAAA,oBACd,QAAQ;AAAA,oBACR,OAAO;AAAA,kBACR,CAAE;AAAA,gBACH;AAAA,gBACA,iBAAc,gBAAI,yBAA0B;AAAA;AAAA,YAC7C;AAAA;AAAA,QACD;AAAA;AAAA,IACD;AAAA,KAEF;AAEF;",
|
|
6
|
+
"names": ["componentsPrivateApis", "blockEditorStore", "module"]
|
|
7
7
|
}
|
|
@@ -438,7 +438,8 @@ function MediaTextEdit({
|
|
|
438
438
|
import_block_editor.BlockVerticalAlignmentControl,
|
|
439
439
|
{
|
|
440
440
|
onChange: onVerticalAlignmentChange,
|
|
441
|
-
value: verticalAlignment
|
|
441
|
+
value: verticalAlignment,
|
|
442
|
+
label: (0, import_i18n.__)("Align media and text vertically")
|
|
442
443
|
}
|
|
443
444
|
),
|
|
444
445
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/media-text/edit.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { useState, useRef } from '@wordpress/element';\nimport {\n\tBlockControls,\n\tBlockVerticalAlignmentControl,\n\tuseInnerBlocksProps,\n\tInspectorControls,\n\tuseBlockProps,\n\t__experimentalImageURLInputUI as ImageURLInputUI,\n\tstore as blockEditorStore,\n\tuseBlockEditingMode,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport {\n\tRangeControl,\n\tTextareaControl,\n\tToggleControl,\n\tToolbarButton,\n\tExternalLink,\n\tFocalPointPicker,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { isBlobURL, getBlobTypeByURL } from '@wordpress/blob';\nimport { pullLeft, pullRight } from '@wordpress/icons';\nimport { useEntityProp, store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport MediaContainer from './media-container';\nimport {\n\tDEFAULT_MEDIA_SIZE_SLUG,\n\tWIDTH_CONSTRAINT_PERCENTAGE,\n\tLINK_DESTINATION_NONE,\n\tLINK_DESTINATION_MEDIA,\n\tLINK_DESTINATION_ATTACHMENT,\n\tTEMPLATE,\n} from './constants';\nimport { unlock } from '../lock-unlock';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\nconst { ResolutionTool } = unlock( blockEditorPrivateApis );\n\n// this limits the resize to a safe zone to avoid making broken layouts\nconst applyWidthConstraints = ( width ) =>\n\tMath.max(\n\t\tWIDTH_CONSTRAINT_PERCENTAGE,\n\t\tMath.min( width, 100 - WIDTH_CONSTRAINT_PERCENTAGE )\n\t);\n\nfunction getImageSourceUrlBySizeSlug( image, slug ) {\n\treturn image?.media_details?.sizes?.[ slug ]?.source_url;\n}\n\nfunction attributesFromMedia( {\n\tattributes: { linkDestination, href },\n\tsetAttributes,\n} ) {\n\treturn ( media ) => {\n\t\tif ( ! media || ! media.url ) {\n\t\t\tsetAttributes( {\n\t\t\t\tmediaAlt: undefined,\n\t\t\t\tmediaId: undefined,\n\t\t\t\tmediaType: undefined,\n\t\t\t\tmediaUrl: undefined,\n\t\t\t\tmediaLink: undefined,\n\t\t\t\thref: undefined,\n\t\t\t\tfocalPoint: undefined,\n\t\t\t\tuseFeaturedImage: false,\n\t\t\t} );\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isBlobURL( media.url ) ) {\n\t\t\tmedia.type = getBlobTypeByURL( media.url );\n\t\t}\n\n\t\tlet mediaType;\n\t\tlet src;\n\t\t// For media selections originated from a file upload.\n\t\tif ( media.media_type ) {\n\t\t\tif ( media.media_type === 'image' ) {\n\t\t\t\tmediaType = 'image';\n\t\t\t} else {\n\t\t\t\t// only images and videos are accepted so if the media_type is not an image we can assume it is a video.\n\t\t\t\t// video contain the media type of 'file' in the object returned from the rest api.\n\t\t\t\tmediaType = 'video';\n\t\t\t}\n\t\t} else {\n\t\t\t// For media selections originated from existing files in the media library.\n\t\t\tmediaType = media.type;\n\t\t}\n\n\t\tif ( mediaType === 'image' ) {\n\t\t\t// Try the \"large\" size URL, falling back to the \"full\" size URL below.\n\t\t\tsrc =\n\t\t\t\tmedia.sizes?.large?.url ||\n\t\t\t\tmedia.media_details?.sizes?.large?.source_url;\n\t\t}\n\n\t\tlet newLinkDestination = linkDestination;\n\t\tlet newHref = href;\n\n\t\t// Only apply default link behavior for images (not videos).\n\t\tif ( mediaType === 'image' ) {\n\t\t\t// Check if default link setting should be used.\n\t\t\tif ( ! newLinkDestination ) {\n\t\t\t\t// Use the WordPress option to determine the proper default.\n\t\t\t\t// The constants used in Gutenberg do not match WP options so a little more complicated than ideal.\n\t\t\t\tswitch (\n\t\t\t\t\twindow?.wp?.media?.view?.settings?.defaultProps?.link ||\n\t\t\t\t\tLINK_DESTINATION_NONE\n\t\t\t\t) {\n\t\t\t\t\tcase 'file':\n\t\t\t\t\tcase LINK_DESTINATION_MEDIA:\n\t\t\t\t\t\tnewLinkDestination = LINK_DESTINATION_MEDIA;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'post':\n\t\t\t\t\tcase LINK_DESTINATION_ATTACHMENT:\n\t\t\t\t\t\tnewLinkDestination = LINK_DESTINATION_ATTACHMENT;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase LINK_DESTINATION_NONE:\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tnewLinkDestination = LINK_DESTINATION_NONE;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Set href based on linkDestination.\n\t\t\tswitch ( newLinkDestination ) {\n\t\t\t\tcase LINK_DESTINATION_MEDIA:\n\t\t\t\t\tnewHref = media.url;\n\t\t\t\t\tbreak;\n\t\t\t\tcase LINK_DESTINATION_ATTACHMENT:\n\t\t\t\t\tnewHref = media.link;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tsetAttributes( {\n\t\t\tmediaAlt: media.alt,\n\t\t\tmediaId: media.id,\n\t\t\tmediaType,\n\t\t\tmediaUrl: src || media.url,\n\t\t\tmediaLink: media.link || undefined,\n\t\t\thref: newHref,\n\t\t\tlinkDestination: newLinkDestination,\n\t\t\tfocalPoint: undefined,\n\t\t\tuseFeaturedImage: false,\n\t\t} );\n\t};\n}\n\nfunction MediaTextResolutionTool( { image, value, onChange } ) {\n\tconst { imageSizes } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn {\n\t\t\timageSizes: getSettings().imageSizes,\n\t\t};\n\t}, [] );\n\n\tif ( ! imageSizes?.length ) {\n\t\treturn null;\n\t}\n\n\tconst imageSizeOptions = imageSizes\n\t\t.filter( ( { slug } ) => getImageSourceUrlBySizeSlug( image, slug ) )\n\t\t.map( ( { name, slug } ) => ( { value: slug, label: name } ) );\n\n\treturn (\n\t\t<ResolutionTool\n\t\t\tvalue={ value }\n\t\t\tdefaultValue={ DEFAULT_MEDIA_SIZE_SLUG }\n\t\t\toptions={ imageSizeOptions }\n\t\t\tonChange={ onChange }\n\t\t/>\n\t);\n}\n\nfunction MediaTextEdit( {\n\tattributes,\n\tisSelected,\n\tsetAttributes,\n\tcontext: { postId, postType },\n} ) {\n\tconst {\n\t\tfocalPoint,\n\t\thref,\n\t\timageFill,\n\t\tisStackedOnMobile,\n\t\tlinkClass,\n\t\tlinkDestination,\n\t\tlinkTarget,\n\t\tmediaAlt,\n\t\tmediaId,\n\t\tmediaPosition,\n\t\tmediaType,\n\t\tmediaUrl,\n\t\tmediaWidth,\n\t\tmediaSizeSlug,\n\t\trel,\n\t\tverticalAlignment,\n\t\tallowedBlocks,\n\t\tuseFeaturedImage,\n\t} = attributes;\n\n\tconst [ featuredImage ] = useEntityProp(\n\t\t'postType',\n\t\tpostType,\n\t\t'featured_media',\n\t\tpostId\n\t);\n\n\tconst { featuredImageMedia } = useSelect(\n\t\t( select ) => {\n\t\t\treturn {\n\t\t\t\tfeaturedImageMedia:\n\t\t\t\t\tfeaturedImage && useFeaturedImage\n\t\t\t\t\t\t? select( coreStore ).getEntityRecord(\n\t\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\t\t'attachment',\n\t\t\t\t\t\t\t\tfeaturedImage,\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tcontext: 'view',\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: undefined,\n\t\t\t};\n\t\t},\n\t\t[ featuredImage, useFeaturedImage ]\n\t);\n\n\tconst { image } = useSelect(\n\t\t( select ) => {\n\t\t\treturn {\n\t\t\t\timage:\n\t\t\t\t\tmediaId && isSelected\n\t\t\t\t\t\t? select( coreStore ).getEntityRecord(\n\t\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\t\t'attachment',\n\t\t\t\t\t\t\t\tmediaId,\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tcontext: 'view',\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: null,\n\t\t\t};\n\t\t},\n\t\t[ isSelected, mediaId ]\n\t);\n\n\tconst featuredImageURL = useFeaturedImage\n\t\t? featuredImageMedia?.source_url\n\t\t: '';\n\tconst featuredImageAlt = useFeaturedImage\n\t\t? featuredImageMedia?.alt_text\n\t\t: '';\n\n\tconst toggleUseFeaturedImage = () => {\n\t\tsetAttributes( {\n\t\t\timageFill: false,\n\t\t\tmediaType: 'image',\n\t\t\tmediaId: undefined,\n\t\t\tmediaUrl: undefined,\n\t\t\tmediaAlt: undefined,\n\t\t\tmediaLink: undefined,\n\t\t\tlinkDestination: undefined,\n\t\t\tlinkTarget: undefined,\n\t\t\tlinkClass: undefined,\n\t\t\trel: undefined,\n\t\t\thref: undefined,\n\t\t\tuseFeaturedImage: ! useFeaturedImage,\n\t\t} );\n\t};\n\n\tconst refMedia = useRef();\n\tconst imperativeFocalPointPreview = ( value ) => {\n\t\tconst { style } = refMedia.current;\n\t\tconst { x, y } = value;\n\t\tstyle.objectPosition = `${ x * 100 }% ${ y * 100 }%`;\n\t};\n\n\tconst [ temporaryMediaWidth, setTemporaryMediaWidth ] = useState( null );\n\n\tconst onSelectMedia = attributesFromMedia( { attributes, setAttributes } );\n\n\tconst onSetHref = ( props ) => {\n\t\tsetAttributes( props );\n\t};\n\n\tconst onWidthChange = ( width ) => {\n\t\tsetTemporaryMediaWidth( applyWidthConstraints( width ) );\n\t};\n\tconst commitWidthChange = ( width ) => {\n\t\tsetAttributes( {\n\t\t\tmediaWidth: applyWidthConstraints( width ),\n\t\t} );\n\t\tsetTemporaryMediaWidth( null );\n\t};\n\n\tconst classNames = clsx( {\n\t\t'has-media-on-the-right': 'right' === mediaPosition,\n\t\t'is-selected': isSelected,\n\t\t'is-stacked-on-mobile': isStackedOnMobile,\n\t\t[ `is-vertically-aligned-${ verticalAlignment }` ]: verticalAlignment,\n\t\t'is-image-fill-element': imageFill,\n\t} );\n\tconst widthString = `${ temporaryMediaWidth || mediaWidth }%`;\n\tconst gridTemplateColumns =\n\t\t'right' === mediaPosition\n\t\t\t? `1fr ${ widthString }`\n\t\t\t: `${ widthString } 1fr`;\n\tconst style = {\n\t\tgridTemplateColumns,\n\t\tmsGridColumns: gridTemplateColumns,\n\t};\n\tconst onMediaAltChange = ( newMediaAlt ) => {\n\t\tsetAttributes( { mediaAlt: newMediaAlt } );\n\t};\n\tconst onVerticalAlignmentChange = ( alignment ) => {\n\t\tsetAttributes( { verticalAlignment: alignment } );\n\t};\n\tconst updateImage = ( newMediaSizeSlug ) => {\n\t\tconst newUrl = getImageSourceUrlBySizeSlug( image, newMediaSizeSlug );\n\n\t\tif ( ! newUrl ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tsetAttributes( {\n\t\t\tmediaUrl: newUrl,\n\t\t\tmediaSizeSlug: newMediaSizeSlug,\n\t\t} );\n\t};\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tconst mediaTextGeneralSettings = (\n\t\t<ToolsPanel\n\t\t\tlabel={ __( 'Settings' ) }\n\t\t\tresetAll={ () => {\n\t\t\t\tsetAttributes( {\n\t\t\t\t\tisStackedOnMobile: true,\n\t\t\t\t\timageFill: false,\n\t\t\t\t\tmediaAlt: '',\n\t\t\t\t\tfocalPoint: undefined,\n\t\t\t\t\tmediaWidth: 50,\n\t\t\t\t} );\n\t\t\t\tupdateImage( DEFAULT_MEDIA_SIZE_SLUG );\n\t\t\t} }\n\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t>\n\t\t\t<ToolsPanelItem\n\t\t\t\tlabel={ __( 'Media width' ) }\n\t\t\t\tisShownByDefault\n\t\t\t\thasValue={ () => mediaWidth !== 50 }\n\t\t\t\tonDeselect={ () => setAttributes( { mediaWidth: 50 } ) }\n\t\t\t>\n\t\t\t\t<RangeControl\n\t\t\t\t\tlabel={ __( 'Media width' ) }\n\t\t\t\t\tvalue={ temporaryMediaWidth || mediaWidth }\n\t\t\t\t\tonChange={ commitWidthChange }\n\t\t\t\t\tmin={ WIDTH_CONSTRAINT_PERCENTAGE }\n\t\t\t\t\tmax={ 100 - WIDTH_CONSTRAINT_PERCENTAGE }\n\t\t\t\t/>\n\t\t\t</ToolsPanelItem>\n\t\t\t<ToolsPanelItem\n\t\t\t\tlabel={ __( 'Stack on mobile' ) }\n\t\t\t\tisShownByDefault\n\t\t\t\thasValue={ () => ! isStackedOnMobile }\n\t\t\t\tonDeselect={ () =>\n\t\t\t\t\tsetAttributes( { isStackedOnMobile: true } )\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t<ToggleControl\n\t\t\t\t\tlabel={ __( 'Stack on mobile' ) }\n\t\t\t\t\tchecked={ isStackedOnMobile }\n\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\tisStackedOnMobile: ! isStackedOnMobile,\n\t\t\t\t\t\t} )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</ToolsPanelItem>\n\t\t\t{ mediaType === 'image' && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\tlabel={ __( 'Crop image to fill' ) }\n\t\t\t\t\tisShownByDefault\n\t\t\t\t\thasValue={ () => !! imageFill }\n\t\t\t\t\tonDeselect={ () => setAttributes( { imageFill: false } ) }\n\t\t\t\t>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\tlabel={ __( 'Crop image to fill' ) }\n\t\t\t\t\t\tchecked={ !! imageFill }\n\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\timageFill: ! imageFill,\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t) }\n\t\t\t{ imageFill &&\n\t\t\t\t( mediaUrl || featuredImageURL ) &&\n\t\t\t\tmediaType === 'image' && (\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Focal point' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => !! focalPoint }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { focalPoint: undefined } )\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<FocalPointPicker\n\t\t\t\t\t\t\tlabel={ __( 'Focal point' ) }\n\t\t\t\t\t\t\turl={\n\t\t\t\t\t\t\t\tuseFeaturedImage && featuredImageURL\n\t\t\t\t\t\t\t\t\t? featuredImageURL\n\t\t\t\t\t\t\t\t\t: mediaUrl\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvalue={ focalPoint }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { focalPoint: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonDragStart={ imperativeFocalPointPreview }\n\t\t\t\t\t\t\tonDrag={ imperativeFocalPointPreview }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t) }\n\t\t\t{ mediaType === 'image' && mediaUrl && ! useFeaturedImage && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\tlabel={ __( 'Alternative text' ) }\n\t\t\t\t\tisShownByDefault\n\t\t\t\t\thasValue={ () => !! mediaAlt }\n\t\t\t\t\tonDeselect={ () => setAttributes( { mediaAlt: '' } ) }\n\t\t\t\t>\n\t\t\t\t\t<TextareaControl\n\t\t\t\t\t\tlabel={ __( 'Alternative text' ) }\n\t\t\t\t\t\tvalue={ mediaAlt }\n\t\t\t\t\t\tonChange={ onMediaAltChange }\n\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\thref={\n\t\t\t\t\t\t\t\t\t\t// translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations.\n\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t'https://www.w3.org/WAI/tutorials/images/decision-tree/'\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t'Describe the purpose of the image.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\t{ __( 'Leave empty if decorative.' ) }\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t) }\n\t\t\t{ mediaType === 'image' && ! useFeaturedImage && (\n\t\t\t\t<MediaTextResolutionTool\n\t\t\t\t\timage={ image }\n\t\t\t\t\tvalue={ mediaSizeSlug }\n\t\t\t\t\tonChange={ updateImage }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</ToolsPanel>\n\t);\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classNames,\n\t\tstyle,\n\t} );\n\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{ className: 'wp-block-media-text__content' },\n\t\t{ template: TEMPLATE, allowedBlocks }\n\t);\n\n\tconst blockEditingMode = useBlockEditingMode();\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>{ mediaTextGeneralSettings }</InspectorControls>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t{ blockEditingMode === 'default' && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<BlockVerticalAlignmentControl\n\t\t\t\t\t\t\tonChange={ onVerticalAlignmentChange }\n\t\t\t\t\t\t\tvalue={ verticalAlignment }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\ticon={ pullLeft }\n\t\t\t\t\t\t\ttitle={ __( 'Show media on left' ) }\n\t\t\t\t\t\t\tisActive={ mediaPosition === 'left' }\n\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { mediaPosition: 'left' } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\ticon={ pullRight }\n\t\t\t\t\t\t\ttitle={ __( 'Show media on right' ) }\n\t\t\t\t\t\t\tisActive={ mediaPosition === 'right' }\n\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { mediaPosition: 'right' } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\n\t\t\t\t{ mediaType === 'image' && ! useFeaturedImage && (\n\t\t\t\t\t<ImageURLInputUI\n\t\t\t\t\t\turl={ href || '' }\n\t\t\t\t\t\tonChangeUrl={ onSetHref }\n\t\t\t\t\t\tlinkDestination={ linkDestination }\n\t\t\t\t\t\tmediaType={ mediaType }\n\t\t\t\t\t\tmediaUrl={ image && image.source_url }\n\t\t\t\t\t\tmediaLink={ image && image.link }\n\t\t\t\t\t\tlinkTarget={ linkTarget }\n\t\t\t\t\t\tlinkClass={ linkClass }\n\t\t\t\t\t\trel={ rel }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</BlockControls>\n\t\t\t<div { ...blockProps }>\n\t\t\t\t{ mediaPosition === 'right' && <div { ...innerBlocksProps } /> }\n\t\t\t\t<MediaContainer\n\t\t\t\t\tclassName=\"wp-block-media-text__media\"\n\t\t\t\t\tonSelectMedia={ onSelectMedia }\n\t\t\t\t\tonWidthChange={ onWidthChange }\n\t\t\t\t\tcommitWidthChange={ commitWidthChange }\n\t\t\t\t\trefMedia={ refMedia }\n\t\t\t\t\tenableResize={ blockEditingMode === 'default' }\n\t\t\t\t\ttoggleUseFeaturedImage={ toggleUseFeaturedImage }\n\t\t\t\t\t{ ...{\n\t\t\t\t\t\tfocalPoint,\n\t\t\t\t\t\timageFill,\n\t\t\t\t\t\tisSelected,\n\t\t\t\t\t\tisStackedOnMobile,\n\t\t\t\t\t\tmediaAlt,\n\t\t\t\t\t\tmediaId,\n\t\t\t\t\t\tmediaPosition,\n\t\t\t\t\t\tmediaType,\n\t\t\t\t\t\tmediaUrl,\n\t\t\t\t\t\tmediaWidth,\n\t\t\t\t\t\tuseFeaturedImage,\n\t\t\t\t\t\tfeaturedImageURL,\n\t\t\t\t\t\tfeaturedImageAlt,\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t\t{ mediaPosition !== 'right' && <div { ...innerBlocksProps } /> }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default MediaTextEdit;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,kBAAmB;AACnB,kBAA0B;AAC1B,qBAAiC;AACjC,0BAUO;AACP,wBASO;AACP,kBAA4C;AAC5C,mBAAoC;AACpC,uBAAkD;AAKlD,6BAA2B;AAC3B,uBAOO;AACP,yBAAuB;AACvB,mBAA+C;AAmI7C;AAjIF,IAAM,EAAE,eAAe,QAAI,2BAAQ,oBAAAA,WAAuB;AAG1D,IAAM,wBAAwB,CAAE,UAC/B,KAAK;AAAA,EACJ;AAAA,EACA,KAAK,IAAK,OAAO,MAAM,4CAA4B;AACpD;AAED,SAAS,4BAA6B,OAAO,MAAO;AACnD,SAAO,OAAO,eAAe,QAAS,IAAK,GAAG;AAC/C;AAEA,SAAS,oBAAqB;AAAA,EAC7B,YAAY,EAAE,iBAAiB,KAAK;AAAA,EACpC;AACD,GAAI;AACH,SAAO,CAAE,UAAW;AACnB,QAAK,CAAE,SAAS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,IAC/C,6CAAC,qCAAc,OAAM,SAClB;AAAA,2BAAqB,aACtB,4EACC;AAAA;AAAA,UAAC;AAAA;AAAA,YACA,UAAW;AAAA,YACX,OAAQ;AAAA;AAAA,
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { useState, useRef } from '@wordpress/element';\nimport {\n\tBlockControls,\n\tBlockVerticalAlignmentControl,\n\tuseInnerBlocksProps,\n\tInspectorControls,\n\tuseBlockProps,\n\t__experimentalImageURLInputUI as ImageURLInputUI,\n\tstore as blockEditorStore,\n\tuseBlockEditingMode,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport {\n\tRangeControl,\n\tTextareaControl,\n\tToggleControl,\n\tToolbarButton,\n\tExternalLink,\n\tFocalPointPicker,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { isBlobURL, getBlobTypeByURL } from '@wordpress/blob';\nimport { pullLeft, pullRight } from '@wordpress/icons';\nimport { useEntityProp, store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport MediaContainer from './media-container';\nimport {\n\tDEFAULT_MEDIA_SIZE_SLUG,\n\tWIDTH_CONSTRAINT_PERCENTAGE,\n\tLINK_DESTINATION_NONE,\n\tLINK_DESTINATION_MEDIA,\n\tLINK_DESTINATION_ATTACHMENT,\n\tTEMPLATE,\n} from './constants';\nimport { unlock } from '../lock-unlock';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\nconst { ResolutionTool } = unlock( blockEditorPrivateApis );\n\n// this limits the resize to a safe zone to avoid making broken layouts\nconst applyWidthConstraints = ( width ) =>\n\tMath.max(\n\t\tWIDTH_CONSTRAINT_PERCENTAGE,\n\t\tMath.min( width, 100 - WIDTH_CONSTRAINT_PERCENTAGE )\n\t);\n\nfunction getImageSourceUrlBySizeSlug( image, slug ) {\n\treturn image?.media_details?.sizes?.[ slug ]?.source_url;\n}\n\nfunction attributesFromMedia( {\n\tattributes: { linkDestination, href },\n\tsetAttributes,\n} ) {\n\treturn ( media ) => {\n\t\tif ( ! media || ! media.url ) {\n\t\t\tsetAttributes( {\n\t\t\t\tmediaAlt: undefined,\n\t\t\t\tmediaId: undefined,\n\t\t\t\tmediaType: undefined,\n\t\t\t\tmediaUrl: undefined,\n\t\t\t\tmediaLink: undefined,\n\t\t\t\thref: undefined,\n\t\t\t\tfocalPoint: undefined,\n\t\t\t\tuseFeaturedImage: false,\n\t\t\t} );\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isBlobURL( media.url ) ) {\n\t\t\tmedia.type = getBlobTypeByURL( media.url );\n\t\t}\n\n\t\tlet mediaType;\n\t\tlet src;\n\t\t// For media selections originated from a file upload.\n\t\tif ( media.media_type ) {\n\t\t\tif ( media.media_type === 'image' ) {\n\t\t\t\tmediaType = 'image';\n\t\t\t} else {\n\t\t\t\t// only images and videos are accepted so if the media_type is not an image we can assume it is a video.\n\t\t\t\t// video contain the media type of 'file' in the object returned from the rest api.\n\t\t\t\tmediaType = 'video';\n\t\t\t}\n\t\t} else {\n\t\t\t// For media selections originated from existing files in the media library.\n\t\t\tmediaType = media.type;\n\t\t}\n\n\t\tif ( mediaType === 'image' ) {\n\t\t\t// Try the \"large\" size URL, falling back to the \"full\" size URL below.\n\t\t\tsrc =\n\t\t\t\tmedia.sizes?.large?.url ||\n\t\t\t\tmedia.media_details?.sizes?.large?.source_url;\n\t\t}\n\n\t\tlet newLinkDestination = linkDestination;\n\t\tlet newHref = href;\n\n\t\t// Only apply default link behavior for images (not videos).\n\t\tif ( mediaType === 'image' ) {\n\t\t\t// Check if default link setting should be used.\n\t\t\tif ( ! newLinkDestination ) {\n\t\t\t\t// Use the WordPress option to determine the proper default.\n\t\t\t\t// The constants used in Gutenberg do not match WP options so a little more complicated than ideal.\n\t\t\t\tswitch (\n\t\t\t\t\twindow?.wp?.media?.view?.settings?.defaultProps?.link ||\n\t\t\t\t\tLINK_DESTINATION_NONE\n\t\t\t\t) {\n\t\t\t\t\tcase 'file':\n\t\t\t\t\tcase LINK_DESTINATION_MEDIA:\n\t\t\t\t\t\tnewLinkDestination = LINK_DESTINATION_MEDIA;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'post':\n\t\t\t\t\tcase LINK_DESTINATION_ATTACHMENT:\n\t\t\t\t\t\tnewLinkDestination = LINK_DESTINATION_ATTACHMENT;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase LINK_DESTINATION_NONE:\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tnewLinkDestination = LINK_DESTINATION_NONE;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Set href based on linkDestination.\n\t\t\tswitch ( newLinkDestination ) {\n\t\t\t\tcase LINK_DESTINATION_MEDIA:\n\t\t\t\t\tnewHref = media.url;\n\t\t\t\t\tbreak;\n\t\t\t\tcase LINK_DESTINATION_ATTACHMENT:\n\t\t\t\t\tnewHref = media.link;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tsetAttributes( {\n\t\t\tmediaAlt: media.alt,\n\t\t\tmediaId: media.id,\n\t\t\tmediaType,\n\t\t\tmediaUrl: src || media.url,\n\t\t\tmediaLink: media.link || undefined,\n\t\t\thref: newHref,\n\t\t\tlinkDestination: newLinkDestination,\n\t\t\tfocalPoint: undefined,\n\t\t\tuseFeaturedImage: false,\n\t\t} );\n\t};\n}\n\nfunction MediaTextResolutionTool( { image, value, onChange } ) {\n\tconst { imageSizes } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn {\n\t\t\timageSizes: getSettings().imageSizes,\n\t\t};\n\t}, [] );\n\n\tif ( ! imageSizes?.length ) {\n\t\treturn null;\n\t}\n\n\tconst imageSizeOptions = imageSizes\n\t\t.filter( ( { slug } ) => getImageSourceUrlBySizeSlug( image, slug ) )\n\t\t.map( ( { name, slug } ) => ( { value: slug, label: name } ) );\n\n\treturn (\n\t\t<ResolutionTool\n\t\t\tvalue={ value }\n\t\t\tdefaultValue={ DEFAULT_MEDIA_SIZE_SLUG }\n\t\t\toptions={ imageSizeOptions }\n\t\t\tonChange={ onChange }\n\t\t/>\n\t);\n}\n\nfunction MediaTextEdit( {\n\tattributes,\n\tisSelected,\n\tsetAttributes,\n\tcontext: { postId, postType },\n} ) {\n\tconst {\n\t\tfocalPoint,\n\t\thref,\n\t\timageFill,\n\t\tisStackedOnMobile,\n\t\tlinkClass,\n\t\tlinkDestination,\n\t\tlinkTarget,\n\t\tmediaAlt,\n\t\tmediaId,\n\t\tmediaPosition,\n\t\tmediaType,\n\t\tmediaUrl,\n\t\tmediaWidth,\n\t\tmediaSizeSlug,\n\t\trel,\n\t\tverticalAlignment,\n\t\tallowedBlocks,\n\t\tuseFeaturedImage,\n\t} = attributes;\n\n\tconst [ featuredImage ] = useEntityProp(\n\t\t'postType',\n\t\tpostType,\n\t\t'featured_media',\n\t\tpostId\n\t);\n\n\tconst { featuredImageMedia } = useSelect(\n\t\t( select ) => {\n\t\t\treturn {\n\t\t\t\tfeaturedImageMedia:\n\t\t\t\t\tfeaturedImage && useFeaturedImage\n\t\t\t\t\t\t? select( coreStore ).getEntityRecord(\n\t\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\t\t'attachment',\n\t\t\t\t\t\t\t\tfeaturedImage,\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tcontext: 'view',\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: undefined,\n\t\t\t};\n\t\t},\n\t\t[ featuredImage, useFeaturedImage ]\n\t);\n\n\tconst { image } = useSelect(\n\t\t( select ) => {\n\t\t\treturn {\n\t\t\t\timage:\n\t\t\t\t\tmediaId && isSelected\n\t\t\t\t\t\t? select( coreStore ).getEntityRecord(\n\t\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\t\t'attachment',\n\t\t\t\t\t\t\t\tmediaId,\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tcontext: 'view',\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: null,\n\t\t\t};\n\t\t},\n\t\t[ isSelected, mediaId ]\n\t);\n\n\tconst featuredImageURL = useFeaturedImage\n\t\t? featuredImageMedia?.source_url\n\t\t: '';\n\tconst featuredImageAlt = useFeaturedImage\n\t\t? featuredImageMedia?.alt_text\n\t\t: '';\n\n\tconst toggleUseFeaturedImage = () => {\n\t\tsetAttributes( {\n\t\t\timageFill: false,\n\t\t\tmediaType: 'image',\n\t\t\tmediaId: undefined,\n\t\t\tmediaUrl: undefined,\n\t\t\tmediaAlt: undefined,\n\t\t\tmediaLink: undefined,\n\t\t\tlinkDestination: undefined,\n\t\t\tlinkTarget: undefined,\n\t\t\tlinkClass: undefined,\n\t\t\trel: undefined,\n\t\t\thref: undefined,\n\t\t\tuseFeaturedImage: ! useFeaturedImage,\n\t\t} );\n\t};\n\n\tconst refMedia = useRef();\n\tconst imperativeFocalPointPreview = ( value ) => {\n\t\tconst { style } = refMedia.current;\n\t\tconst { x, y } = value;\n\t\tstyle.objectPosition = `${ x * 100 }% ${ y * 100 }%`;\n\t};\n\n\tconst [ temporaryMediaWidth, setTemporaryMediaWidth ] = useState( null );\n\n\tconst onSelectMedia = attributesFromMedia( { attributes, setAttributes } );\n\n\tconst onSetHref = ( props ) => {\n\t\tsetAttributes( props );\n\t};\n\n\tconst onWidthChange = ( width ) => {\n\t\tsetTemporaryMediaWidth( applyWidthConstraints( width ) );\n\t};\n\tconst commitWidthChange = ( width ) => {\n\t\tsetAttributes( {\n\t\t\tmediaWidth: applyWidthConstraints( width ),\n\t\t} );\n\t\tsetTemporaryMediaWidth( null );\n\t};\n\n\tconst classNames = clsx( {\n\t\t'has-media-on-the-right': 'right' === mediaPosition,\n\t\t'is-selected': isSelected,\n\t\t'is-stacked-on-mobile': isStackedOnMobile,\n\t\t[ `is-vertically-aligned-${ verticalAlignment }` ]: verticalAlignment,\n\t\t'is-image-fill-element': imageFill,\n\t} );\n\tconst widthString = `${ temporaryMediaWidth || mediaWidth }%`;\n\tconst gridTemplateColumns =\n\t\t'right' === mediaPosition\n\t\t\t? `1fr ${ widthString }`\n\t\t\t: `${ widthString } 1fr`;\n\tconst style = {\n\t\tgridTemplateColumns,\n\t\tmsGridColumns: gridTemplateColumns,\n\t};\n\tconst onMediaAltChange = ( newMediaAlt ) => {\n\t\tsetAttributes( { mediaAlt: newMediaAlt } );\n\t};\n\tconst onVerticalAlignmentChange = ( alignment ) => {\n\t\tsetAttributes( { verticalAlignment: alignment } );\n\t};\n\tconst updateImage = ( newMediaSizeSlug ) => {\n\t\tconst newUrl = getImageSourceUrlBySizeSlug( image, newMediaSizeSlug );\n\n\t\tif ( ! newUrl ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tsetAttributes( {\n\t\t\tmediaUrl: newUrl,\n\t\t\tmediaSizeSlug: newMediaSizeSlug,\n\t\t} );\n\t};\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tconst mediaTextGeneralSettings = (\n\t\t<ToolsPanel\n\t\t\tlabel={ __( 'Settings' ) }\n\t\t\tresetAll={ () => {\n\t\t\t\tsetAttributes( {\n\t\t\t\t\tisStackedOnMobile: true,\n\t\t\t\t\timageFill: false,\n\t\t\t\t\tmediaAlt: '',\n\t\t\t\t\tfocalPoint: undefined,\n\t\t\t\t\tmediaWidth: 50,\n\t\t\t\t} );\n\t\t\t\tupdateImage( DEFAULT_MEDIA_SIZE_SLUG );\n\t\t\t} }\n\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t>\n\t\t\t<ToolsPanelItem\n\t\t\t\tlabel={ __( 'Media width' ) }\n\t\t\t\tisShownByDefault\n\t\t\t\thasValue={ () => mediaWidth !== 50 }\n\t\t\t\tonDeselect={ () => setAttributes( { mediaWidth: 50 } ) }\n\t\t\t>\n\t\t\t\t<RangeControl\n\t\t\t\t\tlabel={ __( 'Media width' ) }\n\t\t\t\t\tvalue={ temporaryMediaWidth || mediaWidth }\n\t\t\t\t\tonChange={ commitWidthChange }\n\t\t\t\t\tmin={ WIDTH_CONSTRAINT_PERCENTAGE }\n\t\t\t\t\tmax={ 100 - WIDTH_CONSTRAINT_PERCENTAGE }\n\t\t\t\t/>\n\t\t\t</ToolsPanelItem>\n\t\t\t<ToolsPanelItem\n\t\t\t\tlabel={ __( 'Stack on mobile' ) }\n\t\t\t\tisShownByDefault\n\t\t\t\thasValue={ () => ! isStackedOnMobile }\n\t\t\t\tonDeselect={ () =>\n\t\t\t\t\tsetAttributes( { isStackedOnMobile: true } )\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t<ToggleControl\n\t\t\t\t\tlabel={ __( 'Stack on mobile' ) }\n\t\t\t\t\tchecked={ isStackedOnMobile }\n\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\tisStackedOnMobile: ! isStackedOnMobile,\n\t\t\t\t\t\t} )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</ToolsPanelItem>\n\t\t\t{ mediaType === 'image' && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\tlabel={ __( 'Crop image to fill' ) }\n\t\t\t\t\tisShownByDefault\n\t\t\t\t\thasValue={ () => !! imageFill }\n\t\t\t\t\tonDeselect={ () => setAttributes( { imageFill: false } ) }\n\t\t\t\t>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\tlabel={ __( 'Crop image to fill' ) }\n\t\t\t\t\t\tchecked={ !! imageFill }\n\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\timageFill: ! imageFill,\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t) }\n\t\t\t{ imageFill &&\n\t\t\t\t( mediaUrl || featuredImageURL ) &&\n\t\t\t\tmediaType === 'image' && (\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Focal point' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => !! focalPoint }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { focalPoint: undefined } )\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<FocalPointPicker\n\t\t\t\t\t\t\tlabel={ __( 'Focal point' ) }\n\t\t\t\t\t\t\turl={\n\t\t\t\t\t\t\t\tuseFeaturedImage && featuredImageURL\n\t\t\t\t\t\t\t\t\t? featuredImageURL\n\t\t\t\t\t\t\t\t\t: mediaUrl\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvalue={ focalPoint }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { focalPoint: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonDragStart={ imperativeFocalPointPreview }\n\t\t\t\t\t\t\tonDrag={ imperativeFocalPointPreview }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t) }\n\t\t\t{ mediaType === 'image' && mediaUrl && ! useFeaturedImage && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\tlabel={ __( 'Alternative text' ) }\n\t\t\t\t\tisShownByDefault\n\t\t\t\t\thasValue={ () => !! mediaAlt }\n\t\t\t\t\tonDeselect={ () => setAttributes( { mediaAlt: '' } ) }\n\t\t\t\t>\n\t\t\t\t\t<TextareaControl\n\t\t\t\t\t\tlabel={ __( 'Alternative text' ) }\n\t\t\t\t\t\tvalue={ mediaAlt }\n\t\t\t\t\t\tonChange={ onMediaAltChange }\n\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\thref={\n\t\t\t\t\t\t\t\t\t\t// translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations.\n\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t'https://www.w3.org/WAI/tutorials/images/decision-tree/'\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t'Describe the purpose of the image.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\t{ __( 'Leave empty if decorative.' ) }\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t) }\n\t\t\t{ mediaType === 'image' && ! useFeaturedImage && (\n\t\t\t\t<MediaTextResolutionTool\n\t\t\t\t\timage={ image }\n\t\t\t\t\tvalue={ mediaSizeSlug }\n\t\t\t\t\tonChange={ updateImage }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</ToolsPanel>\n\t);\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classNames,\n\t\tstyle,\n\t} );\n\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{ className: 'wp-block-media-text__content' },\n\t\t{ template: TEMPLATE, allowedBlocks }\n\t);\n\n\tconst blockEditingMode = useBlockEditingMode();\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>{ mediaTextGeneralSettings }</InspectorControls>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t{ blockEditingMode === 'default' && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<BlockVerticalAlignmentControl\n\t\t\t\t\t\t\tonChange={ onVerticalAlignmentChange }\n\t\t\t\t\t\t\tvalue={ verticalAlignment }\n\t\t\t\t\t\t\tlabel={ __( 'Align media and text vertically' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\ticon={ pullLeft }\n\t\t\t\t\t\t\ttitle={ __( 'Show media on left' ) }\n\t\t\t\t\t\t\tisActive={ mediaPosition === 'left' }\n\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { mediaPosition: 'left' } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\ticon={ pullRight }\n\t\t\t\t\t\t\ttitle={ __( 'Show media on right' ) }\n\t\t\t\t\t\t\tisActive={ mediaPosition === 'right' }\n\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { mediaPosition: 'right' } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\n\t\t\t\t{ mediaType === 'image' && ! useFeaturedImage && (\n\t\t\t\t\t<ImageURLInputUI\n\t\t\t\t\t\turl={ href || '' }\n\t\t\t\t\t\tonChangeUrl={ onSetHref }\n\t\t\t\t\t\tlinkDestination={ linkDestination }\n\t\t\t\t\t\tmediaType={ mediaType }\n\t\t\t\t\t\tmediaUrl={ image && image.source_url }\n\t\t\t\t\t\tmediaLink={ image && image.link }\n\t\t\t\t\t\tlinkTarget={ linkTarget }\n\t\t\t\t\t\tlinkClass={ linkClass }\n\t\t\t\t\t\trel={ rel }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</BlockControls>\n\t\t\t<div { ...blockProps }>\n\t\t\t\t{ mediaPosition === 'right' && <div { ...innerBlocksProps } /> }\n\t\t\t\t<MediaContainer\n\t\t\t\t\tclassName=\"wp-block-media-text__media\"\n\t\t\t\t\tonSelectMedia={ onSelectMedia }\n\t\t\t\t\tonWidthChange={ onWidthChange }\n\t\t\t\t\tcommitWidthChange={ commitWidthChange }\n\t\t\t\t\trefMedia={ refMedia }\n\t\t\t\t\tenableResize={ blockEditingMode === 'default' }\n\t\t\t\t\ttoggleUseFeaturedImage={ toggleUseFeaturedImage }\n\t\t\t\t\t{ ...{\n\t\t\t\t\t\tfocalPoint,\n\t\t\t\t\t\timageFill,\n\t\t\t\t\t\tisSelected,\n\t\t\t\t\t\tisStackedOnMobile,\n\t\t\t\t\t\tmediaAlt,\n\t\t\t\t\t\tmediaId,\n\t\t\t\t\t\tmediaPosition,\n\t\t\t\t\t\tmediaType,\n\t\t\t\t\t\tmediaUrl,\n\t\t\t\t\t\tmediaWidth,\n\t\t\t\t\t\tuseFeaturedImage,\n\t\t\t\t\t\tfeaturedImageURL,\n\t\t\t\t\t\tfeaturedImageAlt,\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t\t{ mediaPosition !== 'right' && <div { ...innerBlocksProps } /> }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default MediaTextEdit;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,kBAAmB;AACnB,kBAA0B;AAC1B,qBAAiC;AACjC,0BAUO;AACP,wBASO;AACP,kBAA4C;AAC5C,mBAAoC;AACpC,uBAAkD;AAKlD,6BAA2B;AAC3B,uBAOO;AACP,yBAAuB;AACvB,mBAA+C;AAmI7C;AAjIF,IAAM,EAAE,eAAe,QAAI,2BAAQ,oBAAAA,WAAuB;AAG1D,IAAM,wBAAwB,CAAE,UAC/B,KAAK;AAAA,EACJ;AAAA,EACA,KAAK,IAAK,OAAO,MAAM,4CAA4B;AACpD;AAED,SAAS,4BAA6B,OAAO,MAAO;AACnD,SAAO,OAAO,eAAe,QAAS,IAAK,GAAG;AAC/C;AAEA,SAAS,oBAAqB;AAAA,EAC7B,YAAY,EAAE,iBAAiB,KAAK;AAAA,EACpC;AACD,GAAI;AACH,SAAO,CAAE,UAAW;AACnB,QAAK,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ACE,kBAAkB,WAAW,4CAAC,SAAM,GAAG,kBAAmB;AAAA,OAC7D;AAAA,KACD;AAEF;AAEA,IAAO,eAAQ;",
|
|
6
6
|
"names": ["blockEditorPrivateApis", "blockEditorStore", "coreStore", "style", "clsx", "ToolsPanel", "ToolsPanelItem", "ImageURLInputUI", "MediaContainer"]
|
|
7
7
|
}
|
package/build/more/edit.cjs
CHANGED
|
@@ -79,9 +79,9 @@ function MoreEdit({
|
|
|
79
79
|
placeholder: DEFAULT_TEXT,
|
|
80
80
|
onChange: (value) => setAttributes({ customText: value }),
|
|
81
81
|
disableLineBreaks: true,
|
|
82
|
-
__unstableOnSplitAtEnd: () => insertBlocksAfter(
|
|
82
|
+
__unstableOnSplitAtEnd: insertBlocksAfter ? () => insertBlocksAfter(
|
|
83
83
|
(0, import_blocks.createBlock)((0, import_blocks.getDefaultBlockName)())
|
|
84
|
-
)
|
|
84
|
+
) : void 0
|
|
85
85
|
}
|
|
86
86
|
) })
|
|
87
87
|
] });
|
package/build/more/edit.cjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/more/edit.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\tToggleControl,\n} from '@wordpress/components';\nimport {\n\tInspectorControls,\n\tPlainText,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport { getDefaultBlockName, createBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\nconst DEFAULT_TEXT = __( 'Read more' );\n\nexport default function MoreEdit( {\n\tattributes: { customText, noTeaser },\n\tinsertBlocksAfter,\n\tsetAttributes,\n} ) {\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\tnoTeaser: false,\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Hide excerpt' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => noTeaser }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { noTeaser: false } )\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t'Hide the excerpt on the full content page'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tchecked={ !! noTeaser }\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { noTeaser: ! noTeaser } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\thelp={ ( checked ) =>\n\t\t\t\t\t\t\t\tchecked\n\t\t\t\t\t\t\t\t\t? __( 'The excerpt is hidden.' )\n\t\t\t\t\t\t\t\t\t: __( 'The excerpt is visible.' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t</ToolsPanel>\n\t\t\t</InspectorControls>\n\t\t\t<div { ...useBlockProps() }>\n\t\t\t\t<PlainText\n\t\t\t\t\t__experimentalVersion={ 2 }\n\t\t\t\t\ttagName=\"span\"\n\t\t\t\t\taria-label={ __( '\"Read more\" text' ) }\n\t\t\t\t\tvalue={ customText }\n\t\t\t\t\tplaceholder={ DEFAULT_TEXT }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { customText: value } )\n\t\t\t\t\t}\n\t\t\t\t\tdisableLineBreaks\n\t\t\t\t\t__unstableOnSplitAtEnd={ () =>\n\t\t\t\t\t\tinsertBlocksAfter(\n\t\t\t\t\t\t\tcreateBlock( getDefaultBlockName() )\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AACnB,wBAIO;AACP,0BAIO;AACP,oBAAiD;AAKjD,mBAA+C;AAY7C;AAVF,IAAM,mBAAe,gBAAI,WAAY;AAEtB,SAAR,SAA2B;AAAA,EACjC,YAAY,EAAE,YAAY,SAAS;AAAA,EACnC;AAAA,EACA;AACD,GAAI;AACH,QAAM,wBAAoB,6CAA+B;AAEzD,SACC,4EACC;AAAA,gDAAC,yCACA;AAAA,MAAC,kBAAAA;AAAA,MAAA;AAAA,QACA,WAAQ,gBAAI,UAAW;AAAA,QACvB,UAAW,MAAM;AAChB,wBAAe;AAAA,YACd,UAAU;AAAA,UACX,CAAE;AAAA,QACH;AAAA,QACA;AAAA,QAEA;AAAA,UAAC,kBAAAC;AAAA,UAAA;AAAA,YACA,WAAQ,gBAAI,cAAe;AAAA,YAC3B,kBAAgB;AAAA,YAChB,UAAW,MAAM;AAAA,YACjB,YAAa,MACZ,cAAe,EAAE,UAAU,MAAM,CAAE;AAAA,YAGpC;AAAA,cAAC;AAAA;AAAA,gBACA,WAAQ;AAAA,kBACP;AAAA,gBACD;AAAA,gBACA,SAAU,CAAC,CAAE;AAAA,gBACb,UAAW,MACV,cAAe,EAAE,UAAU,CAAE,SAAS,CAAE;AAAA,gBAEzC,MAAO,CAAE,YACR,cACG,gBAAI,wBAAyB,QAC7B,gBAAI,yBAA0B;AAAA;AAAA,YAEnC;AAAA;AAAA,QACD;AAAA;AAAA,IACD,GACD;AAAA,IACA,4CAAC,SAAM,OAAG,mCAAc,GACvB;AAAA,MAAC;AAAA;AAAA,QACA,uBAAwB;AAAA,QACxB,SAAQ;AAAA,QACR,kBAAa,gBAAI,kBAAmB;AAAA,QACpC,OAAQ;AAAA,QACR,aAAc;AAAA,QACd,UAAW,CAAE,UACZ,cAAe,EAAE,YAAY,MAAM,CAAE;AAAA,QAEtC,mBAAiB;AAAA,QACjB,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\tToggleControl,\n} from '@wordpress/components';\nimport {\n\tInspectorControls,\n\tPlainText,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport { getDefaultBlockName, createBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\nconst DEFAULT_TEXT = __( 'Read more' );\n\nexport default function MoreEdit( {\n\tattributes: { customText, noTeaser },\n\tinsertBlocksAfter,\n\tsetAttributes,\n} ) {\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\tnoTeaser: false,\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Hide excerpt' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => noTeaser }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { noTeaser: false } )\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t'Hide the excerpt on the full content page'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tchecked={ !! noTeaser }\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { noTeaser: ! noTeaser } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\thelp={ ( checked ) =>\n\t\t\t\t\t\t\t\tchecked\n\t\t\t\t\t\t\t\t\t? __( 'The excerpt is hidden.' )\n\t\t\t\t\t\t\t\t\t: __( 'The excerpt is visible.' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t</ToolsPanel>\n\t\t\t</InspectorControls>\n\t\t\t<div { ...useBlockProps() }>\n\t\t\t\t<PlainText\n\t\t\t\t\t__experimentalVersion={ 2 }\n\t\t\t\t\ttagName=\"span\"\n\t\t\t\t\taria-label={ __( '\"Read more\" text' ) }\n\t\t\t\t\tvalue={ customText }\n\t\t\t\t\tplaceholder={ DEFAULT_TEXT }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { customText: value } )\n\t\t\t\t\t}\n\t\t\t\t\tdisableLineBreaks\n\t\t\t\t\t__unstableOnSplitAtEnd={\n\t\t\t\t\t\tinsertBlocksAfter\n\t\t\t\t\t\t\t? () =>\n\t\t\t\t\t\t\t\t\tinsertBlocksAfter(\n\t\t\t\t\t\t\t\t\t\tcreateBlock( getDefaultBlockName() )\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AACnB,wBAIO;AACP,0BAIO;AACP,oBAAiD;AAKjD,mBAA+C;AAY7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|
|
7
7
|
}
|
|
@@ -66,6 +66,7 @@ var import_accessible_menu_description = __toESM(require("./accessible-menu-desc
|
|
|
66
66
|
var import_lock_unlock = require("../../lock-unlock.cjs");
|
|
67
67
|
var import_hooks = require("../../utils/hooks.cjs");
|
|
68
68
|
var import_is_within_overlay = require("../../utils/is-within-overlay.cjs");
|
|
69
|
+
var import_use_layout_custom_properties = __toESM(require("./use-layout-custom-properties.cjs"));
|
|
69
70
|
var import_constants = require("../constants.cjs");
|
|
70
71
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
71
72
|
var { isNavigationPostEditorKey } = (0, import_lock_unlock.unlock)(import_block_editor.privateApis);
|
|
@@ -233,6 +234,11 @@ function Navigation({
|
|
|
233
234
|
icon = "handle"
|
|
234
235
|
} = attributes;
|
|
235
236
|
const ref = attributes.ref;
|
|
237
|
+
(0, import_use_layout_custom_properties.default)({
|
|
238
|
+
clientId,
|
|
239
|
+
layout: attributes.layout,
|
|
240
|
+
style: attributes.style
|
|
241
|
+
});
|
|
236
242
|
const setRef = (0, import_element.useCallback)(
|
|
237
243
|
(postId) => {
|
|
238
244
|
setAttributes({ ref: postId });
|
|
@@ -245,21 +251,29 @@ function Navigation({
|
|
|
245
251
|
isPreviewMode,
|
|
246
252
|
onNavigateToEntityRecord,
|
|
247
253
|
currentTheme,
|
|
248
|
-
editorDisabledResponsive
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
254
|
+
editorDisabledResponsive,
|
|
255
|
+
hasSelectedStyleState
|
|
256
|
+
} = (0, import_data.useSelect)(
|
|
257
|
+
(select) => {
|
|
258
|
+
const {
|
|
259
|
+
getSettings,
|
|
260
|
+
hasSelectedStyleState: hasSelectedBlockStyleState
|
|
261
|
+
} = (0, import_lock_unlock.unlock)(select(import_block_editor.store));
|
|
262
|
+
const settings = getSettings();
|
|
263
|
+
return {
|
|
264
|
+
isPreviewMode: settings.isPreviewMode,
|
|
265
|
+
onNavigateToEntityRecord: settings?.onNavigateToEntityRecord,
|
|
266
|
+
// Needed to construct the template part ID for the overlay preview.
|
|
267
|
+
currentTheme: select(import_core_data.store).getCurrentTheme()?.stylesheet,
|
|
268
|
+
// When editing a navigation post directly in an isolated editor,
|
|
269
|
+
// always show navigation expanded (no hamburger) so users can see
|
|
270
|
+
// and interact with all menu items.
|
|
271
|
+
editorDisabledResponsive: !!settings?.[isNavigationPostEditorKey],
|
|
272
|
+
hasSelectedStyleState: hasSelectedBlockStyleState(clientId)
|
|
273
|
+
};
|
|
274
|
+
},
|
|
275
|
+
[clientId]
|
|
276
|
+
);
|
|
263
277
|
const hasAlreadyRendered = isPreviewMode ? false : recursionDetected;
|
|
264
278
|
const blockEditingMode = (0, import_block_editor.useBlockEditingMode)();
|
|
265
279
|
const { records: classicMenus } = (0, import_core_data.useEntityRecords)("root", "menu", {
|
|
@@ -710,7 +724,7 @@ function Navigation({
|
|
|
710
724
|
hasOverlays
|
|
711
725
|
}
|
|
712
726
|
) }),
|
|
713
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.InspectorControls, { group: "color", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
727
|
+
!hasSelectedStyleState && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.InspectorControls, { group: "color", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
714
728
|
ColorTools,
|
|
715
729
|
{
|
|
716
730
|
textColor,
|