@wordpress/block-library 9.48.1 → 10.0.1-next.v.202606191442.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 +11 -0
- package/build/breadcrumbs/edit.cjs +1 -1
- package/build/breadcrumbs/edit.cjs.map +1 -1
- package/build/button/edit.cjs +1 -1
- package/build/button/edit.cjs.map +2 -2
- package/build/categories/edit.cjs +1 -1
- package/build/categories/edit.cjs.map +1 -1
- package/build/code/edit.cjs +1 -1
- package/build/code/edit.cjs.map +2 -2
- package/build/code/index.cjs +1 -1
- package/build/code/index.cjs.map +1 -1
- package/build/columns/utils.cjs.map +1 -1
- package/build/comments/edit/comments-legacy.cjs +1 -1
- package/build/comments/edit/comments-legacy.cjs.map +1 -1
- package/build/comments/edit/placeholder.cjs +4 -4
- package/build/comments/edit/placeholder.cjs.map +1 -1
- package/build/comments-pagination-next/edit.cjs +2 -2
- package/build/comments-pagination-next/edit.cjs.map +1 -1
- package/build/comments-pagination-previous/edit.cjs +2 -2
- package/build/comments-pagination-previous/edit.cjs.map +1 -1
- package/build/cover/deprecated.cjs +3 -3
- package/build/cover/deprecated.cjs.map +2 -2
- package/build/cover/edit/block-controls.cjs +13 -0
- package/build/cover/edit/block-controls.cjs.map +2 -2
- package/build/cover/edit/index.cjs +61 -2
- package/build/cover/edit/index.cjs.map +3 -3
- package/build/cover/edit/inspector-controls.cjs +93 -35
- package/build/cover/edit/inspector-controls.cjs.map +2 -2
- package/build/details/edit.cjs +1 -1
- package/build/details/edit.cjs.map +2 -2
- package/build/embed/embed-placeholder.cjs +1 -1
- package/build/embed/embed-placeholder.cjs.map +2 -2
- package/build/file/edit.cjs +3 -11
- package/build/file/edit.cjs.map +2 -2
- package/build/file/index.cjs +3 -1
- package/build/file/index.cjs.map +3 -3
- package/build/file/transforms.cjs +11 -32
- package/build/file/transforms.cjs.map +2 -2
- package/build/file/variations.cjs +38 -0
- package/build/file/variations.cjs.map +7 -0
- package/build/footnotes/edit.cjs +1 -1
- package/build/footnotes/edit.cjs.map +2 -2
- package/build/form-input/edit.cjs +1 -1
- package/build/form-input/edit.cjs.map +2 -2
- package/build/freeform/edit.cjs +1 -1
- package/build/freeform/edit.cjs.map +1 -1
- package/build/gallery/edit.cjs +2 -2
- package/build/gallery/edit.cjs.map +2 -2
- package/build/home-link/edit.cjs +1 -1
- package/build/home-link/edit.cjs.map +2 -2
- package/build/html/index.cjs +1 -1
- package/build/html/index.cjs.map +2 -2
- package/build/html/modal.cjs +3 -3
- package/build/html/modal.cjs.map +2 -2
- package/build/icon/block.json +12 -0
- package/build/icon/edit.cjs +90 -39
- package/build/icon/edit.cjs.map +3 -3
- package/build/icon/index.cjs +3 -1
- package/build/icon/index.cjs.map +3 -3
- package/build/{tab/save.cjs → icon/variations.cjs} +14 -15
- package/build/icon/variations.cjs.map +7 -0
- package/build/image/block.json +1 -0
- package/build/image/edit.cjs +4 -3
- package/build/image/edit.cjs.map +2 -2
- package/build/image/image.cjs +91 -27
- package/build/image/image.cjs.map +2 -2
- package/build/image/index.cjs +1 -1
- package/build/image/index.cjs.map +2 -2
- package/build/image/transforms.cjs +9 -3
- package/build/image/transforms.cjs.map +2 -2
- package/build/index.cjs +1 -3
- package/build/index.cjs.map +2 -2
- package/build/latest-posts/edit.cjs +1 -1
- package/build/latest-posts/edit.cjs.map +1 -1
- package/build/math/edit.cjs +1 -1
- package/build/math/index.cjs +1 -1
- package/build/math/index.cjs.map +1 -1
- package/build/media-text/constants.cjs +1 -1
- package/build/media-text/constants.cjs.map +2 -2
- package/build/media-text/index.cjs +1 -1
- package/build/media-text/index.cjs.map +2 -2
- package/build/missing/edit.cjs +2 -2
- package/build/missing/edit.cjs.map +1 -1
- package/build/navigation/edit/index.cjs +14 -8
- package/build/navigation/edit/index.cjs.map +2 -2
- package/build/navigation/edit/navigation-menu-selector.cjs +1 -1
- package/build/navigation/edit/navigation-menu-selector.cjs.map +2 -2
- package/build/navigation/edit/placeholder/index.cjs +1 -1
- package/build/navigation/edit/placeholder/index.cjs.map +2 -2
- package/build/navigation-link/edit.cjs +1 -1
- package/build/navigation-link/edit.cjs.map +2 -2
- package/build/navigation-submenu/block.json +7 -0
- package/build/navigation-submenu/edit.cjs +1 -1
- package/build/navigation-submenu/edit.cjs.map +2 -2
- package/build/page-list/block.json +2 -5
- package/build/page-list/edit.cjs +1 -11
- package/build/page-list/edit.cjs.map +2 -2
- package/build/post-author/edit.cjs +1 -1
- package/build/post-author/edit.cjs.map +2 -2
- package/build/post-author/utils.cjs +1 -1
- package/build/post-author/utils.cjs.map +2 -2
- package/build/post-date/edit.cjs +2 -2
- package/build/post-date/edit.cjs.map +2 -2
- package/build/post-excerpt/edit.cjs +2 -2
- package/build/post-excerpt/edit.cjs.map +2 -2
- package/build/post-featured-image/block.json +1 -0
- package/build/post-featured-image/dimension-controls.cjs +90 -178
- package/build/post-featured-image/dimension-controls.cjs.map +3 -3
- package/build/post-featured-image/edit.cjs +47 -17
- package/build/post-featured-image/edit.cjs.map +2 -2
- package/build/post-navigation-link/edit.cjs +2 -2
- package/build/post-navigation-link/edit.cjs.map +2 -2
- package/build/post-time-to-read/edit.cjs +1 -1
- package/build/post-time-to-read/edit.cjs.map +1 -1
- package/build/preformatted/edit.cjs +1 -1
- package/build/preformatted/edit.cjs.map +2 -2
- package/build/pullquote/block.json +1 -3
- package/build/pullquote/deprecated.cjs +114 -9
- package/build/pullquote/deprecated.cjs.map +3 -3
- package/build/pullquote/edit.cjs +43 -61
- package/build/pullquote/edit.cjs.map +3 -3
- package/build/pullquote/save.cjs +5 -26
- package/build/pullquote/save.cjs.map +3 -3
- package/build/query/edit/inspector-controls/enhanced-pagination-control.cjs +1 -1
- package/build/query/edit/inspector-controls/enhanced-pagination-control.cjs.map +1 -1
- package/build/query/edit/inspector-controls/order-control.cjs +2 -2
- package/build/query/edit/inspector-controls/order-control.cjs.map +2 -2
- package/build/query/utils.cjs +2 -2
- package/build/query/utils.cjs.map +2 -2
- package/build/query-pagination-next/edit.cjs +2 -2
- package/build/query-pagination-next/edit.cjs.map +1 -1
- package/build/query-pagination-previous/edit.cjs +2 -2
- package/build/query-pagination-previous/edit.cjs.map +1 -1
- package/build/query-title/edit.cjs +1 -1
- package/build/query-title/edit.cjs.map +2 -2
- package/build/query-total/edit.cjs +1 -1
- package/build/query-total/edit.cjs.map +2 -2
- package/build/quote/index.cjs +1 -1
- package/build/quote/index.cjs.map +2 -2
- package/build/read-more/edit.cjs +1 -1
- package/build/read-more/edit.cjs.map +2 -2
- package/build/rss/edit.cjs +1 -1
- package/build/rss/edit.cjs.map +2 -2
- package/build/search/edit.cjs +3 -3
- package/build/search/edit.cjs.map +2 -2
- package/build/shortcode/edit.cjs +1 -1
- package/build/shortcode/edit.cjs.map +2 -2
- package/build/site-tagline/edit.cjs +1 -1
- package/build/site-tagline/edit.cjs.map +2 -2
- package/build/site-title/edit.cjs +1 -1
- package/build/site-title/edit.cjs.map +2 -2
- package/build/tab-list/block.json +34 -21
- package/build/tab-list/edit.cjs +116 -12
- package/build/tab-list/edit.cjs.map +3 -3
- package/build/tab-list/save.cjs +33 -3
- package/build/tab-list/save.cjs.map +3 -3
- package/build/tab-panel/add-tab-toolbar-control.cjs +19 -8
- package/build/tab-panel/add-tab-toolbar-control.cjs.map +2 -2
- package/build/tab-panel/block.json +2 -6
- package/build/tab-panel/remove-tab-toolbar-control.cjs +9 -14
- package/build/tab-panel/remove-tab-toolbar-control.cjs.map +2 -2
- package/build/tab-panels/block.json +2 -27
- package/build/table/index.cjs +1 -1
- package/build/table/index.cjs.map +2 -2
- package/build/tabs/block.json +3 -17
- package/build/tabs/edit.cjs +7 -21
- package/build/tabs/edit.cjs.map +3 -3
- package/build/tabs/index.cjs +6 -10
- package/build/tabs/index.cjs.map +2 -2
- package/build/tabs/use-tab-list-items-sync.cjs +53 -0
- package/build/tabs/use-tab-list-items-sync.cjs.map +7 -0
- package/build/tabs/view.cjs +2 -10
- package/build/tabs/view.cjs.map +2 -2
- package/build/terms-query/edit/inspector-controls/order-control.cjs +2 -2
- package/build/terms-query/edit/inspector-controls/order-control.cjs.map +2 -2
- package/build/utils/style-state.cjs +164 -0
- package/build/utils/style-state.cjs.map +7 -0
- package/build/utils/waveform-player.cjs +1 -1
- package/build/verse/edit.cjs +1 -1
- package/build/verse/edit.cjs.map +2 -2
- package/build-module/breadcrumbs/edit.mjs +1 -1
- package/build-module/breadcrumbs/edit.mjs.map +1 -1
- package/build-module/button/edit.mjs +1 -1
- package/build-module/button/edit.mjs.map +2 -2
- package/build-module/categories/edit.mjs +1 -1
- package/build-module/categories/edit.mjs.map +1 -1
- package/build-module/code/edit.mjs +1 -1
- package/build-module/code/edit.mjs.map +2 -2
- package/build-module/code/index.mjs +1 -1
- package/build-module/code/index.mjs.map +1 -1
- package/build-module/columns/utils.mjs.map +1 -1
- package/build-module/comments/edit/comments-legacy.mjs +1 -1
- package/build-module/comments/edit/comments-legacy.mjs.map +1 -1
- package/build-module/comments/edit/placeholder.mjs +4 -4
- package/build-module/comments/edit/placeholder.mjs.map +1 -1
- package/build-module/comments-pagination-next/edit.mjs +2 -2
- package/build-module/comments-pagination-next/edit.mjs.map +1 -1
- package/build-module/comments-pagination-previous/edit.mjs +2 -2
- package/build-module/comments-pagination-previous/edit.mjs.map +1 -1
- package/build-module/cover/deprecated.mjs +3 -3
- package/build-module/cover/deprecated.mjs.map +2 -2
- package/build-module/cover/edit/block-controls.mjs +15 -2
- package/build-module/cover/edit/block-controls.mjs.map +2 -2
- package/build-module/cover/edit/index.mjs +64 -3
- package/build-module/cover/edit/index.mjs.map +2 -2
- package/build-module/cover/edit/inspector-controls.mjs +98 -35
- package/build-module/cover/edit/inspector-controls.mjs.map +2 -2
- package/build-module/details/edit.mjs +1 -1
- package/build-module/details/edit.mjs.map +2 -2
- package/build-module/embed/embed-placeholder.mjs +1 -1
- package/build-module/embed/embed-placeholder.mjs.map +2 -2
- package/build-module/file/edit.mjs +5 -13
- package/build-module/file/edit.mjs.map +2 -2
- package/build-module/file/index.mjs +3 -1
- package/build-module/file/index.mjs.map +2 -2
- package/build-module/file/transforms.mjs +11 -32
- package/build-module/file/transforms.mjs.map +2 -2
- package/build-module/file/variations.mjs +17 -0
- package/build-module/file/variations.mjs.map +7 -0
- package/build-module/footnotes/edit.mjs +1 -1
- package/build-module/footnotes/edit.mjs.map +2 -2
- package/build-module/form-input/edit.mjs +1 -1
- package/build-module/form-input/edit.mjs.map +2 -2
- package/build-module/freeform/edit.mjs +1 -1
- package/build-module/freeform/edit.mjs.map +1 -1
- package/build-module/gallery/edit.mjs +2 -2
- package/build-module/gallery/edit.mjs.map +2 -2
- package/build-module/home-link/edit.mjs +1 -1
- package/build-module/home-link/edit.mjs.map +2 -2
- package/build-module/html/index.mjs +1 -1
- package/build-module/html/index.mjs.map +2 -2
- package/build-module/html/modal.mjs +3 -3
- package/build-module/html/modal.mjs.map +2 -2
- package/build-module/icon/block.json +12 -0
- package/build-module/icon/edit.mjs +94 -40
- package/build-module/icon/edit.mjs.map +2 -2
- package/build-module/icon/index.mjs +3 -1
- package/build-module/icon/index.mjs.map +2 -2
- package/build-module/icon/variations.mjs +13 -0
- package/build-module/icon/variations.mjs.map +7 -0
- package/build-module/image/block.json +1 -0
- package/build-module/image/edit.mjs +4 -3
- package/build-module/image/edit.mjs.map +2 -2
- package/build-module/image/image.mjs +96 -27
- package/build-module/image/image.mjs.map +2 -2
- package/build-module/image/index.mjs +1 -1
- package/build-module/image/index.mjs.map +2 -2
- package/build-module/image/transforms.mjs +9 -3
- package/build-module/image/transforms.mjs.map +2 -2
- package/build-module/index.mjs +1 -3
- package/build-module/index.mjs.map +2 -2
- package/build-module/latest-posts/edit.mjs +1 -1
- package/build-module/latest-posts/edit.mjs.map +1 -1
- package/build-module/math/edit.mjs +1 -1
- package/build-module/math/index.mjs +1 -1
- package/build-module/math/index.mjs.map +1 -1
- package/build-module/media-text/constants.mjs +1 -1
- package/build-module/media-text/constants.mjs.map +2 -2
- package/build-module/media-text/index.mjs +1 -1
- package/build-module/media-text/index.mjs.map +2 -2
- package/build-module/missing/edit.mjs +2 -2
- package/build-module/missing/edit.mjs.map +1 -1
- package/build-module/navigation/edit/index.mjs +14 -8
- package/build-module/navigation/edit/index.mjs.map +2 -2
- package/build-module/navigation/edit/navigation-menu-selector.mjs +1 -1
- package/build-module/navigation/edit/navigation-menu-selector.mjs.map +2 -2
- package/build-module/navigation/edit/placeholder/index.mjs +1 -1
- package/build-module/navigation/edit/placeholder/index.mjs.map +2 -2
- package/build-module/navigation-link/edit.mjs +1 -1
- package/build-module/navigation-link/edit.mjs.map +2 -2
- package/build-module/navigation-submenu/block.json +7 -0
- package/build-module/navigation-submenu/edit.mjs +1 -1
- package/build-module/navigation-submenu/edit.mjs.map +2 -2
- package/build-module/page-list/block.json +2 -5
- package/build-module/page-list/edit.mjs +1 -11
- package/build-module/page-list/edit.mjs.map +2 -2
- package/build-module/post-author/edit.mjs +1 -1
- package/build-module/post-author/edit.mjs.map +2 -2
- package/build-module/post-author/utils.mjs +1 -1
- package/build-module/post-author/utils.mjs.map +2 -2
- package/build-module/post-date/edit.mjs +2 -2
- package/build-module/post-date/edit.mjs.map +2 -2
- package/build-module/post-excerpt/edit.mjs +2 -2
- package/build-module/post-excerpt/edit.mjs.map +2 -2
- package/build-module/post-featured-image/block.json +1 -0
- package/build-module/post-featured-image/dimension-controls.mjs +99 -187
- package/build-module/post-featured-image/dimension-controls.mjs.map +2 -2
- package/build-module/post-featured-image/edit.mjs +47 -17
- package/build-module/post-featured-image/edit.mjs.map +2 -2
- package/build-module/post-navigation-link/edit.mjs +2 -2
- package/build-module/post-navigation-link/edit.mjs.map +2 -2
- package/build-module/post-time-to-read/edit.mjs +1 -1
- package/build-module/post-time-to-read/edit.mjs.map +1 -1
- package/build-module/preformatted/edit.mjs +1 -1
- package/build-module/preformatted/edit.mjs.map +2 -2
- package/build-module/pullquote/block.json +1 -3
- package/build-module/pullquote/deprecated.mjs +114 -9
- package/build-module/pullquote/deprecated.mjs.map +2 -2
- package/build-module/pullquote/edit.mjs +44 -67
- package/build-module/pullquote/edit.mjs.map +2 -2
- package/build-module/pullquote/save.mjs +5 -16
- package/build-module/pullquote/save.mjs.map +2 -2
- package/build-module/query/edit/inspector-controls/enhanced-pagination-control.mjs +1 -1
- package/build-module/query/edit/inspector-controls/enhanced-pagination-control.mjs.map +1 -1
- package/build-module/query/edit/inspector-controls/order-control.mjs +2 -2
- package/build-module/query/edit/inspector-controls/order-control.mjs.map +2 -2
- package/build-module/query/utils.mjs +2 -2
- package/build-module/query/utils.mjs.map +2 -2
- package/build-module/query-pagination-next/edit.mjs +2 -2
- package/build-module/query-pagination-next/edit.mjs.map +1 -1
- package/build-module/query-pagination-previous/edit.mjs +2 -2
- package/build-module/query-pagination-previous/edit.mjs.map +1 -1
- package/build-module/query-title/edit.mjs +1 -1
- package/build-module/query-title/edit.mjs.map +2 -2
- package/build-module/query-total/edit.mjs +1 -1
- package/build-module/query-total/edit.mjs.map +2 -2
- package/build-module/quote/index.mjs +1 -1
- package/build-module/quote/index.mjs.map +2 -2
- package/build-module/read-more/edit.mjs +1 -1
- package/build-module/read-more/edit.mjs.map +2 -2
- package/build-module/rss/edit.mjs +1 -1
- package/build-module/rss/edit.mjs.map +2 -2
- package/build-module/search/edit.mjs +3 -3
- package/build-module/search/edit.mjs.map +2 -2
- package/build-module/shortcode/edit.mjs +1 -1
- package/build-module/shortcode/edit.mjs.map +2 -2
- package/build-module/site-tagline/edit.mjs +1 -1
- package/build-module/site-tagline/edit.mjs.map +2 -2
- package/build-module/site-title/edit.mjs +1 -1
- package/build-module/site-title/edit.mjs.map +2 -2
- package/build-module/tab-list/block.json +34 -21
- package/build-module/tab-list/edit.mjs +122 -15
- package/build-module/tab-list/edit.mjs.map +2 -2
- package/build-module/tab-list/save.mjs +29 -4
- package/build-module/tab-list/save.mjs.map +2 -2
- package/build-module/tab-panel/add-tab-toolbar-control.mjs +19 -8
- package/build-module/tab-panel/add-tab-toolbar-control.mjs.map +2 -2
- package/build-module/tab-panel/block.json +2 -6
- package/build-module/tab-panel/remove-tab-toolbar-control.mjs +9 -14
- package/build-module/tab-panel/remove-tab-toolbar-control.mjs.map +2 -2
- package/build-module/tab-panels/block.json +2 -27
- package/build-module/table/index.mjs +1 -1
- package/build-module/table/index.mjs.map +2 -2
- package/build-module/tabs/block.json +3 -17
- package/build-module/tabs/edit.mjs +7 -21
- package/build-module/tabs/edit.mjs.map +2 -2
- package/build-module/tabs/index.mjs +6 -10
- package/build-module/tabs/index.mjs.map +2 -2
- package/build-module/tabs/use-tab-list-items-sync.mjs +32 -0
- package/build-module/tabs/use-tab-list-items-sync.mjs.map +7 -0
- package/build-module/tabs/view.mjs +2 -10
- package/build-module/tabs/view.mjs.map +2 -2
- package/build-module/terms-query/edit/inspector-controls/order-control.mjs +2 -2
- package/build-module/terms-query/edit/inspector-controls/order-control.mjs.map +2 -2
- package/build-module/utils/style-state.mjs +132 -0
- package/build-module/utils/style-state.mjs.map +7 -0
- package/build-module/utils/waveform-player.mjs +1 -1
- package/build-module/verse/edit.mjs +1 -1
- package/build-module/verse/edit.mjs.map +2 -2
- package/build-style/editor-rtl.css +12 -16
- package/build-style/editor.css +12 -16
- package/build-style/icon/style-rtl.css +9 -0
- package/build-style/icon/style.css +9 -0
- package/build-style/style-rtl.css +11 -24
- package/build-style/style.css +11 -24
- package/build-style/tab-list/editor-rtl.css +12 -4
- package/build-style/tab-list/editor.css +12 -4
- package/build-style/{tab → tab-list}/style-rtl.css +2 -2
- package/build-style/{tab → tab-list}/style.css +2 -2
- package/build-style/tab-panel/style-rtl.css +0 -17
- package/build-style/tab-panel/style.css +0 -17
- package/package.json +48 -45
- package/src/avatar/index.php +2 -2
- package/src/block/index.php +2 -26
- package/src/comment-author-avatar/index.php +3 -3
- package/src/comment-author-name/index.php +1 -1
- package/src/comment-date/index.php +1 -1
- package/src/cover/edit/block-controls.js +14 -2
- package/src/cover/edit/index.js +86 -0
- package/src/cover/edit/inspector-controls.js +124 -54
- package/src/editor.scss +0 -1
- package/src/file/edit.js +3 -16
- package/src/file/index.js +2 -0
- package/src/file/transforms.js +12 -31
- package/src/file/variations.js +17 -0
- package/src/gallery/edit.js +13 -13
- package/src/icon/README.md +3 -0
- package/src/icon/block.json +12 -0
- package/src/icon/edit.js +86 -36
- package/src/icon/index.js +3 -1
- package/src/icon/index.php +23 -0
- package/src/icon/style.scss +12 -0
- package/src/icon/variations.js +9 -0
- package/src/image/README.md +1 -0
- package/src/image/block.json +1 -0
- package/src/image/edit.js +8 -3
- package/src/image/image.js +120 -54
- package/src/image/index.php +0 -1
- package/src/image/transforms.js +34 -8
- package/src/index.js +4 -11
- package/src/navigation/edit/index.js +23 -10
- package/src/navigation/index.php +58 -0
- package/src/navigation-submenu/README.md +5 -0
- package/src/navigation-submenu/block.json +7 -0
- package/src/page-list/README.md +1 -1
- package/src/page-list/block.json +2 -5
- package/src/page-list/edit.js +0 -11
- package/src/page-list/index.php +1 -1
- package/src/post-date/edit.js +2 -2
- package/src/post-featured-image/README.md +1 -0
- package/src/post-featured-image/block.json +1 -0
- package/src/post-featured-image/dimension-controls.js +105 -184
- package/src/post-featured-image/edit.js +53 -21
- package/src/post-featured-image/index.php +24 -22
- package/src/pullquote/README.md +1 -1
- package/src/pullquote/block.json +1 -3
- package/src/pullquote/deprecated.js +121 -9
- package/src/pullquote/edit.js +7 -31
- package/src/pullquote/save.js +2 -13
- package/src/search/index.php +1 -1
- package/src/style.scss +1 -2
- package/src/tab-list/README.md +19 -17
- package/src/tab-list/block.json +34 -21
- package/src/tab-list/edit.js +147 -15
- package/src/tab-list/editor.scss +13 -6
- package/src/tab-list/index.php +23 -30
- package/src/tab-list/save.js +39 -4
- package/src/{tab → tab-list}/style.scss +1 -1
- package/src/tab-panel/README.md +0 -3
- package/src/tab-panel/add-tab-toolbar-control.js +24 -11
- package/src/tab-panel/block.json +2 -6
- package/src/tab-panel/remove-tab-toolbar-control.js +10 -14
- package/src/tab-panel/style.scss +0 -17
- package/src/tab-panels/README.md +0 -16
- package/src/tab-panels/block.json +2 -27
- package/src/tabs/README.md +1 -7
- package/src/tabs/block.json +3 -17
- package/src/tabs/edit.js +8 -19
- package/src/tabs/index.js +6 -10
- package/src/tabs/index.php +0 -13
- package/src/tabs/use-tab-list-items-sync.js +49 -0
- package/src/tabs/view.js +2 -10
- package/src/utils/style-state.js +151 -0
- package/src/utils/test/style-state.js +307 -0
- package/babel-plugin.cjs +0 -150
- package/build/tab/block.json +0 -56
- package/build/tab/controls.cjs +0 -46
- package/build/tab/controls.cjs.map +0 -7
- package/build/tab/edit.cjs +0 -135
- package/build/tab/edit.cjs.map +0 -7
- package/build/tab/index.cjs +0 -58
- package/build/tab/index.cjs.map +0 -7
- package/build/tab/save.cjs.map +0 -7
- package/build/tabs/use-tab-list-sync.cjs +0 -190
- package/build/tabs/use-tab-list-sync.cjs.map +0 -7
- package/build-module/tab/block.json +0 -56
- package/build-module/tab/controls.mjs +0 -15
- package/build-module/tab/controls.mjs.map +0 -7
- package/build-module/tab/edit.mjs +0 -108
- package/build-module/tab/edit.mjs.map +0 -7
- package/build-module/tab/index.mjs +0 -20
- package/build-module/tab/index.mjs.map +0 -7
- package/build-module/tab/save.mjs +0 -14
- package/build-module/tab/save.mjs.map +0 -7
- package/build-module/tabs/use-tab-list-sync.mjs +0 -169
- package/build-module/tabs/use-tab-list-sync.mjs.map +0 -7
- package/build-style/tab/editor-rtl.css +0 -11
- package/build-style/tab/editor.css +0 -11
- package/build-style/tab-panels/style-rtl.css +0 -4
- package/build-style/tab-panels/style.css +0 -4
- package/src/tab/README.md +0 -69
- package/src/tab/block.json +0 -56
- package/src/tab/controls.js +0 -19
- package/src/tab/edit.js +0 -141
- package/src/tab/editor.scss +0 -14
- package/src/tab/index.js +0 -24
- package/src/tab/index.php +0 -70
- package/src/tab/save.js +0 -13
- package/src/tab-panels/style.scss +0 -4
- package/src/tabs/use-tab-list-sync.js +0 -237
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/pullquote/edit.js"],
|
|
4
|
-
"sourcesContent": ["/**\n *
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,
|
|
6
|
-
"names": ["
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { RichText, useBlockProps } from '@wordpress/block-editor';\nimport { createBlock, getDefaultBlockName } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { Figure } from './figure';\nimport { BlockQuote } from './blockquote';\nimport useDeprecatedTextAlign from '../utils/deprecated-text-align-attributes';\n\nfunction PullQuoteEdit( props ) {\n\tconst { attributes, setAttributes, isSelected, insertBlocksAfter } = props;\n\tuseDeprecatedTextAlign( props );\n\tconst { citation, value } = attributes;\n\tconst blockProps = useBlockProps();\n\tconst shouldShowCitation = ! RichText.isEmpty( citation ) || isSelected;\n\n\treturn (\n\t\t<>\n\t\t\t<Figure { ...blockProps }>\n\t\t\t\t<BlockQuote>\n\t\t\t\t\t<RichText\n\t\t\t\t\t\tidentifier=\"value\"\n\t\t\t\t\t\ttagName=\"p\"\n\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\tonChange={ ( nextValue ) =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tvalue: nextValue,\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t\taria-label={ __( 'Pullquote text' ) }\n\t\t\t\t\t\tplaceholder={\n\t\t\t\t\t\t\t// translators: placeholder text used for the quote\n\t\t\t\t\t\t\t__( 'Add quote' )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t{ shouldShowCitation && (\n\t\t\t\t\t\t<RichText\n\t\t\t\t\t\t\tidentifier=\"citation\"\n\t\t\t\t\t\t\ttagName=\"cite\"\n\t\t\t\t\t\t\tstyle={ { display: 'block' } }\n\t\t\t\t\t\t\tvalue={ citation }\n\t\t\t\t\t\t\taria-label={ __( 'Pullquote citation text' ) }\n\t\t\t\t\t\t\tplaceholder={\n\t\t\t\t\t\t\t\t// translators: placeholder text used for the citation\n\t\t\t\t\t\t\t\t__( 'Add citation' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonChange={ ( nextCitation ) =>\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tcitation: nextCitation,\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tclassName=\"wp-block-pullquote__citation\"\n\t\t\t\t\t\t\t__unstableOnSplitAtEnd={ () =>\n\t\t\t\t\t\t\t\tinsertBlocksAfter(\n\t\t\t\t\t\t\t\t\tcreateBlock( getDefaultBlockName() )\n\t\t\t\t\t\t\t\t)\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</BlockQuote>\n\t\t\t</Figure>\n\t\t</>\n\t);\n}\n\nexport default PullQuoteEdit;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AACnB,0BAAwC;AACxC,oBAAiD;AAKjD,oBAAuB;AACvB,wBAA2B;AAC3B,8CAAmC;AAUjC;AARF,SAAS,cAAe,OAAQ;AAC/B,QAAM,EAAE,YAAY,eAAe,YAAY,kBAAkB,IAAI;AACrE,8CAAAA,SAAwB,KAAM;AAC9B,QAAM,EAAE,UAAU,MAAM,IAAI;AAC5B,QAAM,iBAAa,mCAAc;AACjC,QAAM,qBAAqB,CAAE,6BAAS,QAAS,QAAS,KAAK;AAE7D,SACC,2EACC,sDAAC,wBAAS,GAAG,YACZ,uDAAC,gCACA;AAAA;AAAA,MAAC;AAAA;AAAA,QACA,YAAW;AAAA,QACX,SAAQ;AAAA,QACR;AAAA,QACA,UAAW,CAAE,cACZ,cAAe;AAAA,UACd,OAAO;AAAA,QACR,CAAE;AAAA,QAEH,kBAAa,gBAAI,gBAAiB;AAAA,QAClC;AAAA;AAAA,cAEC,gBAAI,WAAY;AAAA;AAAA;AAAA,IAElB;AAAA,IACE,sBACD;AAAA,MAAC;AAAA;AAAA,QACA,YAAW;AAAA,QACX,SAAQ;AAAA,QACR,OAAQ,EAAE,SAAS,QAAQ;AAAA,QAC3B,OAAQ;AAAA,QACR,kBAAa,gBAAI,yBAA0B;AAAA,QAC3C;AAAA;AAAA,cAEC,gBAAI,cAAe;AAAA;AAAA,QAEpB,UAAW,CAAE,iBACZ,cAAe;AAAA,UACd,UAAU;AAAA,QACX,CAAE;AAAA,QAEH,WAAU;AAAA,QACV,wBAAyB,MACxB;AAAA,cACC,+BAAa,mCAAoB,CAAE;AAAA,QACpC;AAAA;AAAA,IAEF;AAAA,KAEF,GACD,GACD;AAEF;AAEA,IAAO,eAAQ;",
|
|
6
|
+
"names": ["useDeprecatedTextAlign"]
|
|
7
7
|
}
|
package/build/pullquote/save.cjs
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
@@ -17,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
|
|
30
20
|
// packages/block-library/src/pullquote/save.js
|
|
@@ -33,25 +23,14 @@ __export(save_exports, {
|
|
|
33
23
|
default: () => save
|
|
34
24
|
});
|
|
35
25
|
module.exports = __toCommonJS(save_exports);
|
|
36
|
-
var import_clsx = __toESM(require("clsx"));
|
|
37
26
|
var import_block_editor = require("@wordpress/block-editor");
|
|
38
27
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
39
28
|
function save({ attributes }) {
|
|
40
|
-
const {
|
|
29
|
+
const { citation, value } = attributes;
|
|
41
30
|
const shouldShowCitation = !import_block_editor.RichText.isEmpty(citation);
|
|
42
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
43
|
-
"
|
|
44
|
-
{
|
|
45
|
-
|
|
46
|
-
className: (0, import_clsx.default)({
|
|
47
|
-
[`has-text-align-${textAlign}`]: textAlign
|
|
48
|
-
})
|
|
49
|
-
}),
|
|
50
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("blockquote", { children: [
|
|
51
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.RichText.Content, { tagName: "p", value }),
|
|
52
|
-
shouldShowCitation && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.RichText.Content, { tagName: "cite", value: citation })
|
|
53
|
-
] })
|
|
54
|
-
}
|
|
55
|
-
);
|
|
31
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("figure", { ...import_block_editor.useBlockProps.save(), children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("blockquote", { children: [
|
|
32
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.RichText.Content, { tagName: "p", value }),
|
|
33
|
+
shouldShowCitation && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.RichText.Content, { tagName: "cite", value: citation })
|
|
34
|
+
] }) });
|
|
56
35
|
}
|
|
57
36
|
//# sourceMappingURL=save.cjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/pullquote/save.js"],
|
|
4
|
-
"sourcesContent": ["/**\n *
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": [
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { RichText, useBlockProps } from '@wordpress/block-editor';\n\nexport default function save( { attributes } ) {\n\tconst { citation, value } = attributes;\n\tconst shouldShowCitation = ! RichText.isEmpty( citation );\n\n\treturn (\n\t\t<figure { ...useBlockProps.save() }>\n\t\t\t<blockquote>\n\t\t\t\t<RichText.Content tagName=\"p\" value={ value } />\n\t\t\t\t{ shouldShowCitation && (\n\t\t\t\t\t<RichText.Content tagName=\"cite\" value={ citation } />\n\t\t\t\t) }\n\t\t\t</blockquote>\n\t\t</figure>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,0BAAwC;AAQrC;AANY,SAAR,KAAuB,EAAE,WAAW,GAAI;AAC9C,QAAM,EAAE,UAAU,MAAM,IAAI;AAC5B,QAAM,qBAAqB,CAAE,6BAAS,QAAS,QAAS;AAExD,SACC,4CAAC,YAAS,GAAG,kCAAc,KAAK,GAC/B,uDAAC,gBACA;AAAA,gDAAC,6BAAS,SAAT,EAAiB,SAAQ,KAAI,OAAgB;AAAA,IAC5C,sBACD,4CAAC,6BAAS,SAAT,EAAiB,SAAQ,QAAO,OAAQ,UAAW;AAAA,KAEtD,GACD;AAEF;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -34,7 +34,7 @@ function EnhancedPaginationControl({
|
|
|
34
34
|
}) {
|
|
35
35
|
const hasUnsupportedBlocks = (0, import_utils.useUnsupportedBlocks)(clientId);
|
|
36
36
|
let help = (0, import_i18n.__)(
|
|
37
|
-
"Reload the full page
|
|
37
|
+
"Reload the full page—instead of just the posts list—when visitors navigate between pages."
|
|
38
38
|
);
|
|
39
39
|
if (hasUnsupportedBlocks) {
|
|
40
40
|
help = (0, import_i18n.__)(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/query/edit/inspector-controls/enhanced-pagination-control.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { ToggleControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useUnsupportedBlocks } from '../../utils';\n\nexport default function EnhancedPaginationControl( {\n\tenhancedPagination,\n\tsetAttributes,\n\tclientId,\n} ) {\n\tconst hasUnsupportedBlocks = useUnsupportedBlocks( clientId );\n\n\tlet help = __(\n\t\t'Reload the full page
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { ToggleControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useUnsupportedBlocks } from '../../utils';\n\nexport default function EnhancedPaginationControl( {\n\tenhancedPagination,\n\tsetAttributes,\n\tclientId,\n} ) {\n\tconst hasUnsupportedBlocks = useUnsupportedBlocks( clientId );\n\n\tlet help = __(\n\t\t'Reload the full page—instead of just the posts list—when visitors navigate between pages.'\n\t);\n\tif ( hasUnsupportedBlocks ) {\n\t\thelp = __(\n\t\t\t'Enhancement disabled because there are non-compatible blocks inside the Query block.'\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<ToggleControl\n\t\t\t\tlabel={ __( 'Reload full page' ) }\n\t\t\t\thelp={ help }\n\t\t\t\tchecked={ ! enhancedPagination }\n\t\t\t\tdisabled={ hasUnsupportedBlocks }\n\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\tenhancedPagination: ! value,\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t/>\n\t\t</>\n\t);\n}\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAA8B;AAC9B,kBAAmB;AAKnB,mBAAqC;AAmBnC;AAjBa,SAAR,0BAA4C;AAAA,EAClD;AAAA,EACA;AAAA,EACA;AACD,GAAI;AACH,QAAM,2BAAuB,mCAAsB,QAAS;AAE5D,MAAI,WAAO;AAAA,IACV;AAAA,EACD;AACA,MAAK,sBAAuB;AAC3B,eAAO;AAAA,MACN;AAAA,IACD;AAAA,EACD;AAEA,SACC,2EACC;AAAA,IAAC;AAAA;AAAA,MACA,WAAQ,gBAAI,kBAAmB;AAAA,MAC/B;AAAA,MACA,SAAU,CAAE;AAAA,MACZ,UAAW;AAAA,MACX,UAAW,CAAE,UAAW;AACvB,sBAAe;AAAA,UACd,oBAAoB,CAAE;AAAA,QACvB,CAAE;AAAA,MACH;AAAA;AAAA,EACD,GACD;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -37,12 +37,12 @@ var defaultOrderByOptions = [
|
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
39
|
/* translators: Label for ordering posts by title in ascending order. */
|
|
40
|
-
label: (0, import_i18n.__)("A
|
|
40
|
+
label: (0, import_i18n.__)("A → Z"),
|
|
41
41
|
value: "title/asc"
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
44
|
/* translators: Label for ordering posts by title in descending order. */
|
|
45
|
-
label: (0, import_i18n.__)("Z
|
|
45
|
+
label: (0, import_i18n.__)("Z → A"),
|
|
46
46
|
value: "title/desc"
|
|
47
47
|
}
|
|
48
48
|
];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/query/edit/inspector-controls/order-control.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { SelectControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nconst defaultOrderByOptions = [\n\t{\n\t\tlabel: __( 'Newest to oldest' ),\n\t\tvalue: 'date/desc',\n\t},\n\t{\n\t\tlabel: __( 'Oldest to newest' ),\n\t\tvalue: 'date/asc',\n\t},\n\t{\n\t\t/* translators: Label for ordering posts by title in ascending order. */\n\t\tlabel: __( 'A
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAA8B;AAC9B,kBAAmB;AA8BjB;AA5BF,IAAM,wBAAwB;AAAA,EAC7B;AAAA,IACC,WAAO,gBAAI,kBAAmB;AAAA,IAC9B,OAAO;AAAA,EACR;AAAA,EACA;AAAA,IACC,WAAO,gBAAI,kBAAmB;AAAA,IAC9B,OAAO;AAAA,EACR;AAAA,EACA;AAAA;AAAA,IAEC,WAAO,gBAAI,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { SelectControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nconst defaultOrderByOptions = [\n\t{\n\t\tlabel: __( 'Newest to oldest' ),\n\t\tvalue: 'date/desc',\n\t},\n\t{\n\t\tlabel: __( 'Oldest to newest' ),\n\t\tvalue: 'date/asc',\n\t},\n\t{\n\t\t/* translators: Label for ordering posts by title in ascending order. */\n\t\tlabel: __( 'A → Z' ),\n\t\tvalue: 'title/asc',\n\t},\n\t{\n\t\t/* translators: Label for ordering posts by title in descending order. */\n\t\tlabel: __( 'Z → A' ),\n\t\tvalue: 'title/desc',\n\t},\n];\n\nfunction OrderControl( {\n\torder,\n\torderBy,\n\torderByOptions = defaultOrderByOptions,\n\tonChange,\n} ) {\n\treturn (\n\t\t<SelectControl\n\t\t\t__next40pxDefaultSize\n\t\t\tlabel={ __( 'Order by' ) }\n\t\t\tvalue={ `${ orderBy }/${ order }` }\n\t\t\toptions={ orderByOptions }\n\t\t\tonChange={ ( value ) => {\n\t\t\t\tconst [ newOrderBy, newOrder ] = value.split( '/' );\n\t\t\t\tonChange( { order: newOrder, orderBy: newOrderBy } );\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nexport default OrderControl;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAA8B;AAC9B,kBAAmB;AA8BjB;AA5BF,IAAM,wBAAwB;AAAA,EAC7B;AAAA,IACC,WAAO,gBAAI,kBAAmB;AAAA,IAC9B,OAAO;AAAA,EACR;AAAA,EACA;AAAA,IACC,WAAO,gBAAI,kBAAmB;AAAA,IAC9B,OAAO;AAAA,EACR;AAAA,EACA;AAAA;AAAA,IAEC,WAAO,gBAAI,OAAQ;AAAA,IACnB,OAAO;AAAA,EACR;AAAA,EACA;AAAA;AAAA,IAEC,WAAO,gBAAI,OAAQ;AAAA,IACnB,OAAO;AAAA,EACR;AACD;AAEA,SAAS,aAAc;AAAA,EACtB;AAAA,EACA;AAAA,EACA,iBAAiB;AAAA,EACjB;AACD,GAAI;AACH,SACC;AAAA,IAAC;AAAA;AAAA,MACA,uBAAqB;AAAA,MACrB,WAAQ,gBAAI,UAAW;AAAA,MACvB,OAAQ,GAAI,OAAQ,IAAK,KAAM;AAAA,MAC/B,SAAU;AAAA,MACV,UAAW,CAAE,UAAW;AACvB,cAAM,CAAE,YAAY,QAAS,IAAI,MAAM,MAAO,GAAI;AAClD,iBAAU,EAAE,OAAO,UAAU,SAAS,WAAW,CAAE;AAAA,MACpD;AAAA;AAAA,EACD;AAEF;AAEA,IAAO,wBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/build/query/utils.cjs
CHANGED
|
@@ -163,12 +163,12 @@ function useOrderByOptions(postType) {
|
|
|
163
163
|
},
|
|
164
164
|
{
|
|
165
165
|
/* translators: Label for ordering posts by title in ascending order. */
|
|
166
|
-
label: (0, import_i18n.__)("A
|
|
166
|
+
label: (0, import_i18n.__)("A → Z"),
|
|
167
167
|
value: "title/asc"
|
|
168
168
|
},
|
|
169
169
|
{
|
|
170
170
|
/* translators: Label for ordering posts by title in descending order. */
|
|
171
|
-
label: (0, import_i18n.__)("Z
|
|
171
|
+
label: (0, import_i18n.__)("Z → A"),
|
|
172
172
|
value: "title/desc"
|
|
173
173
|
}
|
|
174
174
|
];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/query/utils.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tcloneBlock,\n\tgetBlockSupport,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\n\n/** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */\n/** @typedef {import('@wordpress/components/build-types/query-controls/types').OrderByOption} OrderByOption */\n\n/**\n * @typedef IHasNameAndId\n * @property {string|number} id The entity's id.\n * @property {string} name The entity's name.\n */\n\n/**\n * The object used in Query block that contains info and helper mappings\n * from an array of IHasNameAndId objects.\n *\n * @typedef {Object} QueryEntitiesInfo\n * @property {IHasNameAndId[]} entities The array of entities.\n * @property {Object<string, IHasNameAndId>} mapById Object mapping with the id as key and the entity as value.\n * @property {Object<string, IHasNameAndId>} mapByName Object mapping with the name as key and the entity as value.\n * @property {string[]} names Array with the entities' names.\n */\n\n/**\n * Returns a helper object with mapping from Objects that implement\n * the `IHasNameAndId` interface. The returned object is used for\n * integration with `FormTokenField` component.\n *\n * @param {IHasNameAndId[]} entities The entities to extract of helper object.\n * @return {QueryEntitiesInfo} The object with the entities information.\n */\nexport const getEntitiesInfo = ( entities ) => {\n\tconst mapping = entities?.reduce(\n\t\t( accumulator, entity ) => {\n\t\t\tconst { mapById, mapByName, names } = accumulator;\n\t\t\tmapById[ entity.id ] = entity;\n\t\t\tmapByName[ entity.name ] = entity;\n\t\t\tnames.push( entity.name );\n\t\t\treturn accumulator;\n\t\t},\n\t\t{ mapById: {}, mapByName: {}, names: [] }\n\t);\n\treturn {\n\t\tentities,\n\t\t...mapping,\n\t};\n};\n\n/**\n * Helper util to return a value from a certain path of the object.\n * Path is specified as a string of properties, separated by dots,\n * for example: \"parent.child\".\n *\n * @param {Object} object Input object.\n * @param {string} path Path to the object property.\n * @return {*} Value of the object property at the specified path.\n */\nexport const getValueFromObjectPath = ( object, path ) => {\n\tconst normalizedPath = path.split( '.' );\n\tlet value = object;\n\tnormalizedPath.forEach( ( fieldName ) => {\n\t\tvalue = value?.[ fieldName ];\n\t} );\n\treturn value;\n};\n\n/**\n * Helper util to map records to add a `name` prop from a\n * provided path, in order to handle all entities in the same\n * fashion(implementing`IHasNameAndId` interface).\n *\n * @param {Object[]} entities The array of entities.\n * @param {string} path The path to map a `name` property from the entity.\n * @return {IHasNameAndId[]} An array of entities that now implement the `IHasNameAndId` interface.\n */\nexport const mapToIHasNameAndId = ( entities, path ) => {\n\treturn ( entities || [] ).map( ( entity ) => ( {\n\t\t...entity,\n\t\tname: decodeEntities( getValueFromObjectPath( entity, path ) ),\n\t} ) );\n};\n\n/**\n * Returns a helper object that contains:\n * 1. An `options` object from the available post types, to be passed to a `SelectControl`.\n * 2. A helper map with available taxonomies per post type.\n * 3. A helper map with post format support per post type.\n *\n * @return {Object} The helper object related to post types.\n */\nexport const usePostTypes = () => {\n\tconst postTypes = useSelect( ( select ) => {\n\t\tconst { getPostTypes } = select( coreStore );\n\t\tconst excludedPostTypes = [ 'attachment' ];\n\t\tconst filteredPostTypes = getPostTypes( { per_page: -1 } )?.filter(\n\t\t\t( { viewable, slug } ) =>\n\t\t\t\tviewable && ! excludedPostTypes.includes( slug )\n\t\t);\n\t\treturn filteredPostTypes;\n\t}, [] );\n\tconst postTypesTaxonomiesMap = useMemo( () => {\n\t\tif ( ! postTypes?.length ) {\n\t\t\treturn;\n\t\t}\n\t\treturn postTypes.reduce( ( accumulator, type ) => {\n\t\t\taccumulator[ type.slug ] = type.taxonomies;\n\t\t\treturn accumulator;\n\t\t}, {} );\n\t}, [ postTypes ] );\n\tconst postTypesSelectOptions = useMemo(\n\t\t() =>\n\t\t\t( postTypes || [] ).map( ( { labels, slug } ) => ( {\n\t\t\t\tlabel: labels.singular_name,\n\t\t\t\tvalue: slug,\n\t\t\t} ) ),\n\t\t[ postTypes ]\n\t);\n\tconst postTypeFormatSupportMap = useMemo( () => {\n\t\tif ( ! postTypes?.length ) {\n\t\t\treturn {};\n\t\t}\n\t\treturn postTypes.reduce( ( accumulator, type ) => {\n\t\t\taccumulator[ type.slug ] =\n\t\t\t\ttype.supports?.[ 'post-formats' ] || false;\n\t\t\treturn accumulator;\n\t\t}, {} );\n\t}, [ postTypes ] );\n\treturn {\n\t\tpostTypesTaxonomiesMap,\n\t\tpostTypesSelectOptions,\n\t\tpostTypeFormatSupportMap,\n\t};\n};\n\n/**\n * Hook that returns the taxonomies associated with a specific post type.\n *\n * @param {string} postType The post type from which to retrieve the associated taxonomies.\n * @return {Object[]} An array of the associated taxonomies.\n */\nexport const useTaxonomies = ( postType ) => {\n\tconst taxonomies = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getTaxonomies, getPostType } = select( coreStore );\n\t\t\t// Does the post type have taxonomies?\n\t\t\tif ( getPostType( postType )?.taxonomies?.length > 0 ) {\n\t\t\t\treturn getTaxonomies( {\n\t\t\t\t\ttype: postType,\n\t\t\t\t\tper_page: -1,\n\t\t\t\t} );\n\t\t\t}\n\t\t\treturn [];\n\t\t},\n\t\t[ postType ]\n\t);\n\treturn useMemo( () => {\n\t\treturn taxonomies?.filter(\n\t\t\t( { visibility } ) => !! visibility?.publicly_queryable\n\t\t);\n\t}, [ taxonomies ] );\n};\n\n/**\n * Hook that returns whether a specific post type is hierarchical.\n *\n * @param {string} postType The post type to check.\n * @return {boolean} Whether a specific post type is hierarchical.\n */\nexport function useIsPostTypeHierarchical( postType ) {\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst type = select( coreStore ).getPostType( postType );\n\t\t\treturn type?.viewable && type?.hierarchical;\n\t\t},\n\t\t[ postType ]\n\t);\n}\n\n/**\n * List of avaiable options to order by.\n *\n * @param {string} postType The post type to check.\n * @return {OrderByOption[]} List of order options.\n */\nexport function useOrderByOptions( postType ) {\n\tconst supportsCustomOrder = useSelect(\n\t\t( select ) => {\n\t\t\tconst type = select( coreStore ).getPostType( postType );\n\t\t\treturn !! type?.supports?.[ 'page-attributes' ];\n\t\t},\n\t\t[ postType ]\n\t);\n\n\treturn useMemo( () => {\n\t\tconst orderByOptions = [\n\t\t\t{\n\t\t\t\tlabel: __( 'Newest to oldest' ),\n\t\t\t\tvalue: 'date/desc',\n\t\t\t},\n\t\t\t{\n\t\t\t\tlabel: __( 'Oldest to newest' ),\n\t\t\t\tvalue: 'date/asc',\n\t\t\t},\n\t\t\t{\n\t\t\t\t/* translators: Label for ordering posts by title in ascending order. */\n\t\t\t\tlabel: __( 'A \u2192 Z' ),\n\t\t\t\tvalue: 'title/asc',\n\t\t\t},\n\t\t\t{\n\t\t\t\t/* translators: Label for ordering posts by title in descending order. */\n\t\t\t\tlabel: __( 'Z \u2192 A' ),\n\t\t\t\tvalue: 'title/desc',\n\t\t\t},\n\t\t];\n\n\t\tif ( supportsCustomOrder ) {\n\t\t\torderByOptions.push(\n\t\t\t\t{\n\t\t\t\t\t/* translators: Label for ordering posts by ascending menu order. */\n\t\t\t\t\tlabel: __( 'Ascending by order' ),\n\t\t\t\t\tvalue: 'menu_order/asc',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t/* translators: Label for ordering posts by descending menu order. */\n\t\t\t\t\tlabel: __( 'Descending by order' ),\n\t\t\t\t\tvalue: 'menu_order/desc',\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\treturn orderByOptions;\n\t}, [ supportsCustomOrder ] );\n}\n\n/**\n * Hook that returns the query properties' names defined by the active\n * block variation, to determine which block's filters to show.\n *\n * @param {Object} attributes Block attributes.\n * @return {string[]} An array of the query attributes.\n */\nexport function useAllowedControls( attributes ) {\n\treturn useSelect(\n\t\t( select ) =>\n\t\t\tselect( blocksStore ).getActiveBlockVariation(\n\t\t\t\t'core/query',\n\t\t\t\tattributes\n\t\t\t)?.allowedControls,\n\n\t\t[ attributes ]\n\t);\n}\nexport function isControlAllowed( allowedControls, key ) {\n\t// Every controls is allowed if the list is not defined.\n\tif ( ! allowedControls ) {\n\t\treturn true;\n\t}\n\treturn allowedControls.includes( key );\n}\n\n/**\n * Clones a pattern's blocks and then recurses over that list of blocks,\n * transforming them to retain some `query` attribute properties.\n * For now we retain the `postType` and `inherit` properties as they are\n * fundamental for the expected functionality of the block and don't affect\n * its design and presentation.\n *\n * Returns the cloned/transformed blocks and array of existing Query Loop\n * client ids for further manipulation, in order to avoid multiple recursions.\n *\n * @param {WPBlock[]} blocks The list of blocks to look through and transform(mutate).\n * @param {Record<string,*>} queryBlockAttributes The existing Query Loop's attributes.\n * @return {{ newBlocks: WPBlock[], queryClientIds: string[] }} An object with the cloned/transformed blocks and all the Query Loop clients from these blocks.\n */\nexport const getTransformedBlocksFromPattern = (\n\tblocks,\n\tqueryBlockAttributes\n) => {\n\tconst {\n\t\tquery: { postType, inherit },\n\t\tnamespace,\n\t} = queryBlockAttributes;\n\tconst clonedBlocks = blocks.map( ( block ) => cloneBlock( block ) );\n\tconst queryClientIds = [];\n\tconst blocksQueue = [ ...clonedBlocks ];\n\twhile ( blocksQueue.length > 0 ) {\n\t\tconst block = blocksQueue.shift();\n\t\tif ( block.name === 'core/query' ) {\n\t\t\tblock.attributes.query = {\n\t\t\t\t...block.attributes.query,\n\t\t\t\tpostType,\n\t\t\t\tinherit,\n\t\t\t};\n\t\t\tif ( namespace ) {\n\t\t\t\tblock.attributes.namespace = namespace;\n\t\t\t}\n\t\t\tqueryClientIds.push( block.clientId );\n\t\t}\n\t\tblock.innerBlocks?.forEach( ( innerBlock ) => {\n\t\t\tblocksQueue.push( innerBlock );\n\t\t} );\n\t}\n\treturn { newBlocks: clonedBlocks, queryClientIds };\n};\n\n/**\n * Helper hook that determines if there is an active variation of the block\n * and if there are available specific patterns for this variation.\n * If there are, these patterns are going to be the only ones suggested to\n * the user in setup and replace flow, without including the default ones\n * for Query Loop.\n *\n * If there are no such patterns, the default ones for Query Loop are going\n * to be suggested.\n *\n * @param {string} clientId The block's client ID.\n * @param {Object} attributes The block's attributes.\n * @return {string} The block name to be used in the patterns suggestions.\n */\nexport function useBlockNameForPatterns( clientId, attributes ) {\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst activeVariationName = select(\n\t\t\t\tblocksStore\n\t\t\t).getActiveBlockVariation( 'core/query', attributes )?.name;\n\n\t\t\tif ( ! activeVariationName ) {\n\t\t\t\treturn 'core/query';\n\t\t\t}\n\n\t\t\tconst { getBlockRootClientId, getPatternsByBlockTypes } =\n\t\t\t\tselect( blockEditorStore );\n\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\t\t\tconst activePatterns = getPatternsByBlockTypes(\n\t\t\t\t`core/query/${ activeVariationName }`,\n\t\t\t\trootClientId\n\t\t\t);\n\n\t\t\treturn activePatterns.length > 0\n\t\t\t\t? `core/query/${ activeVariationName }`\n\t\t\t\t: 'core/query';\n\t\t},\n\t\t[ clientId, attributes ]\n\t);\n}\n\n/**\n * Helper hook that determines if there is an active variation of the block\n * and if there are available specific scoped `block` variations connected with\n * this variation.\n *\n * If there are, these variations are going to be the only ones suggested\n * to the user in setup flow when clicking to `start blank`, without including\n * the default ones for Query Loop.\n *\n * If there are no such scoped `block` variations, the default ones for Query\n * Loop are going to be suggested.\n *\n * The way we determine such variations is with the convention that they have the `namespace`\n * attribute defined as an array. This array should contain the names(`name` property) of any\n * variations they want to be connected to.\n * For example, if we have a `Query Loop` scoped `inserter` variation with the name `products`,\n * we can connect a scoped `block` variation by setting its `namespace` attribute to `['products']`.\n * If the user selects this variation, the `namespace` attribute will be overridden by the\n * main `inserter` variation.\n *\n * @param {Object} attributes The block's attributes.\n * @return {WPBlockVariation[]} The block variations to be suggested in setup flow, when clicking to `start blank`.\n */\nexport function useScopedBlockVariations( attributes ) {\n\tconst { activeVariationName, blockVariations } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getActiveBlockVariation, getBlockVariations } =\n\t\t\t\tselect( blocksStore );\n\t\t\treturn {\n\t\t\t\tactiveVariationName: getActiveBlockVariation(\n\t\t\t\t\t'core/query',\n\t\t\t\t\tattributes\n\t\t\t\t)?.name,\n\t\t\t\tblockVariations: getBlockVariations( 'core/query', 'block' ),\n\t\t\t};\n\t\t},\n\t\t[ attributes ]\n\t);\n\tconst variations = useMemo( () => {\n\t\t// Filter out the variations that have defined a `namespace` attribute,\n\t\t// which means they are 'connected' to specific variations of the block.\n\t\tconst isNotConnected = ( variation ) =>\n\t\t\t! variation.attributes?.namespace;\n\t\tif ( ! activeVariationName ) {\n\t\t\treturn blockVariations.filter( isNotConnected );\n\t\t}\n\t\tconst connectedVariations = blockVariations.filter( ( variation ) =>\n\t\t\tvariation.attributes?.namespace?.includes( activeVariationName )\n\t\t);\n\t\tif ( !! connectedVariations.length ) {\n\t\t\treturn connectedVariations;\n\t\t}\n\t\treturn blockVariations.filter( isNotConnected );\n\t}, [ activeVariationName, blockVariations ] );\n\treturn variations;\n}\n\n/**\n * Hook that returns the block patterns for a specific block type.\n *\n * @param {string} clientId The block's client ID.\n * @param {string} name The block type name.\n * @return {Object[]} An array of valid block patterns.\n */\nexport const usePatterns = ( clientId, name ) => {\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockRootClientId, getPatternsByBlockTypes } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\t\t\treturn getPatternsByBlockTypes( name, rootClientId );\n\t\t},\n\t\t[ name, clientId ]\n\t);\n};\n\n/**\n * Hook that, given a block clientId, determines if it has unsupported blocks or not.\n *\n * @param {string} clientId The block's client ID.\n * @return {boolean} True if there are any unsupported blocks.\n */\nexport const useUnsupportedBlocks = ( clientId ) => {\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst { getClientIdsOfDescendants, getBlockName } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\treturn getClientIdsOfDescendants( clientId ).some(\n\t\t\t\t( descendantClientId ) => {\n\t\t\t\t\tconst blockName = getBlockName( descendantClientId );\n\t\t\t\t\t/*\n\t\t\t\t\t * Client side navigation can be true in two states:\n\t\t\t\t\t * - supports.interactivity = true;\n\t\t\t\t\t * - supports.interactivity.clientNavigation = true;\n\t\t\t\t\t */\n\t\t\t\t\tconst blockSupportsInteractivity = Object.is(\n\t\t\t\t\t\tgetBlockSupport( blockName, 'interactivity' ),\n\t\t\t\t\t\ttrue\n\t\t\t\t\t);\n\t\t\t\t\tconst blockSupportsInteractivityClientNavigation =\n\t\t\t\t\t\tgetBlockSupport(\n\t\t\t\t\t\t\tblockName,\n\t\t\t\t\t\t\t'interactivity.clientNavigation'\n\t\t\t\t\t\t);\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t! blockSupportsInteractivity &&\n\t\t\t\t\t\t! blockSupportsInteractivityClientNavigation\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\t\t[ clientId ]\n\t);\n};\n\n/**\n * Helper function that returns the query context from the editor based on the\n * available template slug.\n *\n * @param {string} templateSlug Current template slug based on context.\n * @return {Object} An object with isSingular and templateType properties.\n */\nexport function getQueryContextFromTemplate( templateSlug ) {\n\t// In the Post Editor, the template slug is not available.\n\tif ( ! templateSlug ) {\n\t\treturn { isSingular: true };\n\t}\n\tlet isSingular = false;\n\tlet templateType = templateSlug === 'wp' ? 'custom' : templateSlug;\n\tconst singularTemplates = [ '404', 'blank', 'single', 'page', 'custom' ];\n\tconst templateTypeFromSlug = templateSlug.includes( '-' )\n\t\t? templateSlug.split( '-', 1 )[ 0 ]\n\t\t: templateSlug;\n\tconst queryFromTemplateSlug = templateSlug.includes( '-' )\n\t\t? templateSlug.split( '-' ).slice( 1 ).join( '-' )\n\t\t: '';\n\tif ( queryFromTemplateSlug ) {\n\t\ttemplateType = templateTypeFromSlug;\n\t}\n\tisSingular = singularTemplates.includes( templateType );\n\n\treturn { isSingular, templateType };\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAA0B;AAC1B,qBAAwB;AACxB,uBAAmC;AACnC,0BAA0C;AAC1C,2BAA+B;AAC/B,kBAAmB;AACnB,oBAIO;AA8BA,IAAM,kBAAkB,CAAE,aAAc;AAC9C,QAAM,UAAU,UAAU;AAAA,IACzB,CAAE,aAAa,WAAY;AAC1B,YAAM,EAAE,SAAS,WAAW,MAAM,IAAI;AACtC,cAAS,OAAO,EAAG,IAAI;AACvB,gBAAW,OAAO,IAAK,IAAI;AAC3B,YAAM,KAAM,OAAO,IAAK;AACxB,aAAO;AAAA,IACR;AAAA,IACA,EAAE,SAAS,CAAC,GAAG,WAAW,CAAC,GAAG,OAAO,CAAC,EAAE;AAAA,EACzC;AACA,SAAO;AAAA,IACN;AAAA,IACA,GAAG;AAAA,EACJ;AACD;AAWO,IAAM,yBAAyB,CAAE,QAAQ,SAAU;AACzD,QAAM,iBAAiB,KAAK,MAAO,GAAI;AACvC,MAAI,QAAQ;AACZ,iBAAe,QAAS,CAAE,cAAe;AACxC,YAAQ,QAAS,SAAU;AAAA,EAC5B,CAAE;AACF,SAAO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@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tcloneBlock,\n\tgetBlockSupport,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\n\n/** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */\n/** @typedef {import('@wordpress/components/build-types/query-controls/types').OrderByOption} OrderByOption */\n\n/**\n * @typedef IHasNameAndId\n * @property {string|number} id The entity's id.\n * @property {string} name The entity's name.\n */\n\n/**\n * The object used in Query block that contains info and helper mappings\n * from an array of IHasNameAndId objects.\n *\n * @typedef {Object} QueryEntitiesInfo\n * @property {IHasNameAndId[]} entities The array of entities.\n * @property {Object<string, IHasNameAndId>} mapById Object mapping with the id as key and the entity as value.\n * @property {Object<string, IHasNameAndId>} mapByName Object mapping with the name as key and the entity as value.\n * @property {string[]} names Array with the entities' names.\n */\n\n/**\n * Returns a helper object with mapping from Objects that implement\n * the `IHasNameAndId` interface. The returned object is used for\n * integration with `FormTokenField` component.\n *\n * @param {IHasNameAndId[]} entities The entities to extract of helper object.\n * @return {QueryEntitiesInfo} The object with the entities information.\n */\nexport const getEntitiesInfo = ( entities ) => {\n\tconst mapping = entities?.reduce(\n\t\t( accumulator, entity ) => {\n\t\t\tconst { mapById, mapByName, names } = accumulator;\n\t\t\tmapById[ entity.id ] = entity;\n\t\t\tmapByName[ entity.name ] = entity;\n\t\t\tnames.push( entity.name );\n\t\t\treturn accumulator;\n\t\t},\n\t\t{ mapById: {}, mapByName: {}, names: [] }\n\t);\n\treturn {\n\t\tentities,\n\t\t...mapping,\n\t};\n};\n\n/**\n * Helper util to return a value from a certain path of the object.\n * Path is specified as a string of properties, separated by dots,\n * for example: \"parent.child\".\n *\n * @param {Object} object Input object.\n * @param {string} path Path to the object property.\n * @return {*} Value of the object property at the specified path.\n */\nexport const getValueFromObjectPath = ( object, path ) => {\n\tconst normalizedPath = path.split( '.' );\n\tlet value = object;\n\tnormalizedPath.forEach( ( fieldName ) => {\n\t\tvalue = value?.[ fieldName ];\n\t} );\n\treturn value;\n};\n\n/**\n * Helper util to map records to add a `name` prop from a\n * provided path, in order to handle all entities in the same\n * fashion(implementing`IHasNameAndId` interface).\n *\n * @param {Object[]} entities The array of entities.\n * @param {string} path The path to map a `name` property from the entity.\n * @return {IHasNameAndId[]} An array of entities that now implement the `IHasNameAndId` interface.\n */\nexport const mapToIHasNameAndId = ( entities, path ) => {\n\treturn ( entities || [] ).map( ( entity ) => ( {\n\t\t...entity,\n\t\tname: decodeEntities( getValueFromObjectPath( entity, path ) ),\n\t} ) );\n};\n\n/**\n * Returns a helper object that contains:\n * 1. An `options` object from the available post types, to be passed to a `SelectControl`.\n * 2. A helper map with available taxonomies per post type.\n * 3. A helper map with post format support per post type.\n *\n * @return {Object} The helper object related to post types.\n */\nexport const usePostTypes = () => {\n\tconst postTypes = useSelect( ( select ) => {\n\t\tconst { getPostTypes } = select( coreStore );\n\t\tconst excludedPostTypes = [ 'attachment' ];\n\t\tconst filteredPostTypes = getPostTypes( { per_page: -1 } )?.filter(\n\t\t\t( { viewable, slug } ) =>\n\t\t\t\tviewable && ! excludedPostTypes.includes( slug )\n\t\t);\n\t\treturn filteredPostTypes;\n\t}, [] );\n\tconst postTypesTaxonomiesMap = useMemo( () => {\n\t\tif ( ! postTypes?.length ) {\n\t\t\treturn;\n\t\t}\n\t\treturn postTypes.reduce( ( accumulator, type ) => {\n\t\t\taccumulator[ type.slug ] = type.taxonomies;\n\t\t\treturn accumulator;\n\t\t}, {} );\n\t}, [ postTypes ] );\n\tconst postTypesSelectOptions = useMemo(\n\t\t() =>\n\t\t\t( postTypes || [] ).map( ( { labels, slug } ) => ( {\n\t\t\t\tlabel: labels.singular_name,\n\t\t\t\tvalue: slug,\n\t\t\t} ) ),\n\t\t[ postTypes ]\n\t);\n\tconst postTypeFormatSupportMap = useMemo( () => {\n\t\tif ( ! postTypes?.length ) {\n\t\t\treturn {};\n\t\t}\n\t\treturn postTypes.reduce( ( accumulator, type ) => {\n\t\t\taccumulator[ type.slug ] =\n\t\t\t\ttype.supports?.[ 'post-formats' ] || false;\n\t\t\treturn accumulator;\n\t\t}, {} );\n\t}, [ postTypes ] );\n\treturn {\n\t\tpostTypesTaxonomiesMap,\n\t\tpostTypesSelectOptions,\n\t\tpostTypeFormatSupportMap,\n\t};\n};\n\n/**\n * Hook that returns the taxonomies associated with a specific post type.\n *\n * @param {string} postType The post type from which to retrieve the associated taxonomies.\n * @return {Object[]} An array of the associated taxonomies.\n */\nexport const useTaxonomies = ( postType ) => {\n\tconst taxonomies = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getTaxonomies, getPostType } = select( coreStore );\n\t\t\t// Does the post type have taxonomies?\n\t\t\tif ( getPostType( postType )?.taxonomies?.length > 0 ) {\n\t\t\t\treturn getTaxonomies( {\n\t\t\t\t\ttype: postType,\n\t\t\t\t\tper_page: -1,\n\t\t\t\t} );\n\t\t\t}\n\t\t\treturn [];\n\t\t},\n\t\t[ postType ]\n\t);\n\treturn useMemo( () => {\n\t\treturn taxonomies?.filter(\n\t\t\t( { visibility } ) => !! visibility?.publicly_queryable\n\t\t);\n\t}, [ taxonomies ] );\n};\n\n/**\n * Hook that returns whether a specific post type is hierarchical.\n *\n * @param {string} postType The post type to check.\n * @return {boolean} Whether a specific post type is hierarchical.\n */\nexport function useIsPostTypeHierarchical( postType ) {\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst type = select( coreStore ).getPostType( postType );\n\t\t\treturn type?.viewable && type?.hierarchical;\n\t\t},\n\t\t[ postType ]\n\t);\n}\n\n/**\n * List of avaiable options to order by.\n *\n * @param {string} postType The post type to check.\n * @return {OrderByOption[]} List of order options.\n */\nexport function useOrderByOptions( postType ) {\n\tconst supportsCustomOrder = useSelect(\n\t\t( select ) => {\n\t\t\tconst type = select( coreStore ).getPostType( postType );\n\t\t\treturn !! type?.supports?.[ 'page-attributes' ];\n\t\t},\n\t\t[ postType ]\n\t);\n\n\treturn useMemo( () => {\n\t\tconst orderByOptions = [\n\t\t\t{\n\t\t\t\tlabel: __( 'Newest to oldest' ),\n\t\t\t\tvalue: 'date/desc',\n\t\t\t},\n\t\t\t{\n\t\t\t\tlabel: __( 'Oldest to newest' ),\n\t\t\t\tvalue: 'date/asc',\n\t\t\t},\n\t\t\t{\n\t\t\t\t/* translators: Label for ordering posts by title in ascending order. */\n\t\t\t\tlabel: __( 'A → Z' ),\n\t\t\t\tvalue: 'title/asc',\n\t\t\t},\n\t\t\t{\n\t\t\t\t/* translators: Label for ordering posts by title in descending order. */\n\t\t\t\tlabel: __( 'Z → A' ),\n\t\t\t\tvalue: 'title/desc',\n\t\t\t},\n\t\t];\n\n\t\tif ( supportsCustomOrder ) {\n\t\t\torderByOptions.push(\n\t\t\t\t{\n\t\t\t\t\t/* translators: Label for ordering posts by ascending menu order. */\n\t\t\t\t\tlabel: __( 'Ascending by order' ),\n\t\t\t\t\tvalue: 'menu_order/asc',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t/* translators: Label for ordering posts by descending menu order. */\n\t\t\t\t\tlabel: __( 'Descending by order' ),\n\t\t\t\t\tvalue: 'menu_order/desc',\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\treturn orderByOptions;\n\t}, [ supportsCustomOrder ] );\n}\n\n/**\n * Hook that returns the query properties' names defined by the active\n * block variation, to determine which block's filters to show.\n *\n * @param {Object} attributes Block attributes.\n * @return {string[]} An array of the query attributes.\n */\nexport function useAllowedControls( attributes ) {\n\treturn useSelect(\n\t\t( select ) =>\n\t\t\tselect( blocksStore ).getActiveBlockVariation(\n\t\t\t\t'core/query',\n\t\t\t\tattributes\n\t\t\t)?.allowedControls,\n\n\t\t[ attributes ]\n\t);\n}\nexport function isControlAllowed( allowedControls, key ) {\n\t// Every controls is allowed if the list is not defined.\n\tif ( ! allowedControls ) {\n\t\treturn true;\n\t}\n\treturn allowedControls.includes( key );\n}\n\n/**\n * Clones a pattern's blocks and then recurses over that list of blocks,\n * transforming them to retain some `query` attribute properties.\n * For now we retain the `postType` and `inherit` properties as they are\n * fundamental for the expected functionality of the block and don't affect\n * its design and presentation.\n *\n * Returns the cloned/transformed blocks and array of existing Query Loop\n * client ids for further manipulation, in order to avoid multiple recursions.\n *\n * @param {WPBlock[]} blocks The list of blocks to look through and transform(mutate).\n * @param {Record<string,*>} queryBlockAttributes The existing Query Loop's attributes.\n * @return {{ newBlocks: WPBlock[], queryClientIds: string[] }} An object with the cloned/transformed blocks and all the Query Loop clients from these blocks.\n */\nexport const getTransformedBlocksFromPattern = (\n\tblocks,\n\tqueryBlockAttributes\n) => {\n\tconst {\n\t\tquery: { postType, inherit },\n\t\tnamespace,\n\t} = queryBlockAttributes;\n\tconst clonedBlocks = blocks.map( ( block ) => cloneBlock( block ) );\n\tconst queryClientIds = [];\n\tconst blocksQueue = [ ...clonedBlocks ];\n\twhile ( blocksQueue.length > 0 ) {\n\t\tconst block = blocksQueue.shift();\n\t\tif ( block.name === 'core/query' ) {\n\t\t\tblock.attributes.query = {\n\t\t\t\t...block.attributes.query,\n\t\t\t\tpostType,\n\t\t\t\tinherit,\n\t\t\t};\n\t\t\tif ( namespace ) {\n\t\t\t\tblock.attributes.namespace = namespace;\n\t\t\t}\n\t\t\tqueryClientIds.push( block.clientId );\n\t\t}\n\t\tblock.innerBlocks?.forEach( ( innerBlock ) => {\n\t\t\tblocksQueue.push( innerBlock );\n\t\t} );\n\t}\n\treturn { newBlocks: clonedBlocks, queryClientIds };\n};\n\n/**\n * Helper hook that determines if there is an active variation of the block\n * and if there are available specific patterns for this variation.\n * If there are, these patterns are going to be the only ones suggested to\n * the user in setup and replace flow, without including the default ones\n * for Query Loop.\n *\n * If there are no such patterns, the default ones for Query Loop are going\n * to be suggested.\n *\n * @param {string} clientId The block's client ID.\n * @param {Object} attributes The block's attributes.\n * @return {string} The block name to be used in the patterns suggestions.\n */\nexport function useBlockNameForPatterns( clientId, attributes ) {\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst activeVariationName = select(\n\t\t\t\tblocksStore\n\t\t\t).getActiveBlockVariation( 'core/query', attributes )?.name;\n\n\t\t\tif ( ! activeVariationName ) {\n\t\t\t\treturn 'core/query';\n\t\t\t}\n\n\t\t\tconst { getBlockRootClientId, getPatternsByBlockTypes } =\n\t\t\t\tselect( blockEditorStore );\n\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\t\t\tconst activePatterns = getPatternsByBlockTypes(\n\t\t\t\t`core/query/${ activeVariationName }`,\n\t\t\t\trootClientId\n\t\t\t);\n\n\t\t\treturn activePatterns.length > 0\n\t\t\t\t? `core/query/${ activeVariationName }`\n\t\t\t\t: 'core/query';\n\t\t},\n\t\t[ clientId, attributes ]\n\t);\n}\n\n/**\n * Helper hook that determines if there is an active variation of the block\n * and if there are available specific scoped `block` variations connected with\n * this variation.\n *\n * If there are, these variations are going to be the only ones suggested\n * to the user in setup flow when clicking to `start blank`, without including\n * the default ones for Query Loop.\n *\n * If there are no such scoped `block` variations, the default ones for Query\n * Loop are going to be suggested.\n *\n * The way we determine such variations is with the convention that they have the `namespace`\n * attribute defined as an array. This array should contain the names(`name` property) of any\n * variations they want to be connected to.\n * For example, if we have a `Query Loop` scoped `inserter` variation with the name `products`,\n * we can connect a scoped `block` variation by setting its `namespace` attribute to `['products']`.\n * If the user selects this variation, the `namespace` attribute will be overridden by the\n * main `inserter` variation.\n *\n * @param {Object} attributes The block's attributes.\n * @return {WPBlockVariation[]} The block variations to be suggested in setup flow, when clicking to `start blank`.\n */\nexport function useScopedBlockVariations( attributes ) {\n\tconst { activeVariationName, blockVariations } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getActiveBlockVariation, getBlockVariations } =\n\t\t\t\tselect( blocksStore );\n\t\t\treturn {\n\t\t\t\tactiveVariationName: getActiveBlockVariation(\n\t\t\t\t\t'core/query',\n\t\t\t\t\tattributes\n\t\t\t\t)?.name,\n\t\t\t\tblockVariations: getBlockVariations( 'core/query', 'block' ),\n\t\t\t};\n\t\t},\n\t\t[ attributes ]\n\t);\n\tconst variations = useMemo( () => {\n\t\t// Filter out the variations that have defined a `namespace` attribute,\n\t\t// which means they are 'connected' to specific variations of the block.\n\t\tconst isNotConnected = ( variation ) =>\n\t\t\t! variation.attributes?.namespace;\n\t\tif ( ! activeVariationName ) {\n\t\t\treturn blockVariations.filter( isNotConnected );\n\t\t}\n\t\tconst connectedVariations = blockVariations.filter( ( variation ) =>\n\t\t\tvariation.attributes?.namespace?.includes( activeVariationName )\n\t\t);\n\t\tif ( !! connectedVariations.length ) {\n\t\t\treturn connectedVariations;\n\t\t}\n\t\treturn blockVariations.filter( isNotConnected );\n\t}, [ activeVariationName, blockVariations ] );\n\treturn variations;\n}\n\n/**\n * Hook that returns the block patterns for a specific block type.\n *\n * @param {string} clientId The block's client ID.\n * @param {string} name The block type name.\n * @return {Object[]} An array of valid block patterns.\n */\nexport const usePatterns = ( clientId, name ) => {\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockRootClientId, getPatternsByBlockTypes } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\t\t\treturn getPatternsByBlockTypes( name, rootClientId );\n\t\t},\n\t\t[ name, clientId ]\n\t);\n};\n\n/**\n * Hook that, given a block clientId, determines if it has unsupported blocks or not.\n *\n * @param {string} clientId The block's client ID.\n * @return {boolean} True if there are any unsupported blocks.\n */\nexport const useUnsupportedBlocks = ( clientId ) => {\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst { getClientIdsOfDescendants, getBlockName } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\treturn getClientIdsOfDescendants( clientId ).some(\n\t\t\t\t( descendantClientId ) => {\n\t\t\t\t\tconst blockName = getBlockName( descendantClientId );\n\t\t\t\t\t/*\n\t\t\t\t\t * Client side navigation can be true in two states:\n\t\t\t\t\t * - supports.interactivity = true;\n\t\t\t\t\t * - supports.interactivity.clientNavigation = true;\n\t\t\t\t\t */\n\t\t\t\t\tconst blockSupportsInteractivity = Object.is(\n\t\t\t\t\t\tgetBlockSupport( blockName, 'interactivity' ),\n\t\t\t\t\t\ttrue\n\t\t\t\t\t);\n\t\t\t\t\tconst blockSupportsInteractivityClientNavigation =\n\t\t\t\t\t\tgetBlockSupport(\n\t\t\t\t\t\t\tblockName,\n\t\t\t\t\t\t\t'interactivity.clientNavigation'\n\t\t\t\t\t\t);\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t! blockSupportsInteractivity &&\n\t\t\t\t\t\t! blockSupportsInteractivityClientNavigation\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\t\t[ clientId ]\n\t);\n};\n\n/**\n * Helper function that returns the query context from the editor based on the\n * available template slug.\n *\n * @param {string} templateSlug Current template slug based on context.\n * @return {Object} An object with isSingular and templateType properties.\n */\nexport function getQueryContextFromTemplate( templateSlug ) {\n\t// In the Post Editor, the template slug is not available.\n\tif ( ! templateSlug ) {\n\t\treturn { isSingular: true };\n\t}\n\tlet isSingular = false;\n\tlet templateType = templateSlug === 'wp' ? 'custom' : templateSlug;\n\tconst singularTemplates = [ '404', 'blank', 'single', 'page', 'custom' ];\n\tconst templateTypeFromSlug = templateSlug.includes( '-' )\n\t\t? templateSlug.split( '-', 1 )[ 0 ]\n\t\t: templateSlug;\n\tconst queryFromTemplateSlug = templateSlug.includes( '-' )\n\t\t? templateSlug.split( '-' ).slice( 1 ).join( '-' )\n\t\t: '';\n\tif ( queryFromTemplateSlug ) {\n\t\ttemplateType = templateTypeFromSlug;\n\t}\n\tisSingular = singularTemplates.includes( templateType );\n\n\treturn { isSingular, templateType };\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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AA,gBACzC,+BAAiB,WAAW,eAAgB;AAAA,YAC5C;AAAA,UACD;AACA,gBAAM,iDACL;AAAA,YACC;AAAA,YACA;AAAA,UACD;AAED,iBACC,CAAE,8BACF,CAAE;AAAA,QAEJ;AAAA,MACD;AAAA,IACD;AAAA,IACA,CAAE,QAAS;AAAA,EACZ;AACD;AASO,SAAS,4BAA6B,cAAe;AAE3D,MAAK,CAAE,cAAe;AACrB,WAAO,EAAE,YAAY,KAAK;AAAA,EAC3B;AACA,MAAI,aAAa;AACjB,MAAI,eAAe,iBAAiB,OAAO,WAAW;AACtD,QAAM,oBAAoB,CAAE,OAAO,SAAS,UAAU,QAAQ,QAAS;AACvE,QAAM,uBAAuB,aAAa,SAAU,GAAI,IACrD,aAAa,MAAO,KAAK,CAAE,EAAG,CAAE,IAChC;AACH,QAAM,wBAAwB,aAAa,SAAU,GAAI,IACtD,aAAa,MAAO,GAAI,EAAE,MAAO,CAAE,EAAE,KAAM,GAAI,IAC/C;AACH,MAAK,uBAAwB;AAC5B,mBAAe;AAAA,EAChB;AACA,eAAa,kBAAkB,SAAU,YAAa;AAEtD,SAAO,EAAE,YAAY,aAAa;AACnC;",
|
|
6
6
|
"names": ["coreStore", "blocksStore", "blockEditorStore"]
|
|
7
7
|
}
|
|
@@ -28,8 +28,8 @@ var import_block_editor = require("@wordpress/block-editor");
|
|
|
28
28
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
29
29
|
var arrowMap = {
|
|
30
30
|
none: "",
|
|
31
|
-
arrow: "
|
|
32
|
-
chevron: "
|
|
31
|
+
arrow: "→",
|
|
32
|
+
chevron: "»"
|
|
33
33
|
};
|
|
34
34
|
function QueryPaginationNextEdit({
|
|
35
35
|
attributes: { label },
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/query-pagination-next/edit.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useBlockProps, PlainText } from '@wordpress/block-editor';\n\nconst arrowMap = {\n\tnone: '',\n\tarrow: '
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useBlockProps, PlainText } from '@wordpress/block-editor';\n\nconst arrowMap = {\n\tnone: '',\n\tarrow: '→',\n\tchevron: '»',\n};\n\nexport default function QueryPaginationNextEdit( {\n\tattributes: { label },\n\tsetAttributes,\n\tcontext: { paginationArrow, showLabel },\n} ) {\n\tconst displayArrow = arrowMap[ paginationArrow ];\n\treturn (\n\t\t<a\n\t\t\thref=\"#pagination-next-pseudo-link\"\n\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t{ ...useBlockProps() }\n\t\t>\n\t\t\t{ showLabel && (\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={ __( 'Next page link' ) }\n\t\t\t\t\tplaceholder={ __( 'Next Page' ) }\n\t\t\t\t\tvalue={ label }\n\t\t\t\t\tonChange={ ( newLabel ) =>\n\t\t\t\t\t\tsetAttributes( { label: newLabel } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ displayArrow && (\n\t\t\t\t<span\n\t\t\t\t\tclassName={ `wp-block-query-pagination-next-arrow is-arrow-${ paginationArrow }` }\n\t\t\t\t\taria-hidden\n\t\t\t\t>\n\t\t\t\t\t{ displayArrow }\n\t\t\t\t</span>\n\t\t\t) }\n\t\t</a>\n\t);\n}\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AACnB,0BAAyC;AAevC;AAbF,IAAM,WAAW;AAAA,EAChB,MAAM;AAAA,EACN,OAAO;AAAA,EACP,SAAS;AACV;AAEe,SAAR,wBAA0C;AAAA,EAChD,YAAY,EAAE,MAAM;AAAA,EACpB;AAAA,EACA,SAAS,EAAE,iBAAiB,UAAU;AACvC,GAAI;AACH,QAAM,eAAe,SAAU,eAAgB;AAC/C,SACC;AAAA,IAAC;AAAA;AAAA,MACA,MAAK;AAAA,MACL,SAAU,CAAE,UAAW,MAAM,eAAe;AAAA,MAC1C,OAAG,mCAAc;AAAA,MAEjB;AAAA,qBACD;AAAA,UAAC;AAAA;AAAA,YACA,uBAAwB;AAAA,YACxB,SAAQ;AAAA,YACR,kBAAa,gBAAI,gBAAiB;AAAA,YAClC,iBAAc,gBAAI,WAAY;AAAA,YAC9B,OAAQ;AAAA,YACR,UAAW,CAAE,aACZ,cAAe,EAAE,OAAO,SAAS,CAAE;AAAA;AAAA,QAErC;AAAA,QAEC,gBACD;AAAA,UAAC;AAAA;AAAA,YACA,WAAY,iDAAkD,eAAgB;AAAA,YAC9E,eAAW;AAAA,YAET;AAAA;AAAA,QACH;AAAA;AAAA;AAAA,EAEF;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -28,8 +28,8 @@ var import_block_editor = require("@wordpress/block-editor");
|
|
|
28
28
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
29
29
|
var arrowMap = {
|
|
30
30
|
none: "",
|
|
31
|
-
arrow: "
|
|
32
|
-
chevron: "
|
|
31
|
+
arrow: "←",
|
|
32
|
+
chevron: "«"
|
|
33
33
|
};
|
|
34
34
|
function QueryPaginationPreviousEdit({
|
|
35
35
|
attributes: { label },
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/query-pagination-previous/edit.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useBlockProps, PlainText } from '@wordpress/block-editor';\n\nconst arrowMap = {\n\tnone: '',\n\tarrow: '
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useBlockProps, PlainText } from '@wordpress/block-editor';\n\nconst arrowMap = {\n\tnone: '',\n\tarrow: '←',\n\tchevron: '«',\n};\n\nexport default function QueryPaginationPreviousEdit( {\n\tattributes: { label },\n\tsetAttributes,\n\tcontext: { paginationArrow, showLabel },\n} ) {\n\tconst displayArrow = arrowMap[ paginationArrow ];\n\treturn (\n\t\t<a\n\t\t\thref=\"#pagination-previous-pseudo-link\"\n\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t{ ...useBlockProps() }\n\t\t>\n\t\t\t{ displayArrow && (\n\t\t\t\t<span\n\t\t\t\t\tclassName={ `wp-block-query-pagination-previous-arrow is-arrow-${ paginationArrow }` }\n\t\t\t\t\taria-hidden\n\t\t\t\t>\n\t\t\t\t\t{ displayArrow }\n\t\t\t\t</span>\n\t\t\t) }\n\t\t\t{ showLabel && (\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={ __( 'Previous page link' ) }\n\t\t\t\t\tplaceholder={ __( 'Previous Page' ) }\n\t\t\t\t\tvalue={ label }\n\t\t\t\t\tonChange={ ( newLabel ) =>\n\t\t\t\t\t\tsetAttributes( { label: newLabel } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) }\n\t\t</a>\n\t);\n}\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AACnB,0BAAyC;AAevC;AAbF,IAAM,WAAW;AAAA,EAChB,MAAM;AAAA,EACN,OAAO;AAAA,EACP,SAAS;AACV;AAEe,SAAR,4BAA8C;AAAA,EACpD,YAAY,EAAE,MAAM;AAAA,EACpB;AAAA,EACA,SAAS,EAAE,iBAAiB,UAAU;AACvC,GAAI;AACH,QAAM,eAAe,SAAU,eAAgB;AAC/C,SACC;AAAA,IAAC;AAAA;AAAA,MACA,MAAK;AAAA,MACL,SAAU,CAAE,UAAW,MAAM,eAAe;AAAA,MAC1C,OAAG,mCAAc;AAAA,MAEjB;AAAA,wBACD;AAAA,UAAC;AAAA;AAAA,YACA,WAAY,qDAAsD,eAAgB;AAAA,YAClF,eAAW;AAAA,YAET;AAAA;AAAA,QACH;AAAA,QAEC,aACD;AAAA,UAAC;AAAA;AAAA,YACA,uBAAwB;AAAA,YACxB,SAAQ;AAAA,YACR,kBAAa,gBAAI,oBAAqB;AAAA,YACtC,iBAAc,gBAAI,eAAgB;AAAA,YAClC,OAAQ;AAAA,YACR,UAAW,CAAE,aACZ,cAAe,EAAE,OAAO,SAAS,CAAE;AAAA;AAAA,QAErC;AAAA;AAAA;AAAA,EAEF;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -154,7 +154,7 @@ function QueryTitleEdit(props) {
|
|
|
154
154
|
)
|
|
155
155
|
}
|
|
156
156
|
) }),
|
|
157
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TagName, { ...blockProps, children: showSearchTerm ? (0, import_i18n.__)("Search results for:
|
|
157
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TagName, { ...blockProps, children: showSearchTerm ? (0, import_i18n.__)("Search results for: “search term”") : (0, import_i18n.__)("Search results") })
|
|
158
158
|
] });
|
|
159
159
|
}
|
|
160
160
|
if (type === "post-type") {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/query-title/edit.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tBlockControls,\n\tInspectorControls,\n\tuseBlockProps,\n\tWarning,\n\tHeadingLevelDropdown,\n} from '@wordpress/block-editor';\nimport {\n\tToggleControl,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { __, _x, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useArchiveLabel } from './use-archive-label';\nimport { usePostTypeLabel } from './use-post-type-label';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\nimport useDeprecatedTextAlign from '../utils/deprecated-text-align-attributes';\n\nconst SUPPORTED_TYPES = [ 'archive', 'search', 'post-type' ];\n\nexport default function QueryTitleEdit( props ) {\n\tuseDeprecatedTextAlign( props );\n\n\tconst {\n\t\tattributes: { type, level, levelOptions, showPrefix, showSearchTerm },\n\t\tsetAttributes,\n\t\tcontext: { query },\n\t} = props;\n\n\tconst { archiveTypeLabel, archiveNameLabel } = useArchiveLabel();\n\tconst { postTypeLabel } = usePostTypeLabel( query?.postType );\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tconst TagName = level === 0 ? 'p' : `h${ level }`;\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: 'wp-block-query-title__placeholder',\n\t} );\n\n\tif ( ! SUPPORTED_TYPES.includes( type ) ) {\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<Warning>{ __( 'Provided type is not supported.' ) }</Warning>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tlet titleElement;\n\tif ( type === 'archive' ) {\n\t\tlet title;\n\t\tif ( archiveTypeLabel ) {\n\t\t\tif ( showPrefix ) {\n\t\t\t\tif ( archiveNameLabel ) {\n\t\t\t\t\ttitle = sprintf(\n\t\t\t\t\t\t/* translators: 1: Archive type title e.g: \"Category\", 2: Label of the archive e.g: \"Shoes\" */\n\t\t\t\t\t\t_x( '%1$s: %2$s', 'archive label' ),\n\t\t\t\t\t\tarchiveTypeLabel,\n\t\t\t\t\t\tarchiveNameLabel\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\ttitle = sprintf(\n\t\t\t\t\t\t/* translators: %s: Archive type title e.g: \"Category\", \"Tag\"... */\n\t\t\t\t\t\t__( '%s: Name' ),\n\t\t\t\t\t\tarchiveTypeLabel\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else if ( archiveNameLabel ) {\n\t\t\t\ttitle = archiveNameLabel;\n\t\t\t} else {\n\t\t\t\ttitle = sprintf(\n\t\t\t\t\t/* translators: %s: Archive type title e.g: \"Category\", \"Tag\"... */\n\t\t\t\t\t__( '%s name' ),\n\t\t\t\t\tarchiveTypeLabel\n\t\t\t\t);\n\t\t\t}\n\t\t} else {\n\t\t\ttitle = showPrefix\n\t\t\t\t? __( 'Archive type: Name' )\n\t\t\t\t: __( 'Archive title' );\n\t\t}\n\n\t\ttitleElement = (\n\t\t\t<>\n\t\t\t\t<InspectorControls>\n\t\t\t\t\t<ToolsPanel\n\t\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\t\tresetAll={ () =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tshowPrefix: true,\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () => ! showPrefix }\n\t\t\t\t\t\t\tlabel={ __( 'Show archive type in title' ) }\n\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { showPrefix: true } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Show archive type in title' ) }\n\t\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tshowPrefix: ! showPrefix,\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\tchecked={ showPrefix }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t</ToolsPanel>\n\t\t\t\t</InspectorControls>\n\t\t\t\t<TagName { ...blockProps }>{ title }</TagName>\n\t\t\t</>\n\t\t);\n\t}\n\n\tif ( type === 'search' ) {\n\t\ttitleElement = (\n\t\t\t<>\n\t\t\t\t<InspectorControls>\n\t\t\t\t\t<ToolsPanel\n\t\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\t\tresetAll={ () =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tshowSearchTerm: true,\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () => ! showSearchTerm }\n\t\t\t\t\t\t\tlabel={ __( 'Show search term in title' ) }\n\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { showSearchTerm: true } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Show search term in title' ) }\n\t\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tshowSearchTerm: ! showSearchTerm,\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\tchecked={ showSearchTerm }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t</ToolsPanel>\n\t\t\t\t</InspectorControls>\n\n\t\t\t\t<TagName { ...blockProps }>\n\t\t\t\t\t{ showSearchTerm\n\t\t\t\t\t\t? __( 'Search results for:
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,0BAMO;AACP,wBAIO;AACP,kBAAgC;AAKhC,+BAAgC;AAChC,iCAAiC;AACjC,mBAA+C;A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n * WordPress dependencies\n */\nimport {\n\tBlockControls,\n\tInspectorControls,\n\tuseBlockProps,\n\tWarning,\n\tHeadingLevelDropdown,\n} from '@wordpress/block-editor';\nimport {\n\tToggleControl,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { __, _x, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useArchiveLabel } from './use-archive-label';\nimport { usePostTypeLabel } from './use-post-type-label';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\nimport useDeprecatedTextAlign from '../utils/deprecated-text-align-attributes';\n\nconst SUPPORTED_TYPES = [ 'archive', 'search', 'post-type' ];\n\nexport default function QueryTitleEdit( props ) {\n\tuseDeprecatedTextAlign( props );\n\n\tconst {\n\t\tattributes: { type, level, levelOptions, showPrefix, showSearchTerm },\n\t\tsetAttributes,\n\t\tcontext: { query },\n\t} = props;\n\n\tconst { archiveTypeLabel, archiveNameLabel } = useArchiveLabel();\n\tconst { postTypeLabel } = usePostTypeLabel( query?.postType );\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tconst TagName = level === 0 ? 'p' : `h${ level }`;\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: 'wp-block-query-title__placeholder',\n\t} );\n\n\tif ( ! SUPPORTED_TYPES.includes( type ) ) {\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<Warning>{ __( 'Provided type is not supported.' ) }</Warning>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tlet titleElement;\n\tif ( type === 'archive' ) {\n\t\tlet title;\n\t\tif ( archiveTypeLabel ) {\n\t\t\tif ( showPrefix ) {\n\t\t\t\tif ( archiveNameLabel ) {\n\t\t\t\t\ttitle = sprintf(\n\t\t\t\t\t\t/* translators: 1: Archive type title e.g: \"Category\", 2: Label of the archive e.g: \"Shoes\" */\n\t\t\t\t\t\t_x( '%1$s: %2$s', 'archive label' ),\n\t\t\t\t\t\tarchiveTypeLabel,\n\t\t\t\t\t\tarchiveNameLabel\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\ttitle = sprintf(\n\t\t\t\t\t\t/* translators: %s: Archive type title e.g: \"Category\", \"Tag\"... */\n\t\t\t\t\t\t__( '%s: Name' ),\n\t\t\t\t\t\tarchiveTypeLabel\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else if ( archiveNameLabel ) {\n\t\t\t\ttitle = archiveNameLabel;\n\t\t\t} else {\n\t\t\t\ttitle = sprintf(\n\t\t\t\t\t/* translators: %s: Archive type title e.g: \"Category\", \"Tag\"... */\n\t\t\t\t\t__( '%s name' ),\n\t\t\t\t\tarchiveTypeLabel\n\t\t\t\t);\n\t\t\t}\n\t\t} else {\n\t\t\ttitle = showPrefix\n\t\t\t\t? __( 'Archive type: Name' )\n\t\t\t\t: __( 'Archive title' );\n\t\t}\n\n\t\ttitleElement = (\n\t\t\t<>\n\t\t\t\t<InspectorControls>\n\t\t\t\t\t<ToolsPanel\n\t\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\t\tresetAll={ () =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tshowPrefix: true,\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () => ! showPrefix }\n\t\t\t\t\t\t\tlabel={ __( 'Show archive type in title' ) }\n\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { showPrefix: true } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Show archive type in title' ) }\n\t\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tshowPrefix: ! showPrefix,\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\tchecked={ showPrefix }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t</ToolsPanel>\n\t\t\t\t</InspectorControls>\n\t\t\t\t<TagName { ...blockProps }>{ title }</TagName>\n\t\t\t</>\n\t\t);\n\t}\n\n\tif ( type === 'search' ) {\n\t\ttitleElement = (\n\t\t\t<>\n\t\t\t\t<InspectorControls>\n\t\t\t\t\t<ToolsPanel\n\t\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\t\tresetAll={ () =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tshowSearchTerm: true,\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () => ! showSearchTerm }\n\t\t\t\t\t\t\tlabel={ __( 'Show search term in title' ) }\n\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { showSearchTerm: true } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Show search term in title' ) }\n\t\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tshowSearchTerm: ! showSearchTerm,\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\tchecked={ showSearchTerm }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t</ToolsPanel>\n\t\t\t\t</InspectorControls>\n\n\t\t\t\t<TagName { ...blockProps }>\n\t\t\t\t\t{ showSearchTerm\n\t\t\t\t\t\t? __( 'Search results for: “search term”' )\n\t\t\t\t\t\t: __( 'Search results' ) }\n\t\t\t\t</TagName>\n\t\t\t</>\n\t\t);\n\t}\n\n\tif ( type === 'post-type' ) {\n\t\tlet title;\n\t\tif ( postTypeLabel ) {\n\t\t\tif ( showPrefix ) {\n\t\t\t\ttitle = sprintf(\n\t\t\t\t\t/* translators: %s: Singular post type name of the queried object */\n\t\t\t\t\t__( 'Post Type: \"%s\"' ),\n\t\t\t\t\tpostTypeLabel\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\ttitle = postTypeLabel;\n\t\t\t}\n\t\t} else {\n\t\t\ttitle = showPrefix ? __( 'Post Type: Name' ) : __( 'Name' );\n\t\t}\n\n\t\ttitleElement = (\n\t\t\t<>\n\t\t\t\t<InspectorControls>\n\t\t\t\t\t<ToolsPanel\n\t\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\t\tresetAll={ () =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tshowPrefix: true,\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () => ! showPrefix }\n\t\t\t\t\t\t\tlabel={ __( 'Show post type label' ) }\n\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { showPrefix: true } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Show post type label' ) }\n\t\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tshowPrefix: ! showPrefix,\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\tchecked={ showPrefix }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t</ToolsPanel>\n\t\t\t\t</InspectorControls>\n\t\t\t\t<TagName { ...blockProps }>{ title }</TagName>\n\t\t\t</>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t<HeadingLevelDropdown\n\t\t\t\t\tvalue={ level }\n\t\t\t\t\toptions={ levelOptions }\n\t\t\t\t\tonChange={ ( newLevel ) =>\n\t\t\t\t\t\tsetAttributes( { level: newLevel } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t\t{ titleElement }\n\t\t</>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,0BAMO;AACP,wBAIO;AACP,kBAAgC;AAKhC,+BAAgC;AAChC,iCAAiC;AACjC,mBAA+C;AAC/C,8CAAmC;AA0B/B;AAxBJ,IAAM,kBAAkB,CAAE,WAAW,UAAU,WAAY;AAE5C,SAAR,eAAiC,OAAQ;AAC/C,8CAAAA,SAAwB,KAAM;AAE9B,QAAM;AAAA,IACL,YAAY,EAAE,MAAM,OAAO,cAAc,YAAY,eAAe;AAAA,IACpE;AAAA,IACA,SAAS,EAAE,MAAM;AAAA,EAClB,IAAI;AAEJ,QAAM,EAAE,kBAAkB,iBAAiB,QAAI,0CAAgB;AAC/D,QAAM,EAAE,cAAc,QAAI,6CAAkB,OAAO,QAAS;AAC5D,QAAM,wBAAoB,6CAA+B;AAEzD,QAAM,UAAU,UAAU,IAAI,MAAM,IAAK,KAAM;AAE/C,QAAM,iBAAa,mCAAe;AAAA,IACjC,WAAW;AAAA,EACZ,CAAE;AAEF,MAAK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;AAAA,YAAA;AAAA,cACA,UAAW,MAAM,CAAE;AAAA,cACnB,WAAQ,gBAAI,sBAAuB;AAAA,cACnC,YAAa,MACZ,cAAe,EAAE,YAAY,KAAK,CAAE;AAAA,cAErC,kBAAgB;AAAA,cAEhB;AAAA,gBAAC;AAAA;AAAA,kBACA,WAAQ,gBAAI,sBAAuB;AAAA,kBACnC,UAAW,MACV,cAAe;AAAA,oBACd,YAAY,CAAE;AAAA,kBACf,CAAE;AAAA,kBAEH,SAAU;AAAA;AAAA,cACX;AAAA;AAAA,UACD;AAAA;AAAA,MACD,GACD;AAAA,MACA,4CAAC,WAAU,GAAG,YAAe,iBAAO;AAAA,OACrC;AAAA,EAEF;AAEA,SACC,4EACC;AAAA,gDAAC,qCAAc,OAAM,SACpB;AAAA,MAAC;AAAA;AAAA,QACA,OAAQ;AAAA,QACR,SAAU;AAAA,QACV,UAAW,CAAE,aACZ,cAAe,EAAE,OAAO,SAAS,CAAE;AAAA;AAAA,IAErC,GACD;AAAA,IACE;AAAA,KACH;AAEF;",
|
|
6
6
|
"names": ["useDeprecatedTextAlign", "ToolsPanel", "ToolsPanelItem"]
|
|
7
7
|
}
|
|
@@ -72,7 +72,7 @@ function QueryTotalEdit({ attributes, setAttributes }) {
|
|
|
72
72
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: (0, import_i18n.__)("12 results found") });
|
|
73
73
|
}
|
|
74
74
|
if (displayType === "range-display") {
|
|
75
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: (0, import_i18n.__)("Displaying 1
|
|
75
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: (0, import_i18n.__)("Displaying 1 – 10 of 12") });
|
|
76
76
|
}
|
|
77
77
|
return null;
|
|
78
78
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/query-total/edit.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useBlockProps, BlockControls } from '@wordpress/block-editor';\nimport { ToolbarGroup, ToolbarDropdownMenu } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { resultsFound, displayingResults } from './icons';\n\nexport default function QueryTotalEdit( { attributes, setAttributes } ) {\n\tconst { displayType } = attributes;\n\n\t// Block properties and classes.\n\tconst blockProps = useBlockProps();\n\n\tconst getButtonPositionIcon = () => {\n\t\tswitch ( displayType ) {\n\t\t\tcase 'total-results':\n\t\t\t\treturn resultsFound;\n\t\t\tcase 'range-display':\n\t\t\t\treturn displayingResults;\n\t\t}\n\t};\n\n\tconst buttonPositionControls = [\n\t\t{\n\t\t\trole: 'menuitemradio',\n\t\t\ttitle: __( 'Total results' ),\n\t\t\tisActive: displayType === 'total-results',\n\t\t\ticon: resultsFound,\n\t\t\tonClick: () => {\n\t\t\t\tsetAttributes( { displayType: 'total-results' } );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\trole: 'menuitemradio',\n\t\t\ttitle: __( 'Range display' ),\n\t\t\tisActive: displayType === 'range-display',\n\t\t\ticon: displayingResults,\n\t\t\tonClick: () => {\n\t\t\t\tsetAttributes( { displayType: 'range-display' } );\n\t\t\t},\n\t\t},\n\t];\n\n\t// Controls for the block.\n\tconst controls = (\n\t\t<BlockControls>\n\t\t\t<ToolbarGroup>\n\t\t\t\t<ToolbarDropdownMenu\n\t\t\t\t\ticon={ getButtonPositionIcon() }\n\t\t\t\t\tlabel={ __( 'Change display type' ) }\n\t\t\t\t\tcontrols={ buttonPositionControls }\n\t\t\t\t/>\n\t\t\t</ToolbarGroup>\n\t\t</BlockControls>\n\t);\n\n\t// Render output based on the selected display type.\n\tconst renderDisplay = () => {\n\t\tif ( displayType === 'total-results' ) {\n\t\t\treturn <>{ __( '12 results found' ) }</>;\n\t\t}\n\n\t\tif ( displayType === 'range-display' ) {\n\t\t\treturn <>{ __( 'Displaying 1
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,0BAA6C;AAC7C,wBAAkD;AAClD,kBAAmB;AAKnB,mBAAgD;AA0C5C;AAxCW,SAAR,eAAiC,EAAE,YAAY,cAAc,GAAI;AACvE,QAAM,EAAE,YAAY,IAAI;AAGxB,QAAM,iBAAa,mCAAc;AAEjC,QAAM,wBAAwB,MAAM;AACnC,YAAS,aAAc;AAAA,MACtB,KAAK;AACJ,eAAO;AAAA,MACR,KAAK;AACJ,eAAO;AAAA,IACT;AAAA,EACD;AAEA,QAAM,yBAAyB;AAAA,IAC9B;AAAA,MACC,MAAM;AAAA,MACN,WAAO,gBAAI,eAAgB;AAAA,MAC3B,UAAU,gBAAgB;AAAA,MAC1B,MAAM;AAAA,MACN,SAAS,MAAM;AACd,sBAAe,EAAE,aAAa,gBAAgB,CAAE;AAAA,MACjD;AAAA,IACD;AAAA,IACA;AAAA,MACC,MAAM;AAAA,MACN,WAAO,gBAAI,eAAgB;AAAA,MAC3B,UAAU,gBAAgB;AAAA,MAC1B,MAAM;AAAA,MACN,SAAS,MAAM;AACd,sBAAe,EAAE,aAAa,gBAAgB,CAAE;AAAA,MACjD;AAAA,IACD;AAAA,EACD;AAGA,QAAM,WACL,4CAAC,qCACA,sDAAC,kCACA;AAAA,IAAC;AAAA;AAAA,MACA,MAAO,sBAAsB;AAAA,MAC7B,WAAQ,gBAAI,qBAAsB;AAAA,MAClC,UAAW;AAAA;AAAA,EACZ,GACD,GACD;AAID,QAAM,gBAAgB,MAAM;AAC3B,QAAK,gBAAgB,iBAAkB;AACtC,aAAO,2EAAI,8BAAI,kBAAmB,GAAG;AAAA,IACtC;AAEA,QAAK,gBAAgB,iBAAkB;AACtC,aAAO,2EAAI,8BAAI,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useBlockProps, BlockControls } from '@wordpress/block-editor';\nimport { ToolbarGroup, ToolbarDropdownMenu } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { resultsFound, displayingResults } from './icons';\n\nexport default function QueryTotalEdit( { attributes, setAttributes } ) {\n\tconst { displayType } = attributes;\n\n\t// Block properties and classes.\n\tconst blockProps = useBlockProps();\n\n\tconst getButtonPositionIcon = () => {\n\t\tswitch ( displayType ) {\n\t\t\tcase 'total-results':\n\t\t\t\treturn resultsFound;\n\t\t\tcase 'range-display':\n\t\t\t\treturn displayingResults;\n\t\t}\n\t};\n\n\tconst buttonPositionControls = [\n\t\t{\n\t\t\trole: 'menuitemradio',\n\t\t\ttitle: __( 'Total results' ),\n\t\t\tisActive: displayType === 'total-results',\n\t\t\ticon: resultsFound,\n\t\t\tonClick: () => {\n\t\t\t\tsetAttributes( { displayType: 'total-results' } );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\trole: 'menuitemradio',\n\t\t\ttitle: __( 'Range display' ),\n\t\t\tisActive: displayType === 'range-display',\n\t\t\ticon: displayingResults,\n\t\t\tonClick: () => {\n\t\t\t\tsetAttributes( { displayType: 'range-display' } );\n\t\t\t},\n\t\t},\n\t];\n\n\t// Controls for the block.\n\tconst controls = (\n\t\t<BlockControls>\n\t\t\t<ToolbarGroup>\n\t\t\t\t<ToolbarDropdownMenu\n\t\t\t\t\ticon={ getButtonPositionIcon() }\n\t\t\t\t\tlabel={ __( 'Change display type' ) }\n\t\t\t\t\tcontrols={ buttonPositionControls }\n\t\t\t\t/>\n\t\t\t</ToolbarGroup>\n\t\t</BlockControls>\n\t);\n\n\t// Render output based on the selected display type.\n\tconst renderDisplay = () => {\n\t\tif ( displayType === 'total-results' ) {\n\t\t\treturn <>{ __( '12 results found' ) }</>;\n\t\t}\n\n\t\tif ( displayType === 'range-display' ) {\n\t\t\treturn <>{ __( 'Displaying 1 – 10 of 12' ) }</>;\n\t\t}\n\n\t\treturn null;\n\t};\n\n\treturn (\n\t\t<div {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AA,EACR;AAEA,SACC,6CAAC,SAAM,GAAG,YACP;AAAA;AAAA,IACA,cAAc;AAAA,KACjB;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/build/quote/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/quote/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { quote as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\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\tcitation: __( 'Julio
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,+BAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AACnB,mBAA8B;AAK9B,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,cAAU,gBAAI,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { quote as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\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\tcitation: __( 'Julio Cortázar' ),\n\t\t},\n\t\tinnerBlocks: [\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcontent: __( 'In quoting others, we cite ourselves.' ),\n\t\t\t\t},\n\t\t\t},\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;AAGA,kBAAmB;AACnB,mBAA8B;AAK9B,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,cAAU,gBAAI,gBAAiB;AAAA,IAChC;AAAA,IACA,aAAa;AAAA,MACZ;AAAA,QACC,MAAM;AAAA,QACN,YAAY;AAAA,UACX,aAAS,gBAAI,uCAAwC;AAAA,QACtD;AAAA,MACD;AAAA,IACD;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
6
|
"names": ["metadata", "icon", "transforms", "edit", "save", "deprecated", "initBlock", "metadata"]
|
|
7
7
|
}
|
package/build/read-more/edit.cjs
CHANGED
|
@@ -69,7 +69,7 @@ function ReadMore({
|
|
|
69
69
|
{
|
|
70
70
|
identifier: "content",
|
|
71
71
|
tagName: "a",
|
|
72
|
-
"aria-label": (0, import_i18n.__)("
|
|
72
|
+
"aria-label": (0, import_i18n.__)("“Read more” link text"),
|
|
73
73
|
placeholder: (0, import_i18n.__)("Read more"),
|
|
74
74
|
value: content,
|
|
75
75
|
onChange: (newValue) => setAttributes({ content: newValue }),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/read-more/edit.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tInspectorControls,\n\tRichText,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport {\n\tToggleControl,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { createBlock, getDefaultBlockName } from '@wordpress/blocks';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\nexport default function ReadMore( {\n\tattributes: { content, linkTarget },\n\tsetAttributes,\n\tinsertBlocksAfter,\n} ) {\n\tconst blockProps = useBlockProps();\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={ () => setAttributes( { linkTarget: '_self' } ) }\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={ __( 'Open in new tab' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => linkTarget !== '_self' }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { linkTarget: '_self' } )\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={ __( 'Open in new tab' ) }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tlinkTarget: value ? '_blank' : '_self',\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tchecked={ linkTarget === '_blank' }\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<RichText\n\t\t\t\tidentifier=\"content\"\n\t\t\t\ttagName=\"a\"\n\t\t\t\taria-label={ __( '
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,0BAIO;AACP,wBAIO;AACP,oBAAiD;AACjD,kBAAmB;AAKnB,mBAA+C;AAW7C;AATa,SAAR,SAA2B;AAAA,EACjC,YAAY,EAAE,SAAS,WAAW;AAAA,EAClC;AAAA,EACA;AACD,GAAI;AACH,QAAM,iBAAa,mCAAc;AACjC,QAAM,wBAAoB,6CAA+B;AAEzD,SACC,4EACC;AAAA,gDAAC,yCACA;AAAA,MAAC,kBAAAA;AAAA,MAAA;AAAA,QACA,WAAQ,gBAAI,UAAW;AAAA,QACvB,UAAW,MAAM,cAAe,EAAE,YAAY,QAAQ,CAAE;AAAA,QACxD;AAAA,QAEA;AAAA,UAAC,kBAAAC;AAAA,UAAA;AAAA,YACA,WAAQ,gBAAI,iBAAkB;AAAA,YAC9B,kBAAgB;AAAA,YAChB,UAAW,MAAM,eAAe;AAAA,YAChC,YAAa,MACZ,cAAe,EAAE,YAAY,QAAQ,CAAE;AAAA,YAGxC;AAAA,cAAC;AAAA;AAAA,gBACA,WAAQ,gBAAI,iBAAkB;AAAA,gBAC9B,UAAW,CAAE,UACZ,cAAe;AAAA,kBACd,YAAY,QAAQ,WAAW;AAAA,gBAChC,CAAE;AAAA,gBAEH,SAAU,eAAe;AAAA;AAAA,YAC1B;AAAA;AAAA,QACD;AAAA;AAAA,IACD,GACD;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACA,YAAW;AAAA,QACX,SAAQ;AAAA,QACR,kBAAa,gBAAI,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tInspectorControls,\n\tRichText,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport {\n\tToggleControl,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { createBlock, getDefaultBlockName } from '@wordpress/blocks';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\nexport default function ReadMore( {\n\tattributes: { content, linkTarget },\n\tsetAttributes,\n\tinsertBlocksAfter,\n} ) {\n\tconst blockProps = useBlockProps();\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={ () => setAttributes( { linkTarget: '_self' } ) }\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={ __( 'Open in new tab' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => linkTarget !== '_self' }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { linkTarget: '_self' } )\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={ __( 'Open in new tab' ) }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tlinkTarget: value ? '_blank' : '_self',\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tchecked={ linkTarget === '_blank' }\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<RichText\n\t\t\t\tidentifier=\"content\"\n\t\t\t\ttagName=\"a\"\n\t\t\t\taria-label={ __( '“Read more” link text' ) }\n\t\t\t\tplaceholder={ __( 'Read more' ) }\n\t\t\t\tvalue={ content }\n\t\t\t\tonChange={ ( newValue ) =>\n\t\t\t\t\tsetAttributes( { content: newValue } )\n\t\t\t\t}\n\t\t\t\t__unstableOnSplitAtEnd={ () =>\n\t\t\t\t\tinsertBlocksAfter( createBlock( getDefaultBlockName() ) )\n\t\t\t\t}\n\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t{ ...blockProps }\n\t\t\t/>\n\t\t</>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,0BAIO;AACP,wBAIO;AACP,oBAAiD;AACjD,kBAAmB;AAKnB,mBAA+C;AAW7C;AATa,SAAR,SAA2B;AAAA,EACjC,YAAY,EAAE,SAAS,WAAW;AAAA,EAClC;AAAA,EACA;AACD,GAAI;AACH,QAAM,iBAAa,mCAAc;AACjC,QAAM,wBAAoB,6CAA+B;AAEzD,SACC,4EACC;AAAA,gDAAC,yCACA;AAAA,MAAC,kBAAAA;AAAA,MAAA;AAAA,QACA,WAAQ,gBAAI,UAAW;AAAA,QACvB,UAAW,MAAM,cAAe,EAAE,YAAY,QAAQ,CAAE;AAAA,QACxD;AAAA,QAEA;AAAA,UAAC,kBAAAC;AAAA,UAAA;AAAA,YACA,WAAQ,gBAAI,iBAAkB;AAAA,YAC9B,kBAAgB;AAAA,YAChB,UAAW,MAAM,eAAe;AAAA,YAChC,YAAa,MACZ,cAAe,EAAE,YAAY,QAAQ,CAAE;AAAA,YAGxC;AAAA,cAAC;AAAA;AAAA,gBACA,WAAQ,gBAAI,iBAAkB;AAAA,gBAC9B,UAAW,CAAE,UACZ,cAAe;AAAA,kBACd,YAAY,QAAQ,WAAW;AAAA,gBAChC,CAAE;AAAA,gBAEH,SAAU,eAAe;AAAA;AAAA,YAC1B;AAAA;AAAA,QACD;AAAA;AAAA,IACD,GACD;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACA,YAAW;AAAA,QACX,SAAQ;AAAA,QACR,kBAAa,gBAAI,uBAAwB;AAAA,QACzC,iBAAc,gBAAI,WAAY;AAAA,QAC9B,OAAQ;AAAA,QACR,UAAW,CAAE,aACZ,cAAe,EAAE,SAAS,SAAS,CAAE;AAAA,QAEtC,wBAAyB,MACxB,sBAAmB,+BAAa,mCAAoB,CAAE,CAAE;AAAA,QAEzD,8BAA4B;AAAA,QAC1B,GAAG;AAAA;AAAA,IACN;AAAA,KACD;AAEF;",
|
|
6
6
|
"names": ["ToolsPanel", "ToolsPanelItem"]
|
|
7
7
|
}
|
package/build/rss/edit.cjs
CHANGED
|
@@ -104,7 +104,7 @@ function RSSEdit({ attributes, setAttributes, name }) {
|
|
|
104
104
|
label,
|
|
105
105
|
type: "url",
|
|
106
106
|
hideLabelFromVision: true,
|
|
107
|
-
placeholder: (0, import_i18n.__)("Enter URL here
|
|
107
|
+
placeholder: (0, import_i18n.__)("Enter URL here…"),
|
|
108
108
|
value: feedURL,
|
|
109
109
|
onChange: (value) => setAttributes({ feedURL: value }),
|
|
110
110
|
className: "wp-block-rss__placeholder-input"
|