@wordpress/block-library 10.5.2-next.v.202608281122.0 → 11.0.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 +19 -1
- package/build/audio/edit.cjs +5 -5
- package/build/audio/edit.cjs.map +2 -2
- package/build/audio/index.cjs +0 -37
- package/build/audio/index.cjs.map +3 -3
- package/build/button/index.cjs +0 -34
- package/build/button/index.cjs.map +3 -3
- package/build/code/index.cjs +0 -17
- package/build/code/index.cjs.map +3 -3
- package/build/comment-template/edit.cjs.map +1 -1
- package/build/cover/index.cjs +0 -38
- package/build/cover/index.cjs.map +3 -3
- package/build/details/index.cjs +0 -17
- package/build/details/index.cjs.map +3 -3
- package/build/file/index.cjs +0 -43
- package/build/file/index.cjs.map +3 -3
- package/build/footnotes/format.cjs +1 -1
- package/build/footnotes/format.cjs.map +2 -2
- package/build/gallery/dynamic-gallery.cjs +22 -12
- package/build/gallery/dynamic-gallery.cjs.map +2 -2
- package/build/heading/index.cjs +0 -16
- package/build/heading/index.cjs.map +3 -3
- package/build/image/image.cjs +7 -5
- package/build/image/image.cjs.map +2 -2
- package/build/image/index.cjs +0 -81
- package/build/image/index.cjs.map +3 -3
- package/build/image/use-open-image-media-editor-modal.cjs +81 -14
- package/build/image/use-open-image-media-editor-modal.cjs.map +2 -2
- package/build/index.cjs +0 -10
- package/build/index.cjs.map +2 -2
- package/build/latest-posts/edit.cjs.map +1 -1
- package/build/list-item/edit.cjs +14 -11
- package/build/list-item/edit.cjs.map +2 -2
- package/build/list-item/hooks/index.cjs +6 -9
- package/build/list-item/hooks/index.cjs.map +2 -2
- package/build/list-item/hooks/use-enter.cjs +62 -67
- package/build/list-item/hooks/use-enter.cjs.map +3 -3
- package/build/list-item/hooks/use-merge.cjs +26 -44
- package/build/list-item/hooks/use-merge.cjs.map +3 -3
- package/build/list-item/hooks/use-multi-select-tab.cjs +80 -0
- package/build/list-item/hooks/use-multi-select-tab.cjs.map +7 -0
- package/build/list-item/hooks/use-tab.cjs +65 -0
- package/build/list-item/hooks/use-tab.cjs.map +7 -0
- package/build/list-item/index.cjs +0 -17
- package/build/list-item/index.cjs.map +3 -3
- package/build/list-item/utils.cjs +169 -0
- package/build/list-item/utils.cjs.map +7 -0
- package/build/math/block.json +3 -0
- package/build/media-text/index.cjs +0 -50
- package/build/media-text/index.cjs.map +3 -3
- package/build/media-text/media-container.cjs +16 -11
- package/build/media-text/media-container.cjs.map +2 -2
- package/build/more/index.cjs +0 -18
- package/build/more/index.cjs.map +3 -3
- package/build/navigation/constants.cjs +1 -1
- package/build/navigation/constants.cjs.map +1 -1
- package/build/navigation-link/block.json +1 -1
- package/build/navigation-link/deprecated.cjs +69 -0
- package/build/navigation-link/deprecated.cjs.map +7 -0
- package/build/navigation-link/index.cjs +6 -74
- package/build/navigation-link/index.cjs.map +4 -4
- package/build/{form-submit-button/init.cjs → navigation-link/variations.cjs} +23 -8
- package/build/navigation-link/variations.cjs.map +7 -0
- package/build/navigation-submenu/index.cjs +0 -32
- package/build/navigation-submenu/index.cjs.map +3 -3
- package/build/paragraph/index.cjs +0 -17
- package/build/paragraph/index.cjs.map +3 -3
- package/build/paragraph/use-enter.cjs +8 -4
- package/build/paragraph/use-enter.cjs.map +2 -2
- package/build/post-template/edit.cjs +3 -1
- package/build/post-template/edit.cjs.map +2 -2
- package/build/preformatted/index.cjs +0 -17
- package/build/preformatted/index.cjs.map +3 -3
- package/build/pullquote/index.cjs +0 -24
- package/build/pullquote/index.cjs.map +3 -3
- package/build/query/edit/inspector-controls/enhanced-pagination-control.cjs +13 -5
- package/build/query/edit/inspector-controls/enhanced-pagination-control.cjs.map +2 -2
- package/build/query/edit/inspector-controls/index.cjs +9 -4
- package/build/query/edit/inspector-controls/index.cjs.map +2 -2
- package/build/query/edit/query-content.cjs +30 -9
- package/build/query/edit/query-content.cjs.map +3 -3
- package/build/query/utils.cjs +11 -4
- package/build/query/utils.cjs.map +2 -2
- package/build/search/edit.cjs +3 -1
- package/build/search/edit.cjs.map +2 -2
- package/build/search/index.cjs +0 -31
- package/build/search/index.cjs.map +3 -3
- package/build/site-tagline/edit.cjs +11 -17
- package/build/site-tagline/edit.cjs.map +2 -2
- package/build/site-title/edit.cjs +12 -18
- package/build/site-title/edit.cjs.map +2 -2
- package/build/social-link/index.cjs +0 -31
- package/build/social-link/index.cjs.map +3 -3
- package/build/verse/index.cjs +0 -17
- package/build/verse/index.cjs.map +3 -3
- package/build/video/index.cjs +0 -40
- package/build/video/index.cjs.map +3 -3
- package/build/video/tracks-editor.cjs +2 -3
- package/build/video/tracks-editor.cjs.map +3 -3
- package/build-module/audio/edit.mjs +5 -5
- package/build-module/audio/edit.mjs.map +2 -2
- package/build-module/audio/index.mjs +0 -37
- package/build-module/audio/index.mjs.map +2 -2
- package/build-module/button/index.mjs +0 -34
- package/build-module/button/index.mjs.map +2 -2
- package/build-module/code/index.mjs +0 -17
- package/build-module/code/index.mjs.map +2 -2
- package/build-module/comment-template/edit.mjs.map +1 -1
- package/build-module/cover/index.mjs +0 -38
- package/build-module/cover/index.mjs.map +2 -2
- package/build-module/details/index.mjs +0 -17
- package/build-module/details/index.mjs.map +2 -2
- package/build-module/file/index.mjs +1 -44
- package/build-module/file/index.mjs.map +2 -2
- package/build-module/footnotes/format.mjs +1 -1
- package/build-module/footnotes/format.mjs.map +2 -2
- package/build-module/gallery/dynamic-gallery.mjs +23 -13
- package/build-module/gallery/dynamic-gallery.mjs.map +2 -2
- package/build-module/heading/index.mjs +1 -21
- package/build-module/heading/index.mjs.map +2 -2
- package/build-module/image/image.mjs +7 -5
- package/build-module/image/image.mjs.map +2 -2
- package/build-module/image/index.mjs +0 -81
- package/build-module/image/index.mjs.map +2 -2
- package/build-module/image/use-open-image-media-editor-modal.mjs +84 -14
- package/build-module/image/use-open-image-media-editor-modal.mjs.map +2 -2
- package/build-module/index.mjs +0 -10
- package/build-module/index.mjs.map +2 -2
- package/build-module/latest-posts/edit.mjs.map +1 -1
- package/build-module/list-item/edit.mjs +20 -18
- package/build-module/list-item/edit.mjs.map +2 -2
- package/build-module/list-item/hooks/index.mjs +8 -10
- package/build-module/list-item/hooks/index.mjs.map +2 -2
- package/build-module/list-item/hooks/use-enter.mjs +63 -58
- package/build-module/list-item/hooks/use-enter.mjs.map +2 -2
- package/build-module/list-item/hooks/use-merge.mjs +27 -35
- package/build-module/list-item/hooks/use-merge.mjs.map +2 -2
- package/build-module/list-item/hooks/use-multi-select-tab.mjs +59 -0
- package/build-module/list-item/hooks/use-multi-select-tab.mjs.map +7 -0
- package/build-module/list-item/hooks/use-tab.mjs +44 -0
- package/build-module/list-item/hooks/use-tab.mjs.map +7 -0
- package/build-module/list-item/index.mjs +0 -17
- package/build-module/list-item/index.mjs.map +2 -2
- package/build-module/list-item/utils.mjs +140 -0
- package/build-module/list-item/utils.mjs.map +7 -0
- package/build-module/math/block.json +3 -0
- package/build-module/media-text/index.mjs +0 -50
- package/build-module/media-text/index.mjs.map +2 -2
- package/build-module/media-text/media-container.mjs +17 -12
- package/build-module/media-text/media-container.mjs.map +2 -2
- package/build-module/more/index.mjs +0 -18
- package/build-module/more/index.mjs.map +2 -2
- package/build-module/navigation/constants.mjs +1 -1
- package/build-module/navigation/constants.mjs.map +1 -1
- package/build-module/navigation-link/block.json +1 -1
- package/build-module/navigation-link/deprecated.mjs +48 -0
- package/build-module/navigation-link/deprecated.mjs.map +7 -0
- package/build-module/navigation-link/index.mjs +7 -75
- package/build-module/navigation-link/index.mjs.map +3 -3
- package/build-module/navigation-link/variations.mjs +22 -0
- package/build-module/navigation-link/variations.mjs.map +7 -0
- package/build-module/navigation-submenu/index.mjs +1 -33
- package/build-module/navigation-submenu/index.mjs.map +2 -2
- package/build-module/paragraph/index.mjs +0 -17
- package/build-module/paragraph/index.mjs.map +2 -2
- package/build-module/paragraph/use-enter.mjs +8 -4
- package/build-module/paragraph/use-enter.mjs.map +2 -2
- package/build-module/post-template/edit.mjs +3 -1
- package/build-module/post-template/edit.mjs.map +2 -2
- package/build-module/preformatted/index.mjs +0 -17
- package/build-module/preformatted/index.mjs.map +2 -2
- package/build-module/pullquote/index.mjs +0 -24
- package/build-module/pullquote/index.mjs.map +2 -2
- package/build-module/query/edit/inspector-controls/enhanced-pagination-control.mjs +14 -6
- package/build-module/query/edit/inspector-controls/enhanced-pagination-control.mjs.map +2 -2
- package/build-module/query/edit/inspector-controls/index.mjs +9 -4
- package/build-module/query/edit/inspector-controls/index.mjs.map +2 -2
- package/build-module/query/edit/query-content.mjs +32 -11
- package/build-module/query/edit/query-content.mjs.map +2 -2
- package/build-module/query/utils.mjs +10 -7
- package/build-module/query/utils.mjs.map +2 -2
- package/build-module/search/edit.mjs +4 -2
- package/build-module/search/edit.mjs.map +2 -2
- package/build-module/search/index.mjs +0 -31
- package/build-module/search/index.mjs.map +2 -2
- package/build-module/site-tagline/edit.mjs +13 -19
- package/build-module/site-tagline/edit.mjs.map +2 -2
- package/build-module/site-title/edit.mjs +14 -20
- package/build-module/site-title/edit.mjs.map +2 -2
- package/build-module/social-link/index.mjs +0 -31
- package/build-module/social-link/index.mjs.map +2 -2
- package/build-module/verse/index.mjs +0 -17
- package/build-module/verse/index.mjs.map +2 -2
- package/build-module/video/index.mjs +0 -40
- package/build-module/video/index.mjs.map +2 -2
- package/build-module/video/tracks-editor.mjs +3 -5
- package/build-module/video/tracks-editor.mjs.map +2 -2
- package/build-style/columns/style-rtl.css +1 -1
- package/build-style/columns/style.css +1 -1
- package/build-style/comment-template/style-rtl.css +0 -1
- package/build-style/comment-template/style.css +0 -1
- package/build-style/cover/style-rtl.css +1 -2
- package/build-style/cover/style.css +1 -2
- package/build-style/editor-rtl.css +20 -81
- package/build-style/editor.css +20 -81
- package/build-style/gallery/style-rtl.css +2 -4
- package/build-style/gallery/style.css +2 -4
- package/build-style/group/theme-rtl.css +1 -1
- package/build-style/group/theme.css +1 -1
- package/build-style/heading/style-rtl.css +1 -1
- package/build-style/heading/style.css +1 -1
- package/build-style/icon/style-rtl.css +3 -0
- package/build-style/icon/style.css +3 -0
- package/build-style/image/editor-rtl.css +0 -1
- package/build-style/image/editor.css +0 -1
- package/build-style/list/style-rtl.css +1 -1
- package/build-style/list/style.css +1 -1
- package/build-style/media-text/style-rtl.css +2 -3
- package/build-style/media-text/style.css +2 -3
- package/build-style/navigation/editor-rtl.css +8 -0
- package/build-style/navigation/editor.css +8 -0
- package/build-style/paragraph/style-rtl.css +1 -1
- package/build-style/paragraph/style.css +1 -1
- package/build-style/playlist/style-rtl.css +1 -2
- package/build-style/playlist/style.css +1 -2
- package/build-style/playlist-track/style-rtl.css +1 -2
- package/build-style/playlist-track/style.css +1 -2
- package/build-style/preformatted/style-rtl.css +1 -1
- package/build-style/preformatted/style.css +1 -1
- package/build-style/query/editor-rtl.css +5 -15
- package/build-style/query/editor.css +5 -15
- package/build-style/read-more/style-rtl.css +0 -1
- package/build-style/read-more/style.css +0 -1
- package/build-style/reset-rtl.css +1 -3
- package/build-style/reset.css +1 -3
- package/build-style/search/style-rtl.css +1 -3
- package/build-style/search/style.css +1 -3
- package/build-style/site-logo/editor-rtl.css +1 -2
- package/build-style/site-logo/editor.css +1 -2
- package/build-style/style-rtl.css +18 -77
- package/build-style/style.css +18 -77
- package/build-style/tab-list/style-rtl.css +1 -3
- package/build-style/tab-list/style.css +1 -3
- package/build-style/template-part/editor-rtl.css +4 -8
- package/build-style/template-part/editor.css +4 -8
- package/build-style/template-part/theme-rtl.css +1 -1
- package/build-style/template-part/theme.css +1 -1
- package/build-style/theme-rtl.css +2 -2
- package/build-style/theme.css +2 -2
- package/build-style/video/style-rtl.css +1 -2
- package/build-style/video/style.css +1 -2
- package/build-types/navigation-link/deprecated.d.ts +48 -0
- package/build-types/navigation-link/deprecated.d.ts.map +1 -0
- package/package.json +43 -43
- package/src/accordion/index.php +2 -2
- package/src/accordion-item/index.php +1 -1
- package/src/audio/edit.jsx +6 -7
- package/src/audio/index.js +0 -37
- package/src/breadcrumbs/index.php +4 -4
- package/src/button/index.js +0 -34
- package/src/button/style.scss +16 -15
- package/src/button/test/{get-experimental-label.js → get-experimental-label.jsdom.test.js} +1 -0
- package/src/button/test/get-updated-link-attributes.js +1 -0
- package/src/button/test/utils.js +1 -0
- package/src/categories/index.php +4 -0
- package/src/code/index.js +0 -18
- package/src/code/test/utils.js +1 -0
- package/src/columns/style.scss +2 -1
- package/src/columns/test/{transforms.js → transforms.jsdom.test.js} +1 -0
- package/src/columns/test/utils.js +1 -0
- package/src/comment-template/edit.jsx +1 -1
- package/src/comment-template/index.php +2 -2
- package/src/comment-template/test/index.js +1 -0
- package/src/common.scss +51 -50
- package/src/cover/README.md +37 -0
- package/src/cover/index.js +0 -39
- package/src/cover/style.scss +3 -3
- package/src/cover/test/{edit.js → edit.jsdom.test.js} +18 -17
- package/src/cover/test/{transforms.js → transforms.jsdom.test.js} +1 -0
- package/src/details/index.js +0 -18
- package/src/editor.scss +0 -2
- package/src/embed/editor.scss +1 -0
- package/src/embed/test/{index.js → index.jsdom.test.js} +5 -1
- package/src/file/index.js +1 -43
- package/src/footnotes/format.jsx +5 -1
- package/src/gallery/dynamic-gallery.jsx +31 -4
- package/src/gallery/test/dynamic-source.js +1 -0
- package/src/gallery/test/{edit.js → edit.jsdom.test.js} +4 -0
- package/src/gallery/test/responsive-styles.js +1 -0
- package/src/gallery/test/shared.js +1 -0
- package/src/gallery/test/{transforms.js → transforms.jsdom.test.js} +1 -0
- package/src/gallery/test/{use-get-new-images.jsx → use-get-new-images.jsdom.test.jsx} +1 -0
- package/src/gallery/test/variations.js +1 -0
- package/src/group/test/{placeholder.jsx → placeholder.jsdom.test.jsx} +1 -0
- package/src/group/theme.scss +1 -1
- package/src/heading/index.js +1 -22
- package/src/heading/index.php +1 -1
- package/src/heading/style.scss +1 -1
- package/src/heading/test/shared.js +1 -0
- package/src/home-link/index.php +2 -2
- package/src/html/test/{index.js → index.jsdom.test.js} +9 -0
- package/src/html/test/{utils.js → utils.jsdom.test.js} +1 -0
- package/src/icon/index.php +18 -6
- package/src/icon/style.scss +7 -0
- package/src/image/image.jsx +18 -11
- package/src/image/index.js +0 -80
- package/src/image/test/{transforms.js → transforms.jsdom.test.js} +1 -0
- package/src/image/test/{use-open-image-media-editor-modal.js → use-open-image-media-editor-modal.jsdom.test.js} +343 -28
- package/src/image/use-open-image-media-editor-modal.js +184 -21
- package/src/index.jsx +0 -11
- package/src/latest-posts/edit.jsx +1 -1
- package/src/latest-posts/test/{deprecated.js → deprecated.jsdom.test.js} +1 -0
- package/src/list/index.php +1 -1
- package/src/list/style.scss +1 -1
- package/src/list-item/edit.jsx +20 -20
- package/src/list-item/hooks/index.js +2 -3
- package/src/list-item/hooks/use-enter.js +82 -70
- package/src/list-item/hooks/use-merge.js +28 -36
- package/src/list-item/hooks/use-multi-select-tab.js +83 -0
- package/src/list-item/hooks/use-tab.js +62 -0
- package/src/list-item/index.js +0 -18
- package/src/list-item/utils.js +236 -0
- package/src/math/README.md +2 -0
- package/src/math/block.json +3 -0
- package/src/media-text/index.js +0 -50
- package/src/media-text/media-container.jsx +22 -12
- package/src/media-text/style.scss +2 -1
- package/src/media-text/test/image-fill.js +1 -0
- package/src/more/index.js +0 -19
- package/src/navigation/constants.js +1 -1
- package/src/navigation/edit/test/are-blocks-dirty.js +1 -0
- package/src/navigation/edit/test/{layout-custom-properties.js → layout-custom-properties.jsdom.test.js} +8 -7
- package/src/navigation/edit/test/{navigation-menu-selector.jsx → navigation-menu-selector.jsdom.test.jsx} +23 -14
- package/src/navigation/edit/test/{overlay-template-part-selector.jsx → overlay-template-part-selector.jsdom.test.jsx} +22 -20
- package/src/navigation/edit/test/{responsive-wrapper.jsx → responsive-wrapper.jsdom.test.jsx} +14 -13
- package/src/navigation/edit/test/{use-create-overlay.js → use-create-overlay.jsdom.test.js} +19 -24
- package/src/navigation/edit/test/utils.js +1 -0
- package/src/navigation/editor.scss +13 -0
- package/src/navigation/index.php +14 -14
- package/src/navigation/test/{menu-items-to-blocks.js → menu-items-to-blocks.jsdom.test.js} +3 -2
- package/src/navigation/test/{use-navigation-menu.js → use-navigation-menu.jsdom.test.js} +7 -4
- package/src/navigation/test/{view.js → view.jsdom.test.js} +4 -2
- package/src/navigation-link/block.json +1 -1
- package/src/navigation-link/deprecated.tsx +58 -0
- package/src/navigation-link/{index.jsx → index.js} +5 -77
- package/src/navigation-link/index.php +5 -5
- package/src/navigation-link/shared/test/{controls.jsx → controls.jsdom.test.jsx} +18 -18
- package/src/navigation-link/shared/test/update-attributes.test.js +52 -51
- package/src/navigation-link/shared/test/{use-enable-link-status-validation.test.js → use-enable-link-status-validation.jsdom.test.js} +8 -6
- package/src/navigation-link/shared/test/{use-entity-binding.js → use-entity-binding.jsdom.test.js} +12 -11
- package/src/navigation-link/shared/test/{use-handle-link-change.test.js → use-handle-link-change.jsdom.test.js} +23 -20
- package/src/navigation-link/shared/test/{use-link-preview.test.js → use-link-preview.jsdom.test.js} +17 -14
- package/src/navigation-link/test/__snapshots__/{hooks.js.snap → hooks.jsdom.test.js.snap} +23 -6
- package/src/navigation-link/test/block-labelling.js +1 -0
- package/src/navigation-link/test/{hooks.js → hooks.jsdom.test.js} +1 -0
- package/src/navigation-link/variations.js +19 -0
- package/src/navigation-submenu/index.js +1 -33
- package/src/page-list/index.php +10 -10
- package/src/page-list/test/{convert-to-navigation-links.js → convert-to-navigation-links.jsdom.test.js} +3 -2
- package/src/paragraph/index.js +0 -18
- package/src/paragraph/style.scss +1 -1
- package/src/paragraph/use-enter.js +13 -6
- package/src/pattern/test/index.js +1 -0
- package/src/playlist/test/{edit-component.jsx → edit-component.jsdom.test.jsx} +31 -30
- package/src/playlist/test/{edit.js → edit.jsdom.test.js} +1 -0
- package/src/playlist/test/{transforms.js → transforms.jsdom.test.js} +1 -0
- package/src/playlist-track/test/{edit.jsx → edit.jsdom.test.jsx} +20 -19
- package/src/post-author/index.php +3 -3
- package/src/post-author-biography/index.php +3 -3
- package/src/post-author-name/index.php +3 -3
- package/src/post-comments-link/index.php +4 -4
- package/src/post-date/test/{edit.js → edit.jsdom.test.js} +1 -0
- package/src/post-template/edit.jsx +3 -1
- package/src/post-time-to-read/index.php +3 -3
- package/src/post-title/style.scss +1 -0
- package/src/preformatted/index.js +0 -18
- package/src/preformatted/style.scss +1 -1
- package/src/pullquote/index.js +0 -24
- package/src/query/edit/inspector-controls/enhanced-pagination-control.jsx +13 -6
- package/src/query/edit/inspector-controls/index.jsx +9 -4
- package/src/query/edit/query-content.jsx +31 -8
- package/src/query/editor.scss +1 -7
- package/src/query/index.php +2 -2
- package/src/query/test/{utils.js → utils.jsdom.test.js} +1 -0
- package/src/query/utils.js +15 -11
- package/src/quote/test/{migrate.js → migrate.jsdom.test.js} +1 -0
- package/src/read-more/index.php +1 -1
- package/src/search/edit.jsx +12 -2
- package/src/search/index.js +0 -30
- package/src/search/index.php +1 -1
- package/src/separator/test/{edit.jsx → edit.jsdom.test.jsx} +5 -4
- package/src/site-logo/index.php +1 -1
- package/src/site-tagline/edit.jsx +18 -27
- package/src/site-title/edit.jsx +20 -27
- package/src/social-link/index.js +0 -32
- package/src/social-link/index.php +0 -1
- package/src/style.scss +0 -1
- package/src/table/editor.scss +1 -0
- package/src/table/style.scss +2 -0
- package/src/table/test/state.js +1 -0
- package/src/table/test/utils.js +1 -0
- package/src/table-of-contents/index.php +3 -3
- package/src/template-part/theme.scss +1 -1
- package/src/utils/test/search-patterns.js +1 -0
- package/src/utils/test/{style-state.js → style-state.jsdom.test.js} +1 -0
- package/src/utils/test/{waveform-player-dependency.js → waveform-player-dependency.jsdom.test.js} +15 -21
- package/src/verse/index.js +0 -18
- package/src/verse/style.scss +1 -0
- package/src/video/index.js +0 -40
- package/src/video/test/variations.js +1 -0
- package/src/video/tracks-editor.jsx +4 -5
- package/build/form/block.json +0 -65
- package/build/form/deprecated.cjs +0 -111
- package/build/form/deprecated.cjs.map +0 -7
- package/build/form/edit.cjs +0 -180
- package/build/form/edit.cjs.map +0 -7
- package/build/form/icons.cjs +0 -33
- package/build/form/icons.cjs.map +0 -7
- package/build/form/index.cjs +0 -118
- package/build/form/index.cjs.map +0 -7
- package/build/form/init.cjs +0 -28
- package/build/form/init.cjs.map +0 -7
- package/build/form/save.cjs +0 -40
- package/build/form/save.cjs.map +0 -7
- package/build/form/utils.cjs +0 -61
- package/build/form/utils.cjs.map +0 -7
- package/build/form/variations.cjs +0 -152
- package/build/form/variations.cjs.map +0 -7
- package/build/form/view.cjs +0 -48
- package/build/form/view.cjs.map +0 -7
- package/build/form-input/block.json +0 -72
- package/build/form-input/deprecated.cjs +0 -252
- package/build/form-input/deprecated.cjs.map +0 -7
- package/build/form-input/edit.cjs +0 -206
- package/build/form-input/edit.cjs.map +0 -7
- package/build/form-input/icons.cjs +0 -33
- package/build/form-input/icons.cjs.map +0 -7
- package/build/form-input/index.cjs +0 -63
- package/build/form-input/index.cjs.map +0 -7
- package/build/form-input/init.cjs +0 -28
- package/build/form-input/init.cjs.map +0 -7
- package/build/form-input/save.cjs +0 -88
- package/build/form-input/save.cjs.map +0 -7
- package/build/form-input/variations.cjs +0 -105
- package/build/form-input/variations.cjs.map +0 -7
- package/build/form-submission-notification/block.json +0 -19
- package/build/form-submission-notification/edit.cjs +0 -71
- package/build/form-submission-notification/edit.cjs.map +0 -7
- package/build/form-submission-notification/index.cjs +0 -73
- package/build/form-submission-notification/index.cjs.map +0 -7
- package/build/form-submission-notification/init.cjs +0 -28
- package/build/form-submission-notification/init.cjs.map +0 -7
- package/build/form-submission-notification/save.cjs +0 -54
- package/build/form-submission-notification/save.cjs.map +0 -7
- package/build/form-submission-notification/variations.cjs +0 -78
- package/build/form-submission-notification/variations.cjs.map +0 -7
- package/build/form-submit-button/block.json +0 -15
- package/build/form-submit-button/edit.cjs +0 -36
- package/build/form-submit-button/edit.cjs.map +0 -7
- package/build/form-submit-button/index.cjs +0 -75
- package/build/form-submit-button/index.cjs.map +0 -7
- package/build/form-submit-button/init.cjs.map +0 -7
- package/build/form-submit-button/save.cjs +0 -32
- package/build/form-submit-button/save.cjs.map +0 -7
- package/build/list-item/hooks/use-indent-list-item.cjs +0 -79
- package/build/list-item/hooks/use-indent-list-item.cjs.map +0 -7
- package/build/list-item/hooks/use-outdent-list-item.cjs +0 -106
- package/build/list-item/hooks/use-outdent-list-item.cjs.map +0 -7
- package/build/list-item/hooks/use-space.cjs +0 -83
- package/build/list-item/hooks/use-space.cjs.map +0 -7
- package/build/query/edit/enhanced-pagination-modal.cjs +0 -89
- package/build/query/edit/enhanced-pagination-modal.cjs.map +0 -7
- package/build-module/form/block.json +0 -65
- package/build-module/form/deprecated.mjs +0 -96
- package/build-module/form/deprecated.mjs.map +0 -7
- package/build-module/form/edit.mjs +0 -170
- package/build-module/form/edit.mjs.map +0 -7
- package/build-module/form/icons.mjs +0 -8
- package/build-module/form/icons.mjs.map +0 -7
- package/build-module/form/index.mjs +0 -83
- package/build-module/form/index.mjs.map +0 -7
- package/build-module/form/init.mjs +0 -7
- package/build-module/form/init.mjs.map +0 -7
- package/build-module/form/save.mjs +0 -19
- package/build-module/form/save.mjs.map +0 -7
- package/build-module/form/utils.mjs +0 -35
- package/build-module/form/utils.mjs.map +0 -7
- package/build-module/form/variations.mjs +0 -134
- package/build-module/form/variations.mjs.map +0 -7
- package/build-module/form/view.mjs +0 -46
- package/build-module/form/view.mjs.map +0 -7
- package/build-module/form-input/block.json +0 -72
- package/build-module/form-input/deprecated.mjs +0 -226
- package/build-module/form-input/deprecated.mjs.map +0 -7
- package/build-module/form-input/edit.mjs +0 -186
- package/build-module/form-input/edit.mjs.map +0 -7
- package/build-module/form-input/icons.mjs +0 -8
- package/build-module/form-input/icons.mjs.map +0 -7
- package/build-module/form-input/index.mjs +0 -25
- package/build-module/form-input/index.mjs.map +0 -7
- package/build-module/form-input/init.mjs +0 -7
- package/build-module/form-input/init.mjs.map +0 -7
- package/build-module/form-input/save.mjs +0 -62
- package/build-module/form-input/save.mjs.map +0 -7
- package/build-module/form-input/variations.mjs +0 -84
- package/build-module/form-input/variations.mjs.map +0 -7
- package/build-module/form-submission-notification/block.json +0 -19
- package/build-module/form-submission-notification/edit.mjs +0 -45
- package/build-module/form-submission-notification/edit.mjs.map +0 -7
- package/build-module/form-submission-notification/index.mjs +0 -35
- package/build-module/form-submission-notification/index.mjs.map +0 -7
- package/build-module/form-submission-notification/init.mjs +0 -7
- package/build-module/form-submission-notification/init.mjs.map +0 -7
- package/build-module/form-submission-notification/save.mjs +0 -23
- package/build-module/form-submission-notification/save.mjs.map +0 -7
- package/build-module/form-submission-notification/variations.mjs +0 -57
- package/build-module/form-submission-notification/variations.mjs.map +0 -7
- package/build-module/form-submit-button/block.json +0 -15
- package/build-module/form-submit-button/edit.mjs +0 -15
- package/build-module/form-submit-button/edit.mjs.map +0 -7
- package/build-module/form-submit-button/index.mjs +0 -37
- package/build-module/form-submit-button/index.mjs.map +0 -7
- package/build-module/form-submit-button/init.mjs +0 -7
- package/build-module/form-submit-button/init.mjs.map +0 -7
- package/build-module/form-submit-button/save.mjs +0 -11
- package/build-module/form-submit-button/save.mjs.map +0 -7
- package/build-module/list-item/hooks/use-indent-list-item.mjs +0 -58
- package/build-module/list-item/hooks/use-indent-list-item.mjs.map +0 -7
- package/build-module/list-item/hooks/use-outdent-list-item.mjs +0 -85
- package/build-module/list-item/hooks/use-outdent-list-item.mjs.map +0 -7
- package/build-module/list-item/hooks/use-space.mjs +0 -52
- package/build-module/list-item/hooks/use-space.mjs.map +0 -7
- package/build-module/query/edit/enhanced-pagination-modal.mjs +0 -72
- package/build-module/query/edit/enhanced-pagination-modal.mjs.map +0 -7
- package/build-style/form-input/editor-rtl.css +0 -19
- package/build-style/form-input/editor.css +0 -19
- package/build-style/form-input/style-rtl.css +0 -48
- package/build-style/form-input/style.css +0 -48
- package/build-style/form-submission-notification/editor-rtl.css +0 -30
- package/build-style/form-submission-notification/editor.css +0 -30
- package/build-style/form-submit-button/style-rtl.css +0 -3
- package/build-style/form-submit-button/style.css +0 -3
- package/src/form/README.md +0 -90
- package/src/form/block.json +0 -65
- package/src/form/deprecated.jsx +0 -93
- package/src/form/edit.jsx +0 -169
- package/src/form/icons.jsx +0 -7
- package/src/form/index.js +0 -91
- package/src/form/index.php +0 -197
- package/src/form/init.js +0 -3
- package/src/form/save.jsx +0 -15
- package/src/form/utils.js +0 -36
- package/src/form/variations.js +0 -133
- package/src/form/view.js +0 -54
- package/src/form-input/README.md +0 -74
- package/src/form-input/block.json +0 -72
- package/src/form-input/deprecated.jsx +0 -248
- package/src/form-input/edit.jsx +0 -187
- package/src/form-input/editor.scss +0 -24
- package/src/form-input/icons.jsx +0 -7
- package/src/form-input/index.js +0 -22
- package/src/form-input/index.php +0 -47
- package/src/form-input/init.js +0 -3
- package/src/form-input/save.jsx +0 -89
- package/src/form-input/style.scss +0 -64
- package/src/form-input/variations.js +0 -82
- package/src/form-submission-notification/README.md +0 -50
- package/src/form-submission-notification/block.json +0 -19
- package/src/form-submission-notification/edit.jsx +0 -44
- package/src/form-submission-notification/editor.scss +0 -45
- package/src/form-submission-notification/index.js +0 -33
- package/src/form-submission-notification/index.php +0 -48
- package/src/form-submission-notification/init.js +0 -3
- package/src/form-submission-notification/save.jsx +0 -18
- package/src/form-submission-notification/variations.js +0 -56
- package/src/form-submit-button/README.md +0 -54
- package/src/form-submit-button/block.json +0 -15
- package/src/form-submit-button/edit.jsx +0 -12
- package/src/form-submit-button/index.js +0 -35
- package/src/form-submit-button/init.js +0 -3
- package/src/form-submit-button/save.jsx +0 -10
- package/src/form-submit-button/style.scss +0 -3
- package/src/list-item/hooks/use-indent-list-item.js +0 -73
- package/src/list-item/hooks/use-outdent-list-item.js +0 -100
- package/src/list-item/hooks/use-space.js +0 -66
- package/src/query/edit/enhanced-pagination-modal.jsx +0 -77
- /package/src/utils/test/{waveform-player.jsx → waveform-player.jsdom.test.jsx} +0 -0
- /package/src/utils/test/{waveform-utils.js → waveform-utils.jsdom.test.js} +0 -0
|
@@ -27,7 +27,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
|
|
30
|
-
// packages/block-library/src/navigation-link/index.
|
|
30
|
+
// packages/block-library/src/navigation-link/index.js
|
|
31
31
|
var navigation_link_exports = {};
|
|
32
32
|
__export(navigation_link_exports, {
|
|
33
33
|
init: () => init,
|
|
@@ -38,18 +38,15 @@ __export(navigation_link_exports, {
|
|
|
38
38
|
module.exports = __toCommonJS(navigation_link_exports);
|
|
39
39
|
var import_i18n = require("@wordpress/i18n");
|
|
40
40
|
var import_icons = require("@wordpress/icons");
|
|
41
|
-
var import_block_editor = require("@wordpress/block-editor");
|
|
42
41
|
var import_hooks = require("@wordpress/hooks");
|
|
43
|
-
var
|
|
42
|
+
var import_deprecated = __toESM(require("./deprecated.cjs"));
|
|
44
43
|
var import_init_block = __toESM(require("../utils/init-block.cjs"));
|
|
45
44
|
var import_block = __toESM(require("./block.json"));
|
|
46
45
|
var import_edit = __toESM(require("./edit.cjs"));
|
|
47
46
|
var import_save = __toESM(require("./save.cjs"));
|
|
48
47
|
var import_hooks2 = require("./hooks.cjs");
|
|
49
48
|
var import_transforms = __toESM(require("./transforms.cjs"));
|
|
50
|
-
var
|
|
51
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
52
|
-
var { fieldsKey, formKey } = (0, import_lock_unlock.unlock)(import_blocks.privateApis);
|
|
49
|
+
var import_variations = __toESM(require("./variations.cjs"));
|
|
53
50
|
var { name } = import_block.default;
|
|
54
51
|
var settings = {
|
|
55
52
|
icon: import_icons.customLink,
|
|
@@ -81,75 +78,10 @@ var settings = {
|
|
|
81
78
|
url: "https://example.com"
|
|
82
79
|
}
|
|
83
80
|
},
|
|
84
|
-
deprecated:
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
return attributes.nofollow;
|
|
88
|
-
},
|
|
89
|
-
attributes: {
|
|
90
|
-
label: {
|
|
91
|
-
type: "string"
|
|
92
|
-
},
|
|
93
|
-
type: {
|
|
94
|
-
type: "string"
|
|
95
|
-
},
|
|
96
|
-
nofollow: {
|
|
97
|
-
type: "boolean"
|
|
98
|
-
},
|
|
99
|
-
description: {
|
|
100
|
-
type: "string"
|
|
101
|
-
},
|
|
102
|
-
id: {
|
|
103
|
-
type: "number"
|
|
104
|
-
},
|
|
105
|
-
opensInNewTab: {
|
|
106
|
-
type: "boolean",
|
|
107
|
-
default: false
|
|
108
|
-
},
|
|
109
|
-
url: {
|
|
110
|
-
type: "string"
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
migrate({ nofollow, ...rest }) {
|
|
114
|
-
return {
|
|
115
|
-
rel: nofollow ? "nofollow" : "",
|
|
116
|
-
...rest
|
|
117
|
-
};
|
|
118
|
-
},
|
|
119
|
-
save() {
|
|
120
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.InnerBlocks.Content, {});
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
],
|
|
124
|
-
transforms: import_transforms.default
|
|
81
|
+
deprecated: import_deprecated.default,
|
|
82
|
+
transforms: import_transforms.default,
|
|
83
|
+
variations: import_variations.default
|
|
125
84
|
};
|
|
126
|
-
if (window.__experimentalContentOnlyInspectorFields) {
|
|
127
|
-
settings[fieldsKey] = [
|
|
128
|
-
{
|
|
129
|
-
id: "label",
|
|
130
|
-
label: (0, import_i18n.__)("Label"),
|
|
131
|
-
type: "text",
|
|
132
|
-
Edit: "rich-text"
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
id: "link",
|
|
136
|
-
label: (0, import_i18n.__)("Link"),
|
|
137
|
-
type: "url",
|
|
138
|
-
Edit: "link",
|
|
139
|
-
getValue: ({ item }) => ({
|
|
140
|
-
url: item.url,
|
|
141
|
-
rel: item.rel
|
|
142
|
-
}),
|
|
143
|
-
setValue: ({ value }) => ({
|
|
144
|
-
url: value.url,
|
|
145
|
-
rel: value.rel
|
|
146
|
-
})
|
|
147
|
-
}
|
|
148
|
-
];
|
|
149
|
-
settings[formKey] = {
|
|
150
|
-
fields: ["label", "link"]
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
85
|
var init = () => {
|
|
154
86
|
(0, import_hooks.addFilter)(
|
|
155
87
|
"blocks.registerBlockType",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/navigation-link/index.
|
|
4
|
-
"sourcesContent": ["import { _x,
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,+BAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA,
|
|
6
|
-
"names": ["metadata", "import_hooks", "
|
|
3
|
+
"sources": ["../../src/navigation-link/index.js"],
|
|
4
|
+
"sourcesContent": ["import { _x, sprintf } from '@wordpress/i18n';\nimport { customLink as linkIcon } from '@wordpress/icons';\nimport { addFilter } from '@wordpress/hooks';\nimport deprecated from './deprecated';\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport save from './save';\nimport { enhanceNavigationLinkVariations } from './hooks';\nimport transforms from './transforms';\nimport variations from './variations';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon: linkIcon,\n\n\t__experimentalLabel( attributes, { context } ) {\n\t\tif ( context === 'list-view' ) {\n\t\t\treturn attributes?.label;\n\t\t}\n\n\t\tif ( context === 'appender' ) {\n\t\t\tconst type = attributes?.type || 'link';\n\t\t\treturn sprintf(\n\t\t\t\t/* translators: %s: block type (e.g., 'page', 'post', 'category') */\n\t\t\t\t_x( 'Add %s', 'add default block type' ),\n\t\t\t\ttype\n\t\t\t);\n\t\t}\n\n\t\t// Backwards compatibility - return label for unknown contexts\n\t\treturn attributes?.label;\n\t},\n\n\tmerge( leftAttributes, { label: rightLabel = '' } ) {\n\t\treturn {\n\t\t\t...leftAttributes,\n\t\t\tlabel: leftAttributes.label + rightLabel,\n\t\t};\n\t},\n\n\tedit,\n\n\tsave,\n\n\texample: {\n\t\tattributes: {\n\t\t\tlabel: _x( 'Example Link', 'navigation link preview example' ),\n\t\t\turl: 'https://example.com',\n\t\t},\n\t},\n\n\tdeprecated,\n\ttransforms,\n\tvariations,\n};\n\nexport const init = () => {\n\taddFilter(\n\t\t'blocks.registerBlockType',\n\t\t'core/navigation-link',\n\t\tenhanceNavigationLinkVariations\n\t);\n\n\treturn initBlock( { name, metadata, settings } );\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,+BAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA,kBAA4B;AAC5B,mBAAuC;AACvC,mBAA0B;AAC1B,wBAAuB;AACvB,wBAAsB;AACtB,mBAAqB;AACrB,kBAAiB;AACjB,kBAAiB;AACjB,IAAAC,gBAAgD;AAChD,wBAAuB;AACvB,wBAAuB;AAEvB,IAAM,EAAE,KAAK,IAAI,aAAAD;AAIV,IAAM,WAAW;AAAA,EACvB,MAAM,aAAAE;AAAA,EAEN,oBAAqB,YAAY,EAAE,QAAQ,GAAI;AAC9C,QAAK,YAAY,aAAc;AAC9B,aAAO,YAAY;AAAA,IACpB;AAEA,QAAK,YAAY,YAAa;AAC7B,YAAM,OAAO,YAAY,QAAQ;AACjC,iBAAO;AAAA;AAAA,YAEN,gBAAI,UAAU,wBAAyB;AAAA,QACvC;AAAA,MACD;AAAA,IACD;AAGA,WAAO,YAAY;AAAA,EACpB;AAAA,EAEA,MAAO,gBAAgB,EAAE,OAAO,aAAa,GAAG,GAAI;AACnD,WAAO;AAAA,MACN,GAAG;AAAA,MACH,OAAO,eAAe,QAAQ;AAAA,IAC/B;AAAA,EACD;AAAA,EAEA,kBAAAC;AAAA,EAEA,kBAAAC;AAAA,EAEA,SAAS;AAAA,IACR,YAAY;AAAA,MACX,WAAO,gBAAI,gBAAgB,iCAAkC;AAAA,MAC7D,KAAK;AAAA,IACN;AAAA,EACD;AAAA,EAEA,8BAAAC;AAAA,EACA,8BAAAC;AAAA,EACA,8BAAAC;AACD;AAEO,IAAM,OAAO,MAAM;AACzB;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAEA,aAAO,kBAAAC,SAAW,EAAE,MAAM,uBAAAC,SAAU,SAAS,CAAE;AAChD;",
|
|
6
|
+
"names": ["metadata", "import_hooks", "linkIcon", "edit", "save", "deprecated", "transforms", "variations", "initBlock", "metadata"]
|
|
7
7
|
}
|
|
@@ -17,12 +17,27 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
|
|
20
|
-
// packages/block-library/src/
|
|
21
|
-
var
|
|
22
|
-
__export(
|
|
23
|
-
default: () =>
|
|
20
|
+
// packages/block-library/src/navigation-link/variations.js
|
|
21
|
+
var variations_exports = {};
|
|
22
|
+
__export(variations_exports, {
|
|
23
|
+
default: () => variations_default
|
|
24
24
|
});
|
|
25
|
-
module.exports = __toCommonJS(
|
|
26
|
-
var
|
|
27
|
-
var
|
|
28
|
-
|
|
25
|
+
module.exports = __toCommonJS(variations_exports);
|
|
26
|
+
var import_i18n = require("@wordpress/i18n");
|
|
27
|
+
var import_icons = require("@wordpress/icons");
|
|
28
|
+
var variations = [
|
|
29
|
+
{
|
|
30
|
+
name: "custom-link",
|
|
31
|
+
title: (0, import_i18n.__)("Custom Link"),
|
|
32
|
+
description: (0, import_i18n.__)("Add a custom link to your navigation."),
|
|
33
|
+
icon: import_icons.customLink,
|
|
34
|
+
attributes: {
|
|
35
|
+
kind: "custom"
|
|
36
|
+
},
|
|
37
|
+
isActive: (blockAttributes) => blockAttributes.kind === "custom",
|
|
38
|
+
isDefault: true,
|
|
39
|
+
scope: ["inserter"]
|
|
40
|
+
}
|
|
41
|
+
];
|
|
42
|
+
var variations_default = variations;
|
|
43
|
+
//# sourceMappingURL=variations.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/navigation-link/variations.js"],
|
|
4
|
+
"sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport { customLink as linkIcon } from '@wordpress/icons';\n\nconst variations = [\n\t{\n\t\tname: 'custom-link',\n\t\ttitle: __( 'Custom Link' ),\n\t\tdescription: __( 'Add a custom link to your navigation.' ),\n\t\ticon: linkIcon,\n\t\tattributes: {\n\t\t\tkind: 'custom',\n\t\t},\n\t\tisActive: ( blockAttributes ) => blockAttributes.kind === 'custom',\n\t\tisDefault: true,\n\t\tscope: [ 'inserter' ],\n\t},\n];\n\nexport default variations;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAmB;AACnB,mBAAuC;AAEvC,IAAM,aAAa;AAAA,EAClB;AAAA,IACC,MAAM;AAAA,IACN,WAAO,gBAAI,aAAc;AAAA,IACzB,iBAAa,gBAAI,uCAAwC;AAAA,IACzD,MAAM,aAAAA;AAAA,IACN,YAAY;AAAA,MACX,MAAM;AAAA,IACP;AAAA,IACA,UAAU,CAAE,oBAAqB,gBAAgB,SAAS;AAAA,IAC1D,WAAW;AAAA,IACX,OAAO,CAAE,UAAW;AAAA,EACrB;AACD;AAEA,IAAO,qBAAQ;",
|
|
6
|
+
"names": ["linkIcon"]
|
|
7
|
+
}
|
|
@@ -38,14 +38,11 @@ __export(navigation_submenu_exports, {
|
|
|
38
38
|
module.exports = __toCommonJS(navigation_submenu_exports);
|
|
39
39
|
var import_icons = require("@wordpress/icons");
|
|
40
40
|
var import_i18n = require("@wordpress/i18n");
|
|
41
|
-
var import_blocks = require("@wordpress/blocks");
|
|
42
41
|
var import_init_block = __toESM(require("../utils/init-block.cjs"));
|
|
43
42
|
var import_block = __toESM(require("./block.json"));
|
|
44
43
|
var import_edit = __toESM(require("./edit.cjs"));
|
|
45
44
|
var import_save = __toESM(require("./save.cjs"));
|
|
46
45
|
var import_transforms = __toESM(require("./transforms.cjs"));
|
|
47
|
-
var import_lock_unlock = require("../lock-unlock.cjs");
|
|
48
|
-
var { fieldsKey, formKey } = (0, import_lock_unlock.unlock)(import_blocks.privateApis);
|
|
49
46
|
var { name } = import_block.default;
|
|
50
47
|
var settings = {
|
|
51
48
|
icon: ({ context }) => {
|
|
@@ -72,35 +69,6 @@ var settings = {
|
|
|
72
69
|
save: import_save.default,
|
|
73
70
|
transforms: import_transforms.default
|
|
74
71
|
};
|
|
75
|
-
if (window.__experimentalContentOnlyInspectorFields) {
|
|
76
|
-
settings[fieldsKey] = [
|
|
77
|
-
{
|
|
78
|
-
id: "label",
|
|
79
|
-
label: (0, import_i18n.__)("Label"),
|
|
80
|
-
type: "text",
|
|
81
|
-
Edit: "rich-text"
|
|
82
|
-
//TODO: replace with custom component
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
id: "link",
|
|
86
|
-
label: (0, import_i18n.__)("Link"),
|
|
87
|
-
type: "url",
|
|
88
|
-
Edit: "link",
|
|
89
|
-
// TODO: replace with custom component
|
|
90
|
-
getValue: ({ item }) => ({
|
|
91
|
-
url: item.url,
|
|
92
|
-
rel: item.rel
|
|
93
|
-
}),
|
|
94
|
-
setValue: ({ value }) => ({
|
|
95
|
-
url: value.url,
|
|
96
|
-
rel: value.rel
|
|
97
|
-
})
|
|
98
|
-
}
|
|
99
|
-
];
|
|
100
|
-
settings[formKey] = {
|
|
101
|
-
fields: ["label", "link"]
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
72
|
var init = () => (0, import_init_block.default)({ name, metadata: import_block.default, settings });
|
|
105
73
|
// Annotate the CommonJS export names for ESM import in node:
|
|
106
74
|
0 && (module.exports = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/navigation-submenu/index.js"],
|
|
4
|
-
"sourcesContent": ["import { page, addSubmenu } from '@wordpress/icons';\nimport { _x
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,+BAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA,mBAAiC;AACjC,
|
|
6
|
-
"names": ["metadata", "
|
|
4
|
+
"sourcesContent": ["import { page, addSubmenu } from '@wordpress/icons';\nimport { _x } from '@wordpress/i18n';\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport save from './save';\nimport transforms from './transforms';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon: ( { context } ) => {\n\t\tif ( context === 'list-view' ) {\n\t\t\treturn page;\n\t\t}\n\t\treturn addSubmenu;\n\t},\n\t__experimentalLabel( attributes, { context } ) {\n\t\tconst { label } = attributes;\n\n\t\tconst customName = attributes?.metadata?.name;\n\n\t\t// In the list view and breadcrumb, use the block's menu label as the label.\n\t\t// If the menu label is empty, fall back to the default label.\n\t\tif (\n\t\t\t( context === 'list-view' || context === 'breadcrumb' ) &&\n\t\t\tcustomName\n\t\t) {\n\t\t\treturn customName;\n\t\t}\n\n\t\treturn label;\n\t},\n\tedit,\n\texample: {\n\t\tattributes: {\n\t\t\tlabel: _x( 'About', 'Example link text for Navigation Submenu' ),\n\t\t\ttype: 'page',\n\t\t},\n\t},\n\tsave,\n\ttransforms,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,+BAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA,mBAAiC;AACjC,kBAAmB;AACnB,wBAAsB;AACtB,mBAAqB;AACrB,kBAAiB;AACjB,kBAAiB;AACjB,wBAAuB;AAEvB,IAAM,EAAE,KAAK,IAAI,aAAAA;AAIV,IAAM,WAAW;AAAA,EACvB,MAAM,CAAE,EAAE,QAAQ,MAAO;AACxB,QAAK,YAAY,aAAc;AAC9B,aAAO;AAAA,IACR;AACA,WAAO;AAAA,EACR;AAAA,EACA,oBAAqB,YAAY,EAAE,QAAQ,GAAI;AAC9C,UAAM,EAAE,MAAM,IAAI;AAElB,UAAM,aAAa,YAAY,UAAU;AAIzC,SACG,YAAY,eAAe,YAAY,iBACzC,YACC;AACD,aAAO;AAAA,IACR;AAEA,WAAO;AAAA,EACR;AAAA,EACA,kBAAAC;AAAA,EACA,SAAS;AAAA,IACR,YAAY;AAAA,MACX,WAAO,gBAAI,SAAS,0CAA2C;AAAA,MAC/D,MAAM;AAAA,IACP;AAAA,EACD;AAAA,EACA,kBAAAC;AAAA,EACA,8BAAAC;AACD;AAEO,IAAM,OAAO,UAAM,kBAAAC,SAAW,EAAE,MAAM,uBAAAC,SAAU,SAAS,CAAE;",
|
|
6
|
+
"names": ["metadata", "edit", "save", "transforms", "initBlock", "metadata"]
|
|
7
7
|
}
|
|
@@ -38,15 +38,12 @@ __export(paragraph_exports, {
|
|
|
38
38
|
module.exports = __toCommonJS(paragraph_exports);
|
|
39
39
|
var import_i18n = require("@wordpress/i18n");
|
|
40
40
|
var import_icons = require("@wordpress/icons");
|
|
41
|
-
var import_blocks = require("@wordpress/blocks");
|
|
42
41
|
var import_init_block = __toESM(require("../utils/init-block.cjs"));
|
|
43
42
|
var import_deprecated = __toESM(require("./deprecated.cjs"));
|
|
44
43
|
var import_edit = __toESM(require("./edit.cjs"));
|
|
45
44
|
var import_block = __toESM(require("./block.json"));
|
|
46
45
|
var import_save = __toESM(require("./save.cjs"));
|
|
47
46
|
var import_transforms = __toESM(require("./transforms.cjs"));
|
|
48
|
-
var import_lock_unlock = require("../lock-unlock.cjs");
|
|
49
|
-
var { fieldsKey, formKey } = (0, import_lock_unlock.unlock)(import_blocks.privateApis);
|
|
50
47
|
var { name } = import_block.default;
|
|
51
48
|
var settings = {
|
|
52
49
|
icon: import_icons.paragraph,
|
|
@@ -80,20 +77,6 @@ var settings = {
|
|
|
80
77
|
edit: import_edit.default,
|
|
81
78
|
save: import_save.default
|
|
82
79
|
};
|
|
83
|
-
if (window.__experimentalContentOnlyInspectorFields) {
|
|
84
|
-
settings[fieldsKey] = [
|
|
85
|
-
{
|
|
86
|
-
id: "content",
|
|
87
|
-
label: (0, import_i18n.__)("Content"),
|
|
88
|
-
type: "text",
|
|
89
|
-
Edit: "rich-text"
|
|
90
|
-
// TODO: replace with custom component
|
|
91
|
-
}
|
|
92
|
-
];
|
|
93
|
-
settings[formKey] = {
|
|
94
|
-
fields: ["content"]
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
80
|
var init = () => (0, import_init_block.default)({ name, metadata: import_block.default, settings });
|
|
98
81
|
// Annotate the CommonJS export names for ESM import in node:
|
|
99
82
|
0 && (module.exports = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/paragraph/index.js"],
|
|
4
|
-
"sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport { paragraph as icon } from '@wordpress/icons';\nimport
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,+BAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA,kBAAmB;AACnB,mBAAkC;AAClC,
|
|
6
|
-
"names": ["metadata", "
|
|
4
|
+
"sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport { paragraph as icon } from '@wordpress/icons';\nimport initBlock from '../utils/init-block';\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tcontent: __(\n\t\t\t\t'In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing.'\n\t\t\t),\n\t\t},\n\t},\n\t__experimentalLabel( attributes, { context } ) {\n\t\tconst customName = attributes?.metadata?.name;\n\n\t\tif (\n\t\t\t( context === 'list-view' || context === 'breadcrumb' ) &&\n\t\t\tcustomName\n\t\t) {\n\t\t\treturn customName;\n\t\t}\n\n\t\tif ( context === 'accessibility' ) {\n\t\t\tif ( customName ) {\n\t\t\t\treturn customName;\n\t\t\t}\n\n\t\t\tconst { content } = attributes;\n\t\t\treturn ! content || content.length === 0 ? __( 'Empty' ) : content;\n\t\t}\n\t},\n\ttransforms,\n\tdeprecated,\n\tmerge( attributes, attributesToMerge ) {\n\t\treturn {\n\t\t\tcontent:\n\t\t\t\t( attributes.content || '' ) +\n\t\t\t\t( attributesToMerge.content || '' ),\n\t\t};\n\t},\n\tedit,\n\tsave,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,+BAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA,kBAAmB;AACnB,mBAAkC;AAClC,wBAAsB;AACtB,wBAAuB;AACvB,kBAAiB;AACjB,mBAAqB;AACrB,kBAAiB;AACjB,wBAAuB;AAEvB,IAAM,EAAE,KAAK,IAAI,aAAAA;AAIV,IAAM,WAAW;AAAA,EACvB,mBAAAC;AAAA,EACA,SAAS;AAAA,IACR,YAAY;AAAA,MACX,aAAS;AAAA,QACR;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAAA,EACA,oBAAqB,YAAY,EAAE,QAAQ,GAAI;AAC9C,UAAM,aAAa,YAAY,UAAU;AAEzC,SACG,YAAY,eAAe,YAAY,iBACzC,YACC;AACD,aAAO;AAAA,IACR;AAEA,QAAK,YAAY,iBAAkB;AAClC,UAAK,YAAa;AACjB,eAAO;AAAA,MACR;AAEA,YAAM,EAAE,QAAQ,IAAI;AACpB,aAAO,CAAE,WAAW,QAAQ,WAAW,QAAI,gBAAI,OAAQ,IAAI;AAAA,IAC5D;AAAA,EACD;AAAA,EACA,8BAAAC;AAAA,EACA,8BAAAC;AAAA,EACA,MAAO,YAAY,mBAAoB;AACtC,WAAO;AAAA,MACN,UACG,WAAW,WAAW,OACtB,kBAAkB,WAAW;AAAA,IACjC;AAAA,EACD;AAAA,EACA,kBAAAC;AAAA,EACA,kBAAAC;AACD;AAEO,IAAM,OAAO,UAAM,kBAAAC,SAAW,EAAE,MAAM,uBAAAC,SAAU,SAAS,CAAE;",
|
|
6
|
+
"names": ["metadata", "icon", "transforms", "deprecated", "edit", "save", "initBlock", "metadata"]
|
|
7
7
|
}
|
|
@@ -26,7 +26,6 @@ module.exports = __toCommonJS(use_enter_exports);
|
|
|
26
26
|
var import_element = require("@wordpress/element");
|
|
27
27
|
var import_compose = require("@wordpress/compose");
|
|
28
28
|
var import_rich_text = require("@wordpress/rich-text");
|
|
29
|
-
var import_keycodes = require("@wordpress/keycodes");
|
|
30
29
|
var import_data = require("@wordpress/data");
|
|
31
30
|
var import_block_editor = require("@wordpress/block-editor");
|
|
32
31
|
var import_blocks = require("@wordpress/blocks");
|
|
@@ -46,11 +45,11 @@ function useOnEnter(props) {
|
|
|
46
45
|
const propsRef = (0, import_element.useRef)(props);
|
|
47
46
|
propsRef.current = props;
|
|
48
47
|
return (0, import_compose.useRefEffect)((element) => {
|
|
49
|
-
function
|
|
48
|
+
function onBeforeInput(event) {
|
|
50
49
|
if (event.defaultPrevented) {
|
|
51
50
|
return;
|
|
52
51
|
}
|
|
53
|
-
if (event.
|
|
52
|
+
if (event.inputType !== "insertParagraph") {
|
|
54
53
|
return;
|
|
55
54
|
}
|
|
56
55
|
const { content, clientId } = propsRef.current;
|
|
@@ -108,7 +107,12 @@ function useOnEnter(props) {
|
|
|
108
107
|
selectionChange(middle.clientId);
|
|
109
108
|
});
|
|
110
109
|
}
|
|
111
|
-
return subscribeOwnedListener(
|
|
110
|
+
return subscribeOwnedListener(
|
|
111
|
+
element,
|
|
112
|
+
"beforeinput",
|
|
113
|
+
onBeforeInput,
|
|
114
|
+
true
|
|
115
|
+
);
|
|
112
116
|
}, []);
|
|
113
117
|
}
|
|
114
118
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/paragraph/use-enter.js"],
|
|
4
|
-
"sourcesContent": ["import { useRef } from '@wordpress/element';\nimport { useRefEffect } from '@wordpress/compose';\nimport { privateApis as richTextPrivateApis } from '@wordpress/rich-text';\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAuB;AACvB,qBAA6B;AAC7B,uBAAmD;AACnD,
|
|
4
|
+
"sourcesContent": ["import { useRef } from '@wordpress/element';\nimport { useRefEffect } from '@wordpress/compose';\nimport { privateApis as richTextPrivateApis } from '@wordpress/rich-text';\nimport { useSelect, useDispatch, useRegistry } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport {\n\thasBlockSupport,\n\tcreateBlock,\n\tcloneBlock,\n\tgetDefaultBlockName,\n} from '@wordpress/blocks';\nimport { unlock } from '../lock-unlock';\n\nconst { subscribeOwnedListener } = unlock( richTextPrivateApis );\n\nexport function useOnEnter( props ) {\n\tconst { batch } = useRegistry();\n\tconst { moveBlocksToPosition, replaceBlocks, selectionChange } =\n\t\tuseDispatch( blockEditorStore );\n\tconst {\n\t\tgetBlockRootClientId,\n\t\tgetBlockIndex,\n\t\tgetBlockOrder,\n\t\tgetBlockName,\n\t\tgetBlock,\n\t\tcanInsertBlockType,\n\t} = useSelect( blockEditorStore );\n\tconst propsRef = useRef( props );\n\tpropsRef.current = props;\n\treturn useRefEffect( ( element ) => {\n\t\tfunction onBeforeInput( event ) {\n\t\t\tif ( event.defaultPrevented ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( event.inputType !== 'insertParagraph' ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst { content, clientId } = propsRef.current;\n\n\t\t\t// The paragraph should be empty.\n\t\t\tif ( content.length ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst wrapperClientId = getBlockRootClientId( clientId );\n\n\t\t\tif (\n\t\t\t\t! hasBlockSupport(\n\t\t\t\t\tgetBlockName( wrapperClientId ),\n\t\t\t\t\t'__experimentalOnEnter',\n\t\t\t\t\tfalse\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst order = getBlockOrder( wrapperClientId );\n\t\t\tconst position = order.indexOf( clientId );\n\n\t\t\t// If it is the last block, exit.\n\t\t\tif ( position === order.length - 1 ) {\n\t\t\t\tlet newWrapperClientId = wrapperClientId;\n\n\t\t\t\twhile (\n\t\t\t\t\t! canInsertBlockType(\n\t\t\t\t\t\tgetBlockName( clientId ),\n\t\t\t\t\t\tgetBlockRootClientId( newWrapperClientId )\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\tnewWrapperClientId =\n\t\t\t\t\t\tgetBlockRootClientId( newWrapperClientId );\n\t\t\t\t}\n\n\t\t\t\tif ( typeof newWrapperClientId === 'string' ) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\t[ clientId ],\n\t\t\t\t\t\twrapperClientId,\n\t\t\t\t\t\tgetBlockRootClientId( newWrapperClientId ),\n\t\t\t\t\t\tgetBlockIndex( newWrapperClientId ) + 1\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst defaultBlockName = getDefaultBlockName();\n\t\t\tconst wrapperBlockName = getBlockName( wrapperClientId );\n\t\t\tconst grandparentClientId = getBlockRootClientId( wrapperClientId );\n\n\t\t\tif (\n\t\t\t\t! canInsertBlockType( defaultBlockName, grandparentClientId ) ||\n\t\t\t\t! canInsertBlockType( wrapperBlockName, grandparentClientId )\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tevent.preventDefault();\n\n\t\t\t// If it is in the middle, split the block in two.\n\t\t\tconst wrapperBlock = getBlock( wrapperClientId );\n\t\t\tconst head = cloneBlock( {\n\t\t\t\t...wrapperBlock,\n\t\t\t\tinnerBlocks: wrapperBlock.innerBlocks.slice( 0, position ),\n\t\t\t} );\n\t\t\tconst middle = createBlock( defaultBlockName );\n\t\t\tconst tail = cloneBlock( {\n\t\t\t\t...wrapperBlock,\n\t\t\t\tinnerBlocks: wrapperBlock.innerBlocks.slice( position + 1 ),\n\t\t\t} );\n\n\t\t\tbatch( () => {\n\t\t\t\treplaceBlocks( wrapperClientId, [ head, middle, tail ] );\n\t\t\t\t// The selected paragraph is a descendant of the replaced\n\t\t\t\t// wrapper, so `replaceBlocks` leaves the selection stale.\n\t\t\t\t// Move it to the new default block explicitly.\n\t\t\t\tselectionChange( middle.clientId );\n\t\t\t} );\n\t\t}\n\n\t\t// Enter is handled on beforeinput: moving focus while the keydown\n\t\t// is still being handled leaves the iOS keyboard's\n\t\t// auto-capitalization stale. Capture phase so we run before\n\t\t// writing-flow's ancestor-bubble handler that gates on\n\t\t// `event.defaultPrevented`.\n\t\treturn subscribeOwnedListener(\n\t\t\telement,\n\t\t\t'beforeinput',\n\t\t\tonBeforeInput,\n\t\t\ttrue\n\t\t);\n\t}, [] );\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAuB;AACvB,qBAA6B;AAC7B,uBAAmD;AACnD,kBAAoD;AACpD,0BAA0C;AAC1C,oBAKO;AACP,yBAAuB;AAEvB,IAAM,EAAE,uBAAuB,QAAI,2BAAQ,iBAAAA,WAAoB;AAExD,SAAS,WAAY,OAAQ;AACnC,QAAM,EAAE,MAAM,QAAI,yBAAY;AAC9B,QAAM,EAAE,sBAAsB,eAAe,gBAAgB,QAC5D,yBAAa,oBAAAC,KAAiB;AAC/B,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,QAAI,uBAAW,oBAAAA,KAAiB;AAChC,QAAM,eAAW,uBAAQ,KAAM;AAC/B,WAAS,UAAU;AACnB,aAAO,6BAAc,CAAE,YAAa;AACnC,aAAS,cAAe,OAAQ;AAC/B,UAAK,MAAM,kBAAmB;AAC7B;AAAA,MACD;AAEA,UAAK,MAAM,cAAc,mBAAoB;AAC5C;AAAA,MACD;AAEA,YAAM,EAAE,SAAS,SAAS,IAAI,SAAS;AAGvC,UAAK,QAAQ,QAAS;AACrB;AAAA,MACD;AAEA,YAAM,kBAAkB,qBAAsB,QAAS;AAEvD,UACC,KAAE;AAAA,QACD,aAAc,eAAgB;AAAA,QAC9B;AAAA,QACA;AAAA,MACD,GACC;AACD;AAAA,MACD;AAEA,YAAM,QAAQ,cAAe,eAAgB;AAC7C,YAAM,WAAW,MAAM,QAAS,QAAS;AAGzC,UAAK,aAAa,MAAM,SAAS,GAAI;AACpC,YAAI,qBAAqB;AAEzB,eACC,CAAE;AAAA,UACD,aAAc,QAAS;AAAA,UACvB,qBAAsB,kBAAmB;AAAA,QAC1C,GACC;AACD,+BACC,qBAAsB,kBAAmB;AAAA,QAC3C;AAEA,YAAK,OAAO,uBAAuB,UAAW;AAC7C,gBAAM,eAAe;AACrB;AAAA,YACC,CAAE,QAAS;AAAA,YACX;AAAA,YACA,qBAAsB,kBAAmB;AAAA,YACzC,cAAe,kBAAmB,IAAI;AAAA,UACvC;AAAA,QACD;AACA;AAAA,MACD;AAEA,YAAM,uBAAmB,mCAAoB;AAC7C,YAAM,mBAAmB,aAAc,eAAgB;AACvD,YAAM,sBAAsB,qBAAsB,eAAgB;AAElE,UACC,CAAE,mBAAoB,kBAAkB,mBAAoB,KAC5D,CAAE,mBAAoB,kBAAkB,mBAAoB,GAC3D;AACD;AAAA,MACD;AAEA,YAAM,eAAe;AAGrB,YAAM,eAAe,SAAU,eAAgB;AAC/C,YAAM,WAAO,0BAAY;AAAA,QACxB,GAAG;AAAA,QACH,aAAa,aAAa,YAAY,MAAO,GAAG,QAAS;AAAA,MAC1D,CAAE;AACF,YAAM,aAAS,2BAAa,gBAAiB;AAC7C,YAAM,WAAO,0BAAY;AAAA,QACxB,GAAG;AAAA,QACH,aAAa,aAAa,YAAY,MAAO,WAAW,CAAE;AAAA,MAC3D,CAAE;AAEF,YAAO,MAAM;AACZ,sBAAe,iBAAiB,CAAE,MAAM,QAAQ,IAAK,CAAE;AAIvD,wBAAiB,OAAO,QAAS;AAAA,MAClC,CAAE;AAAA,IACH;AAOA,WAAO;AAAA,MACN;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,EACD,GAAG,CAAC,CAAE;AACP;",
|
|
6
6
|
"names": ["richTextPrivateApis", "blockEditorStore"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/post-template/edit.jsx"],
|
|
4
|
-
"sourcesContent": ["import clsx from 'clsx';\nimport { memo, useMemo, useState } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tBlockControls,\n\tBlockContextProvider,\n\t__experimentalUseBlockPreview as useBlockPreview,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { Spinner, ToolbarGroup } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { list, grid } from '@wordpress/icons';\n\n// The Post Template's layout attribute arranges the post items, not the\n// blocks of the template, which always stack vertically inside each post\n// item. Override the inherited layout so inner block UI (movers, inserters,\n// grid controls) doesn't follow the post items' grid.\nconst INNER_BLOCKS_LAYOUT = { type: 'default' };\n\nfunction PostTemplateInnerBlocks( { classList } ) {\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{ className: clsx( 'wp-block-post', classList ) },\n\t\t{\n\t\t\t__unstableDisableLayoutClassNames: true,\n\t\t\tlayout: INNER_BLOCKS_LAYOUT,\n\t\t}\n\t);\n\treturn <li { ...innerBlocksProps } />;\n}\n\nfunction PostTemplateBlockPreview( {\n\tblocks,\n\tblockContextId,\n\tclassList,\n\tisHidden,\n\tsetActiveBlockContextId,\n} ) {\n\tconst blockPreviewProps = useBlockPreview( {\n\t\tblocks,\n\t\tprops: {\n\t\t\tclassName: clsx( 'wp-block-post', classList ),\n\t\t},\n\t} );\n\n\tconst handleOnClick = () => {\n\t\tsetActiveBlockContextId( blockContextId );\n\t};\n\n\tconst style = {\n\t\tdisplay: isHidden ? 'none' : undefined,\n\t};\n\n\treturn (\n\t\t<li\n\t\t\t{ ...blockPreviewProps }\n\t\t\ttabIndex={ 0 }\n\t\t\t// eslint-disable-next-line jsx-a11y/no-noninteractive-element-to-interactive-role\n\t\t\trole=\"button\"\n\t\t\tonClick={ handleOnClick }\n\t\t\tonKeyPress={ handleOnClick }\n\t\t\tstyle={ style }\n\t\t/>\n\t);\n}\n\nconst MemoizedPostTemplateBlockPreview = memo( PostTemplateBlockPreview );\n\nexport default function PostTemplateEdit( {\n\tsetAttributes,\n\tclientId,\n\tcontext: {\n\t\tquery: {\n\t\t\tperPage,\n\t\t\toffset = 0,\n\t\t\tpostType,\n\t\t\torder,\n\t\t\torderBy,\n\t\t\tauthor,\n\t\t\tsearch,\n\t\t\texclude,\n\t\t\tsticky,\n\t\t\tinherit,\n\t\t\ttaxQuery,\n\t\t\tparents,\n\t\t\tpages,\n\t\t\tformat,\n\t\t\texcludeCurrent,\n\t\t\t// We gather extra query args to pass to the REST API call.\n\t\t\t// This way extenders of Query Loop can add their own query args,\n\t\t\t// and have accurate previews in the editor.\n\t\t\t// Noting though that these args should either be supported by the\n\t\t\t// REST API or be handled by custom REST filters like `rest_{$this->post_type}_query`.\n\t\t\t...restQueryArgs\n\t\t} = {},\n\t\ttemplateSlug,\n\t\tpreviewPostType,\n\t\tpostId,\n\t},\n\tattributes: { layout },\n\t__unstableLayoutClassNames,\n} ) {\n\tconst {\n\t\ttype: layoutType,\n\t\tcolumnCount = 3,\n\t\tminimumColumnWidth,\n\t} = layout || {};\n\tconst [ activeBlockContextId, setActiveBlockContextId ] = useState();\n\tconst { posts, blocks } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecords, getTaxonomies } = select( coreStore );\n\t\t\tconst { getBlocks } = select( blockEditorStore );\n\t\t\tconst templateCategory =\n\t\t\t\tinherit &&\n\t\t\t\ttemplateSlug?.startsWith( 'category-' ) &&\n\t\t\t\tgetEntityRecords( 'taxonomy', 'category', {\n\t\t\t\t\tcontext: 'view',\n\t\t\t\t\tper_page: 1,\n\t\t\t\t\t_fields: [ 'id' ],\n\t\t\t\t\tslug: templateSlug.replace( 'category-', '' ),\n\t\t\t\t} );\n\t\t\tconst templateTag =\n\t\t\t\tinherit &&\n\t\t\t\ttemplateSlug?.startsWith( 'tag-' ) &&\n\t\t\t\tgetEntityRecords( 'taxonomy', 'post_tag', {\n\t\t\t\t\tcontext: 'view',\n\t\t\t\t\tper_page: 1,\n\t\t\t\t\t_fields: [ 'id' ],\n\t\t\t\t\tslug: templateSlug.replace( 'tag-', '' ),\n\t\t\t\t} );\n\t\t\tconst query = {\n\t\t\t\toffset: offset || 0,\n\t\t\t\torder,\n\t\t\t\torderby: orderBy,\n\t\t\t};\n\t\t\t// There is no need to build the taxQuery if we inherit.\n\t\t\tif ( taxQuery && ! inherit ) {\n\t\t\t\tconst taxonomies = getTaxonomies( {\n\t\t\t\t\ttype: postType,\n\t\t\t\t\tper_page: -1,\n\t\t\t\t\tcontext: 'view',\n\t\t\t\t} );\n\t\t\t\t// Build REST API parameters from taxonomy terms, e.g.\n\t\t\t\t// `category`, `tags_exclude`.\n\t\t\t\tconst buildTaxQuery = ( terms, suffix = '' ) => {\n\t\t\t\t\treturn Object.entries( terms || {} ).reduce(\n\t\t\t\t\t\t( accumulator, [ taxonomySlug, termIds ] ) => {\n\t\t\t\t\t\t\tconst taxonomy = taxonomies?.find(\n\t\t\t\t\t\t\t\t( { slug } ) => slug === taxonomySlug\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tif ( taxonomy?.rest_base && termIds?.length ) {\n\t\t\t\t\t\t\t\taccumulator[ taxonomy.rest_base + suffix ] =\n\t\t\t\t\t\t\t\t\ttermIds;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn accumulator;\n\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\t\t\t\tconst builtTaxQuery = buildTaxQuery( taxQuery.include );\n\t\t\t\tif ( taxQuery.exclude ) {\n\t\t\t\t\tObject.assign(\n\t\t\t\t\t\tbuiltTaxQuery,\n\t\t\t\t\t\tbuildTaxQuery( taxQuery.exclude, '_exclude' )\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tif ( !! Object.keys( builtTaxQuery ).length ) {\n\t\t\t\t\tObject.assign( query, builtTaxQuery );\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( perPage ) {\n\t\t\t\tquery.per_page = perPage;\n\t\t\t}\n\t\t\tif ( author ) {\n\t\t\t\tquery.author = author;\n\t\t\t}\n\t\t\tif ( search ) {\n\t\t\t\tquery.search = search;\n\t\t\t}\n\t\t\tif ( exclude?.length ) {\n\t\t\t\tquery.exclude = exclude;\n\t\t\t}\n\t\t\tif ( parents?.length ) {\n\t\t\t\tquery.parent = parents;\n\t\t\t}\n\t\t\tif ( format?.length ) {\n\t\t\t\tquery.format = format;\n\t\t\t}\n\t\t\tif ( excludeCurrent && postId ) {\n\t\t\t\tif ( query.exclude ) {\n\t\t\t\t\tquery.exclude = [ ...query.exclude, postId ];\n\t\t\t\t} else {\n\t\t\t\t\tquery.exclude = [ postId ];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * Handle cases where sticky is set to `exclude` or `only`.\n\t\t\t * Which works as a `post__in/post__not_in` query for sticky posts.\n\t\t\t */\n\t\t\tif ( [ 'exclude', 'only' ].includes( sticky ) ) {\n\t\t\t\tquery.sticky = sticky === 'only';\n\t\t\t}\n\n\t\t\t// Empty string represents the default behavior of including sticky posts.\n\t\t\tif ( [ '', 'ignore' ].includes( sticky ) ) {\n\t\t\t\t// Remove any leftover sticky query parameter.\n\t\t\t\tdelete query.sticky;\n\t\t\t\tquery.ignore_sticky = sticky === 'ignore';\n\t\t\t}\n\n\t\t\t// If `inherit` is truthy, adjust conditionally the query to create a better preview.\n\t\t\tlet currentPostType = postType;\n\t\t\tif ( inherit ) {\n\t\t\t\t// Change the post-type if needed.\n\t\t\t\tif ( templateSlug?.startsWith( 'archive-' ) ) {\n\t\t\t\t\tquery.postType = templateSlug.replace( 'archive-', '' );\n\t\t\t\t\tcurrentPostType = query.postType;\n\t\t\t\t} else if ( templateCategory ) {\n\t\t\t\t\tquery.categories = templateCategory[ 0 ]?.id;\n\t\t\t\t} else if ( templateTag ) {\n\t\t\t\t\tquery.tags = templateTag[ 0 ]?.id;\n\t\t\t\t} else if (\n\t\t\t\t\ttemplateSlug?.startsWith( 'taxonomy-post_format' )\n\t\t\t\t) {\n\t\t\t\t\t// Get the post format slug from the template slug by removing the prefix.\n\t\t\t\t\tquery.format = templateSlug.replace(\n\t\t\t\t\t\t'taxonomy-post_format-post-format-',\n\t\t\t\t\t\t''\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// When we preview Query Loop blocks we should prefer the current\n\t\t\t// block's postType, which is passed through block context.\n\t\t\tconst usedPostType = previewPostType || currentPostType;\n\t\t\treturn {\n\t\t\t\tposts: getEntityRecords( 'postType', usedPostType, {\n\t\t\t\t\t...query,\n\t\t\t\t\t...restQueryArgs,\n\t\t\t\t} ),\n\t\t\t\tblocks: getBlocks( clientId ),\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\tperPage,\n\t\t\toffset,\n\t\t\torder,\n\t\t\torderBy,\n\t\t\tclientId,\n\t\t\tauthor,\n\t\t\tsearch,\n\t\t\tpostType,\n\t\t\texclude,\n\t\t\tsticky,\n\t\t\tinherit,\n\t\t\ttemplateSlug,\n\t\t\ttaxQuery,\n\t\t\tparents,\n\t\t\tformat,\n\t\t\trestQueryArgs,\n\t\t\tpreviewPostType,\n\t\t]\n\t);\n\tconst blockContexts = useMemo(\n\t\t() =>\n\t\t\tposts?.map( ( post ) => ( {\n\t\t\t\tpostType: post.type,\n\t\t\t\tpostId: post.id,\n\t\t\t\tclassList: post.class_list ?? '',\n\t\t\t} ) ),\n\t\t[ posts ]\n\t);\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( __unstableLayoutClassNames, {\n\t\t\t[ `columns-${ columnCount }` ]:\n\t\t\t\tlayoutType === 'grid' && columnCount, // Ensure column count is flagged via classname for backwards compatibility.\n\t\t\t'has-native-responsive-grid':\n\t\t\t\tlayoutType === 'grid' && columnCount && minimumColumnWidth, // Flag native responsive grid when minimum column width is provided.\n\t\t} ),\n\t} );\n\n\tif ( ! posts ) {\n\t\treturn (\n\t\t\t<p { ...blockProps }>\n\t\t\t\t<Spinner />\n\t\t\t</p>\n\t\t);\n\t}\n\n\tif ( ! posts.length ) {\n\t\treturn <p { ...blockProps }> { __( 'No results found.' ) }</p>;\n\t}\n\n\tconst setDisplayLayout = ( newDisplayLayout ) =>\n\t\tsetAttributes( {\n\t\t\tlayout: { ...layout, ...newDisplayLayout },\n\t\t} );\n\n\tconst displayLayoutControls = [\n\t\t{\n\t\t\ticon: list,\n\t\t\ttitle: _x( 'List view', 'Post template block display setting' ),\n\t\t\tonClick: () => setDisplayLayout( { type: 'default' } ),\n\t\t\tisActive: layoutType === 'default' || layoutType === 'constrained',\n\t\t},\n\t\t{\n\t\t\ticon: grid,\n\t\t\ttitle: _x( 'Grid view', 'Post template block display setting' ),\n\t\t\tonClick: () =>\n\t\t\t\tsetDisplayLayout( {\n\t\t\t\t\ttype: 'grid',\n\t\t\t\t\tcolumnCount,\n\t\t\t\t} ),\n\t\t\tisActive: layoutType === 'grid',\n\t\t},\n\t];\n\n\t// To avoid flicker when switching active block contexts, a preview is rendered\n\t// for each block context, but the preview for the active block context is hidden.\n\t// This ensures that when it is displayed again, the cached rendering of the\n\t// block preview is used, instead of having to re-render the preview from scratch.\n\treturn (\n\t\t<>\n\t\t\t<BlockControls>\n\t\t\t\t<ToolbarGroup controls={ displayLayoutControls } />\n\t\t\t</BlockControls>\n\n\t\t\t<ul { ...blockProps }>\n\t\t\t\t{ blockContexts &&\n\t\t\t\t\tblockContexts.map( ( blockContext ) => (\n\t\t\t\t\t\t<BlockContextProvider\n\t\t\t\t\t\t\tkey={ blockContext.postId }\n\t\t\t\t\t\t\tvalue={ blockContext }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ blockContext.postId ===\n\t\t\t\t\t\t\t( activeBlockContextId ||\n\t\t\t\t\t\t\t\tblockContexts[ 0 ]?.postId ) ? (\n\t\t\t\t\t\t\t\t<PostTemplateInnerBlocks\n\t\t\t\t\t\t\t\t\tclassList={ blockContext.classList }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) : null }\n\t\t\t\t\t\t\t<MemoizedPostTemplateBlockPreview\n\t\t\t\t\t\t\t\tblocks={ blocks }\n\t\t\t\t\t\t\t\tblockContextId={ blockContext.postId }\n\t\t\t\t\t\t\t\tclassList={ blockContext.classList }\n\t\t\t\t\t\t\t\tsetActiveBlockContextId={\n\t\t\t\t\t\t\t\t\tsetActiveBlockContextId\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tisHidden={\n\t\t\t\t\t\t\t\t\tblockContext.postId ===\n\t\t\t\t\t\t\t\t\t( activeBlockContextId ||\n\t\t\t\t\t\t\t\t\t\tblockContexts[ 0 ]?.postId )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</BlockContextProvider>\n\t\t\t\t\t) ) }\n\t\t\t</ul>\n\t\t</>\n\t);\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AACjB,qBAAwC;AACxC,kBAA0B;AAC1B,kBAAuB;AACvB,0BAOO;AACP,wBAAsC;AACtC,uBAAmC;AACnC,mBAA2B;AAgBnB;AAVR,IAAM,sBAAsB,EAAE,MAAM,UAAU;AAE9C,SAAS,wBAAyB,EAAE,UAAU,GAAI;AACjD,QAAM,uBAAmB;AAAA,IACxB,EAAE,eAAW,YAAAA,SAAM,iBAAiB,SAAU,EAAE;AAAA,IAChD;AAAA,MACC,mCAAmC;AAAA,MACnC,QAAQ;AAAA,IACT;AAAA,EACD;AACA,SAAO,4CAAC,QAAK,GAAG,kBAAmB;AACpC;AAEA,SAAS,yBAA0B;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAAI;AACH,QAAM,wBAAoB,oBAAAC,+BAAiB;AAAA,IAC1C;AAAA,IACA,OAAO;AAAA,MACN,eAAW,YAAAD,SAAM,iBAAiB,SAAU;AAAA,IAC7C;AAAA,EACD,CAAE;AAEF,QAAM,gBAAgB,MAAM;AAC3B,4BAAyB,cAAe;AAAA,EACzC;AAEA,QAAM,QAAQ;AAAA,IACb,SAAS,WAAW,SAAS;AAAA,EAC9B;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACL,UAAW;AAAA,MAEX,MAAK;AAAA,MACL,SAAU;AAAA,MACV,YAAa;AAAA,MACb;AAAA;AAAA,EACD;AAEF;AAEA,IAAM,uCAAmC,qBAAM,wBAAyB;AAEzD,SAAR,iBAAmC;AAAA,EACzC;AAAA,EACA;AAAA,EACA,SAAS;AAAA,IACR,OAAO;AAAA,MACN;AAAA,MACA,SAAS;AAAA,
|
|
4
|
+
"sourcesContent": ["import clsx from 'clsx';\nimport { memo, useMemo, useState } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tBlockControls,\n\tBlockContextProvider,\n\t__experimentalUseBlockPreview as useBlockPreview,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { Spinner, ToolbarGroup } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { list, grid } from '@wordpress/icons';\n\n// The Post Template's layout attribute arranges the post items, not the\n// blocks of the template, which always stack vertically inside each post\n// item. Override the inherited layout so inner block UI (movers, inserters,\n// grid controls) doesn't follow the post items' grid.\nconst INNER_BLOCKS_LAYOUT = { type: 'default' };\n\nfunction PostTemplateInnerBlocks( { classList } ) {\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{ className: clsx( 'wp-block-post', classList ) },\n\t\t{\n\t\t\t__unstableDisableLayoutClassNames: true,\n\t\t\tlayout: INNER_BLOCKS_LAYOUT,\n\t\t}\n\t);\n\treturn <li { ...innerBlocksProps } />;\n}\n\nfunction PostTemplateBlockPreview( {\n\tblocks,\n\tblockContextId,\n\tclassList,\n\tisHidden,\n\tsetActiveBlockContextId,\n} ) {\n\tconst blockPreviewProps = useBlockPreview( {\n\t\tblocks,\n\t\tprops: {\n\t\t\tclassName: clsx( 'wp-block-post', classList ),\n\t\t},\n\t} );\n\n\tconst handleOnClick = () => {\n\t\tsetActiveBlockContextId( blockContextId );\n\t};\n\n\tconst style = {\n\t\tdisplay: isHidden ? 'none' : undefined,\n\t};\n\n\treturn (\n\t\t<li\n\t\t\t{ ...blockPreviewProps }\n\t\t\ttabIndex={ 0 }\n\t\t\t// eslint-disable-next-line jsx-a11y/no-noninteractive-element-to-interactive-role\n\t\t\trole=\"button\"\n\t\t\tonClick={ handleOnClick }\n\t\t\tonKeyPress={ handleOnClick }\n\t\t\tstyle={ style }\n\t\t/>\n\t);\n}\n\nconst MemoizedPostTemplateBlockPreview = memo( PostTemplateBlockPreview );\n\nexport default function PostTemplateEdit( {\n\tsetAttributes,\n\tclientId,\n\tcontext: {\n\t\tquery: {\n\t\t\tperPage,\n\t\t\toffset = 0,\n\t\t\t// Match `build_query_vars_from_query_block()`, which queries posts when\n\t\t\t// `query` has no post type.\n\t\t\tpostType = 'post',\n\t\t\torder,\n\t\t\torderBy,\n\t\t\tauthor,\n\t\t\tsearch,\n\t\t\texclude,\n\t\t\tsticky,\n\t\t\tinherit,\n\t\t\ttaxQuery,\n\t\t\tparents,\n\t\t\tpages,\n\t\t\tformat,\n\t\t\texcludeCurrent,\n\t\t\t// We gather extra query args to pass to the REST API call.\n\t\t\t// This way extenders of Query Loop can add their own query args,\n\t\t\t// and have accurate previews in the editor.\n\t\t\t// Noting though that these args should either be supported by the\n\t\t\t// REST API or be handled by custom REST filters like `rest_{$this->post_type}_query`.\n\t\t\t...restQueryArgs\n\t\t} = {},\n\t\ttemplateSlug,\n\t\tpreviewPostType,\n\t\tpostId,\n\t},\n\tattributes: { layout },\n\t__unstableLayoutClassNames,\n} ) {\n\tconst {\n\t\ttype: layoutType,\n\t\tcolumnCount = 3,\n\t\tminimumColumnWidth,\n\t} = layout || {};\n\tconst [ activeBlockContextId, setActiveBlockContextId ] = useState();\n\tconst { posts, blocks } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecords, getTaxonomies } = select( coreStore );\n\t\t\tconst { getBlocks } = select( blockEditorStore );\n\t\t\tconst templateCategory =\n\t\t\t\tinherit &&\n\t\t\t\ttemplateSlug?.startsWith( 'category-' ) &&\n\t\t\t\tgetEntityRecords( 'taxonomy', 'category', {\n\t\t\t\t\tcontext: 'view',\n\t\t\t\t\tper_page: 1,\n\t\t\t\t\t_fields: [ 'id' ],\n\t\t\t\t\tslug: templateSlug.replace( 'category-', '' ),\n\t\t\t\t} );\n\t\t\tconst templateTag =\n\t\t\t\tinherit &&\n\t\t\t\ttemplateSlug?.startsWith( 'tag-' ) &&\n\t\t\t\tgetEntityRecords( 'taxonomy', 'post_tag', {\n\t\t\t\t\tcontext: 'view',\n\t\t\t\t\tper_page: 1,\n\t\t\t\t\t_fields: [ 'id' ],\n\t\t\t\t\tslug: templateSlug.replace( 'tag-', '' ),\n\t\t\t\t} );\n\t\t\tconst query = {\n\t\t\t\toffset: offset || 0,\n\t\t\t\torder,\n\t\t\t\torderby: orderBy,\n\t\t\t};\n\t\t\t// There is no need to build the taxQuery if we inherit.\n\t\t\tif ( taxQuery && ! inherit ) {\n\t\t\t\tconst taxonomies = getTaxonomies( {\n\t\t\t\t\ttype: postType,\n\t\t\t\t\tper_page: -1,\n\t\t\t\t\tcontext: 'view',\n\t\t\t\t} );\n\t\t\t\t// Build REST API parameters from taxonomy terms, e.g.\n\t\t\t\t// `category`, `tags_exclude`.\n\t\t\t\tconst buildTaxQuery = ( terms, suffix = '' ) => {\n\t\t\t\t\treturn Object.entries( terms || {} ).reduce(\n\t\t\t\t\t\t( accumulator, [ taxonomySlug, termIds ] ) => {\n\t\t\t\t\t\t\tconst taxonomy = taxonomies?.find(\n\t\t\t\t\t\t\t\t( { slug } ) => slug === taxonomySlug\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tif ( taxonomy?.rest_base && termIds?.length ) {\n\t\t\t\t\t\t\t\taccumulator[ taxonomy.rest_base + suffix ] =\n\t\t\t\t\t\t\t\t\ttermIds;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn accumulator;\n\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\t\t\t\tconst builtTaxQuery = buildTaxQuery( taxQuery.include );\n\t\t\t\tif ( taxQuery.exclude ) {\n\t\t\t\t\tObject.assign(\n\t\t\t\t\t\tbuiltTaxQuery,\n\t\t\t\t\t\tbuildTaxQuery( taxQuery.exclude, '_exclude' )\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tif ( !! Object.keys( builtTaxQuery ).length ) {\n\t\t\t\t\tObject.assign( query, builtTaxQuery );\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( perPage ) {\n\t\t\t\tquery.per_page = perPage;\n\t\t\t}\n\t\t\tif ( author ) {\n\t\t\t\tquery.author = author;\n\t\t\t}\n\t\t\tif ( search ) {\n\t\t\t\tquery.search = search;\n\t\t\t}\n\t\t\tif ( exclude?.length ) {\n\t\t\t\tquery.exclude = exclude;\n\t\t\t}\n\t\t\tif ( parents?.length ) {\n\t\t\t\tquery.parent = parents;\n\t\t\t}\n\t\t\tif ( format?.length ) {\n\t\t\t\tquery.format = format;\n\t\t\t}\n\t\t\tif ( excludeCurrent && postId ) {\n\t\t\t\tif ( query.exclude ) {\n\t\t\t\t\tquery.exclude = [ ...query.exclude, postId ];\n\t\t\t\t} else {\n\t\t\t\t\tquery.exclude = [ postId ];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * Handle cases where sticky is set to `exclude` or `only`.\n\t\t\t * Which works as a `post__in/post__not_in` query for sticky posts.\n\t\t\t */\n\t\t\tif ( [ 'exclude', 'only' ].includes( sticky ) ) {\n\t\t\t\tquery.sticky = sticky === 'only';\n\t\t\t}\n\n\t\t\t// Empty string represents the default behavior of including sticky posts.\n\t\t\tif ( [ '', 'ignore' ].includes( sticky ) ) {\n\t\t\t\t// Remove any leftover sticky query parameter.\n\t\t\t\tdelete query.sticky;\n\t\t\t\tquery.ignore_sticky = sticky === 'ignore';\n\t\t\t}\n\n\t\t\t// If `inherit` is truthy, adjust conditionally the query to create a better preview.\n\t\t\tlet currentPostType = postType;\n\t\t\tif ( inherit ) {\n\t\t\t\t// Change the post-type if needed.\n\t\t\t\tif ( templateSlug?.startsWith( 'archive-' ) ) {\n\t\t\t\t\tquery.postType = templateSlug.replace( 'archive-', '' );\n\t\t\t\t\tcurrentPostType = query.postType;\n\t\t\t\t} else if ( templateCategory ) {\n\t\t\t\t\tquery.categories = templateCategory[ 0 ]?.id;\n\t\t\t\t} else if ( templateTag ) {\n\t\t\t\t\tquery.tags = templateTag[ 0 ]?.id;\n\t\t\t\t} else if (\n\t\t\t\t\ttemplateSlug?.startsWith( 'taxonomy-post_format' )\n\t\t\t\t) {\n\t\t\t\t\t// Get the post format slug from the template slug by removing the prefix.\n\t\t\t\t\tquery.format = templateSlug.replace(\n\t\t\t\t\t\t'taxonomy-post_format-post-format-',\n\t\t\t\t\t\t''\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// When we preview Query Loop blocks we should prefer the current\n\t\t\t// block's postType, which is passed through block context.\n\t\t\tconst usedPostType = previewPostType || currentPostType;\n\t\t\treturn {\n\t\t\t\tposts: getEntityRecords( 'postType', usedPostType, {\n\t\t\t\t\t...query,\n\t\t\t\t\t...restQueryArgs,\n\t\t\t\t} ),\n\t\t\t\tblocks: getBlocks( clientId ),\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\tperPage,\n\t\t\toffset,\n\t\t\torder,\n\t\t\torderBy,\n\t\t\tclientId,\n\t\t\tauthor,\n\t\t\tsearch,\n\t\t\tpostType,\n\t\t\texclude,\n\t\t\tsticky,\n\t\t\tinherit,\n\t\t\ttemplateSlug,\n\t\t\ttaxQuery,\n\t\t\tparents,\n\t\t\tformat,\n\t\t\trestQueryArgs,\n\t\t\tpreviewPostType,\n\t\t]\n\t);\n\tconst blockContexts = useMemo(\n\t\t() =>\n\t\t\tposts?.map( ( post ) => ( {\n\t\t\t\tpostType: post.type,\n\t\t\t\tpostId: post.id,\n\t\t\t\tclassList: post.class_list ?? '',\n\t\t\t} ) ),\n\t\t[ posts ]\n\t);\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( __unstableLayoutClassNames, {\n\t\t\t[ `columns-${ columnCount }` ]:\n\t\t\t\tlayoutType === 'grid' && columnCount, // Ensure column count is flagged via classname for backwards compatibility.\n\t\t\t'has-native-responsive-grid':\n\t\t\t\tlayoutType === 'grid' && columnCount && minimumColumnWidth, // Flag native responsive grid when minimum column width is provided.\n\t\t} ),\n\t} );\n\n\tif ( ! posts ) {\n\t\treturn (\n\t\t\t<p { ...blockProps }>\n\t\t\t\t<Spinner />\n\t\t\t</p>\n\t\t);\n\t}\n\n\tif ( ! posts.length ) {\n\t\treturn <p { ...blockProps }> { __( 'No results found.' ) }</p>;\n\t}\n\n\tconst setDisplayLayout = ( newDisplayLayout ) =>\n\t\tsetAttributes( {\n\t\t\tlayout: { ...layout, ...newDisplayLayout },\n\t\t} );\n\n\tconst displayLayoutControls = [\n\t\t{\n\t\t\ticon: list,\n\t\t\ttitle: _x( 'List view', 'Post template block display setting' ),\n\t\t\tonClick: () => setDisplayLayout( { type: 'default' } ),\n\t\t\tisActive: layoutType === 'default' || layoutType === 'constrained',\n\t\t},\n\t\t{\n\t\t\ticon: grid,\n\t\t\ttitle: _x( 'Grid view', 'Post template block display setting' ),\n\t\t\tonClick: () =>\n\t\t\t\tsetDisplayLayout( {\n\t\t\t\t\ttype: 'grid',\n\t\t\t\t\tcolumnCount,\n\t\t\t\t} ),\n\t\t\tisActive: layoutType === 'grid',\n\t\t},\n\t];\n\n\t// To avoid flicker when switching active block contexts, a preview is rendered\n\t// for each block context, but the preview for the active block context is hidden.\n\t// This ensures that when it is displayed again, the cached rendering of the\n\t// block preview is used, instead of having to re-render the preview from scratch.\n\treturn (\n\t\t<>\n\t\t\t<BlockControls>\n\t\t\t\t<ToolbarGroup controls={ displayLayoutControls } />\n\t\t\t</BlockControls>\n\n\t\t\t<ul { ...blockProps }>\n\t\t\t\t{ blockContexts &&\n\t\t\t\t\tblockContexts.map( ( blockContext ) => (\n\t\t\t\t\t\t<BlockContextProvider\n\t\t\t\t\t\t\tkey={ blockContext.postId }\n\t\t\t\t\t\t\tvalue={ blockContext }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ blockContext.postId ===\n\t\t\t\t\t\t\t( activeBlockContextId ||\n\t\t\t\t\t\t\t\tblockContexts[ 0 ]?.postId ) ? (\n\t\t\t\t\t\t\t\t<PostTemplateInnerBlocks\n\t\t\t\t\t\t\t\t\tclassList={ blockContext.classList }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) : null }\n\t\t\t\t\t\t\t<MemoizedPostTemplateBlockPreview\n\t\t\t\t\t\t\t\tblocks={ blocks }\n\t\t\t\t\t\t\t\tblockContextId={ blockContext.postId }\n\t\t\t\t\t\t\t\tclassList={ blockContext.classList }\n\t\t\t\t\t\t\t\tsetActiveBlockContextId={\n\t\t\t\t\t\t\t\t\tsetActiveBlockContextId\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tisHidden={\n\t\t\t\t\t\t\t\t\tblockContext.postId ===\n\t\t\t\t\t\t\t\t\t( activeBlockContextId ||\n\t\t\t\t\t\t\t\t\t\tblockContexts[ 0 ]?.postId )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</BlockContextProvider>\n\t\t\t\t\t) ) }\n\t\t\t</ul>\n\t\t</>\n\t);\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": ["clsx", "useBlockPreview", "coreStore", "blockEditorStore"]
|
|
7
7
|
}
|
|
@@ -38,14 +38,11 @@ __export(preformatted_exports, {
|
|
|
38
38
|
module.exports = __toCommonJS(preformatted_exports);
|
|
39
39
|
var import_i18n = require("@wordpress/i18n");
|
|
40
40
|
var import_icons = require("@wordpress/icons");
|
|
41
|
-
var import_blocks = require("@wordpress/blocks");
|
|
42
41
|
var import_init_block = __toESM(require("../utils/init-block.cjs"));
|
|
43
42
|
var import_edit = __toESM(require("./edit.cjs"));
|
|
44
43
|
var import_block = __toESM(require("./block.json"));
|
|
45
44
|
var import_save = __toESM(require("./save.cjs"));
|
|
46
45
|
var import_transforms = __toESM(require("./transforms.cjs"));
|
|
47
|
-
var import_lock_unlock = require("../lock-unlock.cjs");
|
|
48
|
-
var { fieldsKey, formKey } = (0, import_lock_unlock.unlock)(import_blocks.privateApis);
|
|
49
46
|
var { name } = import_block.default;
|
|
50
47
|
var settings = {
|
|
51
48
|
icon: import_icons.preformatted,
|
|
@@ -68,20 +65,6 @@ var settings = {
|
|
|
68
65
|
};
|
|
69
66
|
}
|
|
70
67
|
};
|
|
71
|
-
if (window.__experimentalContentOnlyInspectorFields) {
|
|
72
|
-
settings[fieldsKey] = [
|
|
73
|
-
{
|
|
74
|
-
id: "content",
|
|
75
|
-
label: (0, import_i18n.__)("Content"),
|
|
76
|
-
type: "text",
|
|
77
|
-
Edit: "rich-text"
|
|
78
|
-
// TODO: replace with custom component
|
|
79
|
-
}
|
|
80
|
-
];
|
|
81
|
-
settings[formKey] = {
|
|
82
|
-
fields: ["content"]
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
68
|
var init = () => (0, import_init_block.default)({ name, metadata: import_block.default, settings });
|
|
86
69
|
// Annotate the CommonJS export names for ESM import in node:
|
|
87
70
|
0 && (module.exports = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/preformatted/index.js"],
|
|
4
|
-
"sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport { preformatted as icon } from '@wordpress/icons';\nimport
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,+BAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA,kBAAmB;AACnB,mBAAqC;AACrC,
|
|
6
|
-
"names": ["metadata", "
|
|
4
|
+
"sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport { preformatted as icon } from '@wordpress/icons';\nimport initBlock from '../utils/init-block';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\t/* eslint-disable @wordpress/i18n-no-collapsible-whitespace */\n\t\t\t// translators: Sample content for the Preformatted block. Can be replaced with a more locale-adequate work.\n\t\t\tcontent: __(\n\t\t\t\t'EXT. XANADU - FAINT DAWN - 1940 (MINIATURE)\\nWindow, very small in the distance, illuminated.\\nAll around this is an almost totally black screen. Now, as the camera moves slowly towards the window which is almost a postage stamp in the frame, other forms appear;'\n\t\t\t),\n\t\t\t/* eslint-enable @wordpress/i18n-no-collapsible-whitespace */\n\t\t},\n\t},\n\ttransforms,\n\tedit,\n\tsave,\n\tmerge( attributes, attributesToMerge ) {\n\t\treturn {\n\t\t\tcontent: attributes.content + '\\n\\n' + attributesToMerge.content,\n\t\t};\n\t},\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,+BAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA,kBAAmB;AACnB,mBAAqC;AACrC,wBAAsB;AACtB,kBAAiB;AACjB,mBAAqB;AACrB,kBAAiB;AACjB,wBAAuB;AAEvB,IAAM,EAAE,KAAK,IAAI,aAAAA;AAIV,IAAM,WAAW;AAAA,EACvB,mBAAAC;AAAA,EACA,SAAS;AAAA,IACR,YAAY;AAAA;AAAA;AAAA,MAGX,aAAS;AAAA,QACR;AAAA,MACD;AAAA;AAAA,IAED;AAAA,EACD;AAAA,EACA,8BAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,MAAO,YAAY,mBAAoB;AACtC,WAAO;AAAA,MACN,SAAS,WAAW,UAAU,SAAS,kBAAkB;AAAA,IAC1D;AAAA,EACD;AACD;AAEO,IAAM,OAAO,UAAM,kBAAAC,SAAW,EAAE,MAAM,uBAAAC,SAAU,SAAS,CAAE;",
|
|
6
|
+
"names": ["metadata", "icon", "transforms", "edit", "save", "initBlock", "metadata"]
|
|
7
7
|
}
|
|
@@ -38,15 +38,12 @@ __export(pullquote_exports, {
|
|
|
38
38
|
module.exports = __toCommonJS(pullquote_exports);
|
|
39
39
|
var import_i18n = require("@wordpress/i18n");
|
|
40
40
|
var import_icons = require("@wordpress/icons");
|
|
41
|
-
var import_blocks = require("@wordpress/blocks");
|
|
42
41
|
var import_init_block = __toESM(require("../utils/init-block.cjs"));
|
|
43
42
|
var import_deprecated = __toESM(require("./deprecated.cjs"));
|
|
44
43
|
var import_edit = __toESM(require("./edit.cjs"));
|
|
45
44
|
var import_block = __toESM(require("./block.json"));
|
|
46
45
|
var import_save = __toESM(require("./save.cjs"));
|
|
47
46
|
var import_transforms = __toESM(require("./transforms.cjs"));
|
|
48
|
-
var import_lock_unlock = require("../lock-unlock.cjs");
|
|
49
|
-
var { fieldsKey, formKey } = (0, import_lock_unlock.unlock)(import_blocks.privateApis);
|
|
50
47
|
var { name } = import_block.default;
|
|
51
48
|
var settings = {
|
|
52
49
|
icon: import_icons.pullquote,
|
|
@@ -66,27 +63,6 @@ var settings = {
|
|
|
66
63
|
save: import_save.default,
|
|
67
64
|
deprecated: import_deprecated.default
|
|
68
65
|
};
|
|
69
|
-
if (window.__experimentalContentOnlyInspectorFields) {
|
|
70
|
-
settings[fieldsKey] = [
|
|
71
|
-
{
|
|
72
|
-
id: "value",
|
|
73
|
-
label: (0, import_i18n.__)("Content"),
|
|
74
|
-
type: "text",
|
|
75
|
-
Edit: "rich-text"
|
|
76
|
-
// TODO: replace with custom component
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
id: "citation",
|
|
80
|
-
label: (0, import_i18n.__)("Citation"),
|
|
81
|
-
type: "text",
|
|
82
|
-
Edit: "rich-text"
|
|
83
|
-
// TODO: replace with custom component
|
|
84
|
-
}
|
|
85
|
-
];
|
|
86
|
-
settings[formKey] = {
|
|
87
|
-
fields: ["value", "citation"]
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
66
|
var init = () => (0, import_init_block.default)({ name, metadata: import_block.default, settings });
|
|
91
67
|
// Annotate the CommonJS export names for ESM import in node:
|
|
92
68
|
0 && (module.exports = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/pullquote/index.js"],
|
|
4
|
-
"sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport { pullquote as icon } from '@wordpress/icons';\nimport
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,+BAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA,kBAAmB;AACnB,mBAAkC;AAClC,
|
|
6
|
-
"names": ["metadata", "
|
|
4
|
+
"sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport { pullquote as icon } from '@wordpress/icons';\nimport initBlock from '../utils/init-block';\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tvalue:\n\t\t\t\t// translators: Quote serving as example for the Pullquote block. Attributed to Matt Mullenweg.\n\t\t\t\t__(\n\t\t\t\t\t'One of the hardest things to do in technology is disrupt yourself.'\n\t\t\t\t),\n\t\t\tcitation: __( 'Matt Mullenweg' ),\n\t\t},\n\t},\n\ttransforms,\n\tedit,\n\tsave,\n\tdeprecated,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,+BAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA,kBAAmB;AACnB,mBAAkC;AAClC,wBAAsB;AACtB,wBAAuB;AACvB,kBAAiB;AACjB,mBAAqB;AACrB,kBAAiB;AACjB,wBAAuB;AAEvB,IAAM,EAAE,KAAK,IAAI,aAAAA;AAIV,IAAM,WAAW;AAAA,EACvB,mBAAAC;AAAA,EACA,SAAS;AAAA,IACR,YAAY;AAAA,MACX;AAAA;AAAA,YAEC;AAAA,UACC;AAAA,QACD;AAAA;AAAA,MACD,cAAU,gBAAI,gBAAiB;AAAA,IAChC;AAAA,EACD;AAAA,EACA,8BAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,8BAAAC;AACD;AAEO,IAAM,OAAO,UAAM,kBAAAC,SAAW,EAAE,MAAM,uBAAAC,SAAU,SAAS,CAAE;",
|
|
6
|
+
"names": ["metadata", "icon", "transforms", "edit", "save", "deprecated", "initBlock", "metadata"]
|
|
7
7
|
}
|