@wordpress/block-library 9.48.1 → 10.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/build/audio/edit.cjs +8 -1
- package/build/audio/edit.cjs.map +2 -2
- package/build/breadcrumbs/edit.cjs +1 -2
- package/build/breadcrumbs/edit.cjs.map +2 -2
- package/build/button/edit.cjs +1 -2
- 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/embed-video-url-input.cjs +0 -1
- package/build/cover/edit/embed-video-url-input.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 -2
- 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/{freeform/convert-to-blocks-button.cjs → file/variations.cjs} +16 -18
- 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/edit.cjs +0 -2
- package/build/form/edit.cjs.map +2 -2
- package/build/form-input/edit.cjs +1 -3
- package/build/form-input/edit.cjs.map +2 -2
- package/build/freeform/edit.cjs +6 -15
- package/build/freeform/edit.cjs.map +3 -3
- package/build/freeform/migration-notice.cjs.map +2 -2
- package/build/gallery/edit.cjs +2 -2
- package/build/gallery/edit.cjs.map +2 -2
- package/build/home-link/edit.cjs +1 -2
- 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 +9 -6
- package/build/html/modal.cjs.map +2 -2
- package/build/icon/block.json +12 -0
- package/build/icon/edit.cjs +90 -41
- 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 -29
- 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/image/use-open-image-media-editor-modal.cjs +5 -25
- package/build/image/use-open-image-media-editor-modal.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/list/ordered-list-settings.cjs +0 -1
- package/build/list/ordered-list-settings.cjs.map +2 -2
- 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 +19 -13
- package/build/navigation/edit/index.cjs.map +2 -2
- package/build/navigation/edit/navigation-menu-name-control.cjs +0 -1
- package/build/navigation/edit/navigation-menu-name-control.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/block.json +1 -1
- package/build/navigation-link/edit.cjs +1 -1
- package/build/navigation-link/edit.cjs.map +2 -2
- package/build/navigation-link/link-ui/page-creator.cjs +0 -1
- package/build/navigation-link/link-ui/page-creator.cjs.map +2 -2
- package/build/navigation-link/shared/controls.cjs +0 -2
- package/build/navigation-link/shared/controls.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/playlist-track/edit.cjs +0 -3
- package/build/playlist-track/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-comment/edit.cjs +0 -1
- package/build/post-comment/edit.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 -18
- 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-terms/edit.cjs +0 -1
- package/build/post-terms/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/post-title/edit.cjs +0 -1
- package/build/post-title/edit.cjs.map +2 -2
- 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/enhanced-pagination-modal.cjs +10 -1
- package/build/query/edit/enhanced-pagination-modal.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/index.cjs +0 -1
- package/build/query/edit/inspector-controls/index.cjs.map +2 -2
- 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 -2
- package/build/rss/edit.cjs.map +2 -2
- package/build/search/block.json +4 -0
- package/build/search/edit.cjs +244 -206
- 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-logo/edit.cjs +2 -1
- package/build/site-logo/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/social-link/edit.cjs +0 -3
- package/build/social-link/edit.cjs.map +2 -2
- package/build/tab-list/block.json +33 -20
- package/build/tab-list/edit.cjs +122 -12
- package/build/tab-list/edit.cjs.map +3 -3
- package/build/tab-list/init.cjs +28 -0
- package/build/tab-list/init.cjs.map +7 -0
- 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/edit.cjs +0 -9
- package/build/tab-panel/edit.cjs.map +2 -2
- 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-panel/save.cjs +2 -1
- package/build/tab-panel/save.cjs.map +2 -2
- package/build/tab-panels/block.json +2 -28
- package/build/tab-panels/init.cjs +28 -0
- package/build/tab-panels/init.cjs.map +7 -0
- package/build/table/edit.cjs +0 -2
- package/build/table/edit.cjs.map +2 -2
- 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 +22 -104
- package/build/tabs/view.cjs.map +2 -2
- package/build/template-part/edit/advanced-controls.cjs +0 -1
- package/build/template-part/edit/advanced-controls.cjs.map +2 -2
- package/build/template-part/edit/title-modal.cjs +1 -2
- package/build/template-part/edit/title-modal.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/video/edit.cjs +3 -2
- package/build/video/edit.cjs.map +2 -2
- package/build/video/tracks-editor.cjs +0 -2
- package/build/video/tracks-editor.cjs.map +2 -2
- package/build-module/audio/edit.mjs +8 -2
- package/build-module/audio/edit.mjs.map +2 -2
- package/build-module/breadcrumbs/edit.mjs +1 -2
- package/build-module/breadcrumbs/edit.mjs.map +2 -2
- package/build-module/button/edit.mjs +1 -2
- 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/embed-video-url-input.mjs +0 -1
- package/build-module/cover/edit/embed-video-url-input.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 -2
- 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/edit.mjs +0 -2
- package/build-module/form/edit.mjs.map +2 -2
- package/build-module/form-input/edit.mjs +1 -3
- package/build-module/form-input/edit.mjs.map +2 -2
- package/build-module/freeform/edit.mjs +6 -15
- package/build-module/freeform/edit.mjs.map +2 -2
- package/build-module/freeform/migration-notice.mjs.map +2 -2
- 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 -2
- 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 +9 -6
- package/build-module/html/modal.mjs.map +2 -2
- package/build-module/icon/block.json +12 -0
- package/build-module/icon/edit.mjs +94 -42
- 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 -29
- 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/image/use-open-image-media-editor-modal.mjs +5 -25
- package/build-module/image/use-open-image-media-editor-modal.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/list/ordered-list-settings.mjs +0 -1
- package/build-module/list/ordered-list-settings.mjs.map +2 -2
- 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 +19 -13
- package/build-module/navigation/edit/index.mjs.map +2 -2
- package/build-module/navigation/edit/navigation-menu-name-control.mjs +0 -1
- package/build-module/navigation/edit/navigation-menu-name-control.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/block.json +1 -1
- package/build-module/navigation-link/edit.mjs +1 -1
- package/build-module/navigation-link/edit.mjs.map +2 -2
- package/build-module/navigation-link/link-ui/page-creator.mjs +0 -1
- package/build-module/navigation-link/link-ui/page-creator.mjs.map +2 -2
- package/build-module/navigation-link/shared/controls.mjs +0 -2
- package/build-module/navigation-link/shared/controls.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/playlist-track/edit.mjs +0 -3
- package/build-module/playlist-track/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-comment/edit.mjs +0 -1
- package/build-module/post-comment/edit.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 -18
- 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-terms/edit.mjs +0 -1
- package/build-module/post-terms/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/post-title/edit.mjs +0 -1
- package/build-module/post-title/edit.mjs.map +2 -2
- 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/enhanced-pagination-modal.mjs +10 -1
- package/build-module/query/edit/enhanced-pagination-modal.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/index.mjs +0 -1
- package/build-module/query/edit/inspector-controls/index.mjs.map +2 -2
- package/build-module/query/edit/inspector-controls/order-control.mjs +2 -2
- package/build-module/query/edit/inspector-controls/order-control.mjs.map +2 -2
- package/build-module/query/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 -2
- package/build-module/rss/edit.mjs.map +2 -2
- package/build-module/search/block.json +4 -0
- package/build-module/search/edit.mjs +244 -206
- 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-logo/edit.mjs +2 -1
- package/build-module/site-logo/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/social-link/edit.mjs +0 -3
- package/build-module/social-link/edit.mjs.map +2 -2
- package/build-module/tab-list/block.json +33 -20
- package/build-module/tab-list/edit.mjs +128 -15
- package/build-module/tab-list/edit.mjs.map +2 -2
- package/build-module/tab-list/init.mjs +7 -0
- package/build-module/tab-list/init.mjs.map +7 -0
- 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/edit.mjs +1 -10
- package/build-module/tab-panel/edit.mjs.map +2 -2
- 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-panel/save.mjs +2 -1
- package/build-module/tab-panel/save.mjs.map +2 -2
- package/build-module/tab-panels/block.json +2 -28
- package/build-module/tab-panels/init.mjs +7 -0
- package/build-module/tab-panels/init.mjs.map +7 -0
- package/build-module/table/edit.mjs +0 -2
- package/build-module/table/edit.mjs.map +2 -2
- 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 +22 -104
- package/build-module/tabs/view.mjs.map +2 -2
- package/build-module/template-part/edit/advanced-controls.mjs +0 -1
- package/build-module/template-part/edit/advanced-controls.mjs.map +2 -2
- package/build-module/template-part/edit/title-modal.mjs +1 -2
- package/build-module/template-part/edit/title-modal.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-module/video/edit.mjs +3 -3
- package/build-module/video/edit.mjs.map +2 -2
- package/build-module/video/tracks-editor.mjs +0 -2
- package/build-module/video/tracks-editor.mjs.map +2 -2
- package/build-style/editor-rtl.css +0 -19
- package/build-style/editor.css +0 -19
- 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 → 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/audio/edit.js +5 -9
- package/src/avatar/index.php +2 -2
- package/src/block/index.php +2 -26
- package/src/breadcrumbs/edit.js +0 -1
- package/src/button/edit.js +0 -1
- 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/embed-video-url-input.js +0 -1
- package/src/cover/edit/index.js +86 -0
- package/src/cover/edit/inspector-controls.js +124 -54
- package/src/cover/test/edit.js +51 -2
- package/src/details/edit.js +0 -1
- package/src/editor.scss +0 -2
- 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/form/edit.js +0 -2
- package/src/form-input/edit.js +0 -2
- package/src/freeform/edit.js +6 -29
- package/src/freeform/migration-notice.js +2 -4
- package/src/gallery/edit.js +13 -13
- package/src/home-link/edit.js +0 -1
- package/src/html/modal.js +3 -0
- package/src/icon/README.md +3 -0
- package/src/icon/block.json +12 -0
- package/src/icon/edit.js +85 -37
- 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 -56
- package/src/image/index.php +0 -1
- package/src/image/test/use-open-image-media-editor-modal.js +20 -26
- package/src/image/transforms.js +34 -8
- package/src/image/use-open-image-media-editor-modal.js +24 -42
- package/src/index.js +4 -11
- package/src/list/ordered-list-settings.js +0 -1
- package/src/navigation/edit/index.js +25 -16
- package/src/navigation/edit/navigation-menu-name-control.js +0 -1
- package/src/navigation/index.php +58 -0
- package/src/navigation-link/README.md +1 -1
- package/src/navigation-link/block.json +1 -1
- package/src/navigation-link/link-ui/page-creator.js +0 -1
- package/src/navigation-link/shared/controls.js +0 -2
- package/src/navigation-link/test/__snapshots__/hooks.js.snap +5 -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/playlist-track/edit.js +0 -3
- package/src/post-comment/edit.js +0 -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 -22
- package/src/post-featured-image/index.php +24 -22
- package/src/post-terms/edit.js +0 -1
- package/src/post-title/edit.js +0 -1
- 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/query/edit/enhanced-pagination-modal.js +11 -1
- package/src/query/edit/inspector-controls/index.js +0 -1
- package/src/rss/edit.js +0 -1
- package/src/search/README.md +1 -0
- package/src/search/block.json +4 -0
- package/src/search/edit.js +106 -55
- package/src/search/index.php +25 -1
- package/src/site-logo/edit.js +3 -1
- package/src/social-link/edit.js +0 -3
- package/src/style.scss +1 -2
- package/src/tab-list/README.md +19 -17
- package/src/tab-list/block.json +33 -20
- package/src/tab-list/edit.js +153 -15
- package/src/tab-list/index.php +24 -33
- package/src/tab-list/init.js +6 -0
- package/src/tab-list/save.js +39 -4
- package/src/{tab → tab-list}/style.scss +2 -3
- 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/edit.js +1 -14
- package/src/tab-panel/index.php +2 -25
- package/src/tab-panel/remove-tab-toolbar-control.js +10 -14
- package/src/tab-panel/save.js +1 -0
- package/src/tab-panel/style.scss +0 -17
- package/src/tab-panels/README.md +0 -16
- package/src/tab-panels/block.json +2 -28
- package/src/tab-panels/init.js +6 -0
- package/src/table/edit.js +0 -2
- 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 +12 -32
- package/src/tabs/use-tab-list-items-sync.js +49 -0
- package/src/tabs/view.js +22 -110
- package/src/template-part/edit/advanced-controls.js +0 -1
- package/src/template-part/edit/title-modal.js +0 -1
- package/src/utils/style-state.js +151 -0
- package/src/utils/test/style-state.js +307 -0
- package/src/video/edit.js +9 -16
- package/src/video/tracks-editor.js +0 -2
- package/babel-plugin.cjs +0 -150
- package/build/freeform/convert-to-blocks-button.cjs.map +0 -7
- package/build/list-item/utils.cjs +0 -57
- package/build/list-item/utils.cjs.map +0 -7
- 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/freeform/convert-to-blocks-button.mjs +0 -19
- package/build-module/freeform/convert-to-blocks-button.mjs.map +0 -7
- package/build-module/list-item/utils.mjs +0 -32
- package/build-module/list-item/utils.mjs.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-list/editor-rtl.css +0 -6
- package/build-style/tab-list/editor.css +0 -6
- package/build-style/tab-panels/style-rtl.css +0 -4
- package/build-style/tab-panels/style.css +0 -4
- package/src/freeform/convert-to-blocks-button.js +0 -18
- package/src/list-item/utils.js +0 -34
- 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-list/editor.scss +0 -10
- package/src/tab-panels/style.scss +0 -4
- package/src/tabs/use-tab-list-sync.js +0 -237
package/src/video/edit.js
CHANGED
|
@@ -8,7 +8,6 @@ import clsx from 'clsx';
|
|
|
8
8
|
*/
|
|
9
9
|
import { isBlobURL } from '@wordpress/blob';
|
|
10
10
|
import {
|
|
11
|
-
Disabled,
|
|
12
11
|
Spinner,
|
|
13
12
|
Placeholder,
|
|
14
13
|
__experimentalToolsPanel as ToolsPanel,
|
|
@@ -235,21 +234,15 @@ function VideoEdit( {
|
|
|
235
234
|
</ToolsPanel>
|
|
236
235
|
</InspectorControls>
|
|
237
236
|
<figure { ...blockProps }>
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
src={ src || temporaryURL }
|
|
248
|
-
ref={ videoPlayer }
|
|
249
|
-
>
|
|
250
|
-
<Tracks tracks={ tracks } />
|
|
251
|
-
</video>
|
|
252
|
-
</Disabled>
|
|
237
|
+
<video
|
|
238
|
+
controls={ controls }
|
|
239
|
+
inert={ ! isSingleSelected ? 'true' : undefined }
|
|
240
|
+
poster={ poster }
|
|
241
|
+
src={ src || temporaryURL }
|
|
242
|
+
ref={ videoPlayer }
|
|
243
|
+
>
|
|
244
|
+
<Tracks tracks={ tracks } />
|
|
245
|
+
</video>
|
|
253
246
|
{ !! temporaryURL && <Spinner /> }
|
|
254
247
|
<Caption
|
|
255
248
|
attributes={ attributes }
|
|
@@ -120,7 +120,6 @@ function SingleTrackEditor( {
|
|
|
120
120
|
</span>
|
|
121
121
|
<Grid columns={ 2 } gap={ 4 }>
|
|
122
122
|
<TextControl
|
|
123
|
-
__next40pxDefaultSize
|
|
124
123
|
onChange={ ( newLabel ) =>
|
|
125
124
|
setTrackState( ( prevTrackState ) => ( {
|
|
126
125
|
...prevTrackState,
|
|
@@ -132,7 +131,6 @@ function SingleTrackEditor( {
|
|
|
132
131
|
help={ __( 'Title of track' ) }
|
|
133
132
|
/>
|
|
134
133
|
<TextControl
|
|
135
|
-
__next40pxDefaultSize
|
|
136
134
|
onChange={ ( newSrcLang ) =>
|
|
137
135
|
setTrackState( ( prevTrackState ) => ( {
|
|
138
136
|
...prevTrackState,
|
package/babel-plugin.cjs
DELETED
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
const fs = require( 'fs' );
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Creates a babel plugin that replaces experimental block imports with
|
|
8
|
-
* null variable declarations.
|
|
9
|
-
*
|
|
10
|
-
* For example:
|
|
11
|
-
* import * as experimentalBlock from "./experimental-block";
|
|
12
|
-
* On build becomes:
|
|
13
|
-
* const experimentalBlock = null;
|
|
14
|
-
*
|
|
15
|
-
* This ensures the dead code elimination removes the experimental blocks modules
|
|
16
|
-
* during the production build.
|
|
17
|
-
*
|
|
18
|
-
* For more context, see https://github.com/WordPress/gutenberg/pull/40655/
|
|
19
|
-
*
|
|
20
|
-
* @param {Function} shouldProcessImport Optional callback to decide whether a given import should be processed.
|
|
21
|
-
* @param {boolean} isGutenbergPlugin Whether to run the plugin.
|
|
22
|
-
*/
|
|
23
|
-
function createBabelPlugin( shouldProcessImport, isGutenbergPlugin ) {
|
|
24
|
-
if ( ! shouldProcessImport ) {
|
|
25
|
-
shouldProcessImport = isImportDeclarationAnExperimentalBlock;
|
|
26
|
-
}
|
|
27
|
-
if ( isGutenbergPlugin === undefined ) {
|
|
28
|
-
// process.env.npm_package_config_IS_GUTENBERG_PLUGIN is a string, not a boolean
|
|
29
|
-
isGutenbergPlugin =
|
|
30
|
-
String( process.env.npm_package_config_IS_GUTENBERG_PLUGIN ) ===
|
|
31
|
-
'true';
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* The babel plugin created by createBabelPlugin.
|
|
35
|
-
*
|
|
36
|
-
* @see createBabelPlugin.
|
|
37
|
-
* @param {import('@babel/core')} babel Current Babel object.
|
|
38
|
-
* @return {import('@babel/core').PluginObj} Babel plugin object.
|
|
39
|
-
*/
|
|
40
|
-
return function babelPlugin( { types: t } ) {
|
|
41
|
-
if ( isGutenbergPlugin ) {
|
|
42
|
-
return {};
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return {
|
|
46
|
-
visitor: {
|
|
47
|
-
ImportDeclaration( path ) {
|
|
48
|
-
// Only process the experimental blocks.
|
|
49
|
-
if ( ! shouldProcessImport( path ) ) {
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// Get the imported variable name.
|
|
54
|
-
const namespaceSpecifier = path.node.specifiers.find(
|
|
55
|
-
( specifier ) =>
|
|
56
|
-
specifier.type === 'ImportNamespaceSpecifier'
|
|
57
|
-
);
|
|
58
|
-
const { name } = namespaceSpecifier.local;
|
|
59
|
-
|
|
60
|
-
path.replaceWith(
|
|
61
|
-
t.variableDeclaration( 'const', [
|
|
62
|
-
t.variableDeclarator(
|
|
63
|
-
t.identifier( name ),
|
|
64
|
-
t.nullLiteral()
|
|
65
|
-
),
|
|
66
|
-
] )
|
|
67
|
-
);
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Tests whether an import declaration refers to an experimental block.
|
|
76
|
-
* In broad strokes, it's a block that says "__experimental" in its block.json file.
|
|
77
|
-
* For details, check the implementation.
|
|
78
|
-
*
|
|
79
|
-
* @param {Object} path Babel.js AST path representing the import declaration,
|
|
80
|
-
* @return {boolean | undefined} Whether the import represents an experimental block.
|
|
81
|
-
*/
|
|
82
|
-
function isImportDeclarationAnExperimentalBlock( path ) {
|
|
83
|
-
// Only look for wildcard imports like import * as a from "source":
|
|
84
|
-
const { node } = path;
|
|
85
|
-
const namespaceSpecifier = node.specifiers.find(
|
|
86
|
-
( specifier ) => specifier.type === 'ImportNamespaceSpecifier'
|
|
87
|
-
);
|
|
88
|
-
if ( ! namespaceSpecifier || ! namespaceSpecifier.local ) {
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
// Only look for imports starting with ./ and without additional slashes in the path.
|
|
93
|
-
const importedPath = node.source.value;
|
|
94
|
-
if (
|
|
95
|
-
! importedPath ||
|
|
96
|
-
! importedPath.startsWith( './' ) ||
|
|
97
|
-
importedPath.split( '/' ).length > 2
|
|
98
|
-
) {
|
|
99
|
-
return false;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
// Check the imported directory has a related block.json file.
|
|
103
|
-
const blockJsonPath = __dirname + '/src/' + importedPath + '/block.json';
|
|
104
|
-
if ( ! fs.existsSync( blockJsonPath ) ) {
|
|
105
|
-
return false;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
// Read the block.json file related to this block
|
|
109
|
-
const { name } = namespaceSpecifier.local;
|
|
110
|
-
let blockJSONBuffer;
|
|
111
|
-
try {
|
|
112
|
-
blockJSONBuffer = fs.readFileSync( blockJsonPath );
|
|
113
|
-
} catch ( e ) {
|
|
114
|
-
process.stderr.write(
|
|
115
|
-
'Could not read block.json for the module "' +
|
|
116
|
-
importedPath +
|
|
117
|
-
'" imported under name "' +
|
|
118
|
-
name +
|
|
119
|
-
'" from path "' +
|
|
120
|
-
blockJsonPath +
|
|
121
|
-
'"'
|
|
122
|
-
);
|
|
123
|
-
throw e;
|
|
124
|
-
}
|
|
125
|
-
let blockJSON;
|
|
126
|
-
try {
|
|
127
|
-
blockJSON = JSON.parse( blockJSONBuffer );
|
|
128
|
-
} catch ( e ) {
|
|
129
|
-
process.stderr.write(
|
|
130
|
-
'Could not parse block.json for the module "' +
|
|
131
|
-
importedPath +
|
|
132
|
-
'" imported under name "' +
|
|
133
|
-
name +
|
|
134
|
-
'" read from path "' +
|
|
135
|
-
blockJsonPath +
|
|
136
|
-
'"'
|
|
137
|
-
);
|
|
138
|
-
throw e;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
return (
|
|
142
|
-
blockJSON &&
|
|
143
|
-
'__experimental' in blockJSON &&
|
|
144
|
-
blockJSON.__experimental !== false
|
|
145
|
-
);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
const babelPlugin = createBabelPlugin();
|
|
149
|
-
babelPlugin.createBabelPlugin = createBabelPlugin;
|
|
150
|
-
module.exports = babelPlugin;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/freeform/convert-to-blocks-button.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { ToolbarButton } from '@wordpress/components';\nimport { rawHandler } from '@wordpress/blocks';\n\nconst ConvertToBlocksButton = ( { content, onReplace } ) => {\n\treturn (\n\t\t<ToolbarButton\n\t\t\tonClick={ () => onReplace( rawHandler( { HTML: content } ) ) }\n\t\t>\n\t\t\t{ __( 'Convert to blocks' ) }\n\t\t</ToolbarButton>\n\t);\n};\n\nexport default ConvertToBlocksButton;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AACnB,wBAA8B;AAC9B,oBAA2B;AAIzB;AAFF,IAAM,wBAAwB,CAAE,EAAE,SAAS,UAAU,MAAO;AAC3D,SACC;AAAA,IAAC;AAAA;AAAA,MACA,SAAU,MAAM,cAAW,0BAAY,EAAE,MAAM,QAAQ,CAAE,CAAE;AAAA,MAEzD,8BAAI,mBAAoB;AAAA;AAAA,EAC3B;AAEF;AAEA,IAAO,mCAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// packages/block-library/src/list-item/utils.js
|
|
21
|
-
var utils_exports = {};
|
|
22
|
-
__export(utils_exports, {
|
|
23
|
-
convertToListItems: () => convertToListItems
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(utils_exports);
|
|
26
|
-
var import_blocks = require("@wordpress/blocks");
|
|
27
|
-
function convertBlockToList(block) {
|
|
28
|
-
const list = (0, import_blocks.switchToBlockType)(block, "core/list");
|
|
29
|
-
if (list) {
|
|
30
|
-
return list;
|
|
31
|
-
}
|
|
32
|
-
const paragraph = (0, import_blocks.switchToBlockType)(block, "core/paragraph");
|
|
33
|
-
if (!paragraph) {
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
|
-
return (0, import_blocks.switchToBlockType)(paragraph, "core/list");
|
|
37
|
-
}
|
|
38
|
-
function convertToListItems(blocks) {
|
|
39
|
-
const listItems = [];
|
|
40
|
-
for (let block of blocks) {
|
|
41
|
-
if (block.name === "core/list-item") {
|
|
42
|
-
listItems.push(block);
|
|
43
|
-
} else if (block.name === "core/list") {
|
|
44
|
-
listItems.push(...block.innerBlocks);
|
|
45
|
-
} else if (block = convertBlockToList(block)) {
|
|
46
|
-
for (const { innerBlocks } of block) {
|
|
47
|
-
listItems.push(...innerBlocks);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
return listItems;
|
|
52
|
-
}
|
|
53
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
54
|
-
0 && (module.exports = {
|
|
55
|
-
convertToListItems
|
|
56
|
-
});
|
|
57
|
-
//# sourceMappingURL=utils.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/list-item/utils.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { switchToBlockType } from '@wordpress/blocks';\n\nfunction convertBlockToList( block ) {\n\tconst list = switchToBlockType( block, 'core/list' );\n\tif ( list ) {\n\t\treturn list;\n\t}\n\tconst paragraph = switchToBlockType( block, 'core/paragraph' );\n\tif ( ! paragraph ) {\n\t\treturn null;\n\t}\n\treturn switchToBlockType( paragraph, 'core/list' );\n}\n\nexport function convertToListItems( blocks ) {\n\tconst listItems = [];\n\n\tfor ( let block of blocks ) {\n\t\tif ( block.name === 'core/list-item' ) {\n\t\t\tlistItems.push( block );\n\t\t} else if ( block.name === 'core/list' ) {\n\t\t\tlistItems.push( ...block.innerBlocks );\n\t\t} else if ( ( block = convertBlockToList( block ) ) ) {\n\t\t\tfor ( const { innerBlocks } of block ) {\n\t\t\t\tlistItems.push( ...innerBlocks );\n\t\t\t}\n\t\t}\n\t}\n\n\treturn listItems;\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAAkC;AAElC,SAAS,mBAAoB,OAAQ;AACpC,QAAM,WAAO,iCAAmB,OAAO,WAAY;AACnD,MAAK,MAAO;AACX,WAAO;AAAA,EACR;AACA,QAAM,gBAAY,iCAAmB,OAAO,gBAAiB;AAC7D,MAAK,CAAE,WAAY;AAClB,WAAO;AAAA,EACR;AACA,aAAO,iCAAmB,WAAW,WAAY;AAClD;AAEO,SAAS,mBAAoB,QAAS;AAC5C,QAAM,YAAY,CAAC;AAEnB,WAAU,SAAS,QAAS;AAC3B,QAAK,MAAM,SAAS,kBAAmB;AACtC,gBAAU,KAAM,KAAM;AAAA,IACvB,WAAY,MAAM,SAAS,aAAc;AACxC,gBAAU,KAAM,GAAG,MAAM,WAAY;AAAA,IACtC,WAAc,QAAQ,mBAAoB,KAAM,GAAM;AACrD,iBAAY,EAAE,YAAY,KAAK,OAAQ;AACtC,kBAAU,KAAM,GAAG,WAAY;AAAA,MAChC;AAAA,IACD;AAAA,EACD;AAEA,SAAO;AACR;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/build/tab/block.json
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://schemas.wp.org/trunk/block.json",
|
|
3
|
-
"__experimental": true,
|
|
4
|
-
"apiVersion": 3,
|
|
5
|
-
"name": "core/tab",
|
|
6
|
-
"title": "Tab",
|
|
7
|
-
"description": "A single tab button in the tab list.",
|
|
8
|
-
"category": "design",
|
|
9
|
-
"textdomain": "default",
|
|
10
|
-
"parent": [ "core/tab-list" ],
|
|
11
|
-
"usesContext": [
|
|
12
|
-
"core/tabs-list",
|
|
13
|
-
"core/tabs-activeTabIndex",
|
|
14
|
-
"core/tabs-editorActiveTabIndex",
|
|
15
|
-
"core/tab-index",
|
|
16
|
-
"core/tab-id",
|
|
17
|
-
"core/tab-label"
|
|
18
|
-
],
|
|
19
|
-
"supports": {
|
|
20
|
-
"html": false,
|
|
21
|
-
"reusable": false,
|
|
22
|
-
"visibility": false,
|
|
23
|
-
"lock": false,
|
|
24
|
-
"color": {
|
|
25
|
-
"background": true,
|
|
26
|
-
"text": true,
|
|
27
|
-
"__experimentalDefaultControls": {
|
|
28
|
-
"background": true,
|
|
29
|
-
"text": true
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
"typography": {
|
|
33
|
-
"fontSize": true,
|
|
34
|
-
"__experimentalFontFamily": true,
|
|
35
|
-
"textAlign": true,
|
|
36
|
-
"__experimentalDefaultControls": {
|
|
37
|
-
"fontSize": true
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
"spacing": {
|
|
41
|
-
"padding": true,
|
|
42
|
-
"__experimentalDefaultControls": {
|
|
43
|
-
"padding": true
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
"__experimentalBorder": {
|
|
47
|
-
"radius": true,
|
|
48
|
-
"color": true,
|
|
49
|
-
"width": true,
|
|
50
|
-
"style": true
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
"editorScript": "file:./index.js",
|
|
54
|
-
"editorStyle": "file:./editor.css",
|
|
55
|
-
"style": "file:./style-index.css"
|
|
56
|
-
}
|
package/build/tab/controls.cjs
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
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
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// packages/block-library/src/tab/controls.js
|
|
31
|
-
var controls_exports = {};
|
|
32
|
-
__export(controls_exports, {
|
|
33
|
-
default: () => Controls
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(controls_exports);
|
|
36
|
-
var import_block_editor = require("@wordpress/block-editor");
|
|
37
|
-
var import_add_tab_toolbar_control = __toESM(require("../tab-panel/add-tab-toolbar-control.cjs"));
|
|
38
|
-
var import_remove_tab_toolbar_control = __toESM(require("../tab-panel/remove-tab-toolbar-control.cjs"));
|
|
39
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
40
|
-
function Controls({ tabsClientId }) {
|
|
41
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_block_editor.BlockControls, { children: [
|
|
42
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_add_tab_toolbar_control.default, { tabsClientId }),
|
|
43
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_remove_tab_toolbar_control.default, { tabsClientId })
|
|
44
|
-
] });
|
|
45
|
-
}
|
|
46
|
-
//# sourceMappingURL=controls.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/tab/controls.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { BlockControls } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport AddTabToolbarControl from '../tab-panel/add-tab-toolbar-control';\nimport RemoveTabToolbarControl from '../tab-panel/remove-tab-toolbar-control';\n\nexport default function Controls( { tabsClientId } ) {\n\treturn (\n\t\t<BlockControls>\n\t\t\t<AddTabToolbarControl tabsClientId={ tabsClientId } />\n\t\t\t<RemoveTabToolbarControl tabsClientId={ tabsClientId } />\n\t\t</BlockControls>\n\t);\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,0BAA8B;AAK9B,qCAAiC;AACjC,wCAAoC;AAIlC;AAFa,SAAR,SAA2B,EAAE,aAAa,GAAI;AACpD,SACC,6CAAC,qCACA;AAAA,gDAAC,+BAAAA,SAAA,EAAqB,cAA8B;AAAA,IACpD,4CAAC,kCAAAC,SAAA,EAAwB,cAA8B;AAAA,KACxD;AAEF;",
|
|
6
|
-
"names": ["AddTabToolbarControl", "RemoveTabToolbarControl"]
|
|
7
|
-
}
|
package/build/tab/edit.cjs
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
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
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// packages/block-library/src/tab/edit.js
|
|
31
|
-
var edit_exports = {};
|
|
32
|
-
__export(edit_exports, {
|
|
33
|
-
default: () => edit_default
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(edit_exports);
|
|
36
|
-
var import_clsx = __toESM(require("clsx"));
|
|
37
|
-
var import_i18n = require("@wordpress/i18n");
|
|
38
|
-
var import_block_editor = require("@wordpress/block-editor");
|
|
39
|
-
var import_data = require("@wordpress/data");
|
|
40
|
-
var import_element = require("@wordpress/element");
|
|
41
|
-
var import_controls = __toESM(require("./controls.cjs"));
|
|
42
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
43
|
-
var EMPTY_ARRAY = [];
|
|
44
|
-
function Edit({ context, clientId }) {
|
|
45
|
-
const tabsList = context["core/tabs-list"] || EMPTY_ARRAY;
|
|
46
|
-
const activeTabIndex = context["core/tabs-activeTabIndex"];
|
|
47
|
-
const editorActiveTabIndex = context["core/tabs-editorActiveTabIndex"];
|
|
48
|
-
const effectiveActiveIndex = (0, import_element.useMemo)(() => {
|
|
49
|
-
return editorActiveTabIndex ?? activeTabIndex;
|
|
50
|
-
}, [editorActiveTabIndex, activeTabIndex]);
|
|
51
|
-
const { tabIndex, tabsClientId, selectedTabClientId } = (0, import_data.useSelect)(
|
|
52
|
-
(select) => {
|
|
53
|
-
const {
|
|
54
|
-
getBlockOrder,
|
|
55
|
-
getBlockRootClientId,
|
|
56
|
-
getSelectedBlockClientIds,
|
|
57
|
-
hasSelectedInnerBlock
|
|
58
|
-
} = select(import_block_editor.store);
|
|
59
|
-
const _tabsListClientId = getBlockRootClientId(clientId);
|
|
60
|
-
const _tabsClientId = _tabsListClientId ? getBlockRootClientId(_tabsListClientId) : null;
|
|
61
|
-
const siblings = getBlockOrder(_tabsListClientId);
|
|
62
|
-
const _tabIndex = siblings.indexOf(clientId);
|
|
63
|
-
const selectedIds = getSelectedBlockClientIds();
|
|
64
|
-
let _selectedTabClientId = null;
|
|
65
|
-
for (const tab2 of tabsList) {
|
|
66
|
-
if (selectedIds.includes(tab2.clientId) || hasSelectedInnerBlock(tab2.clientId, true)) {
|
|
67
|
-
_selectedTabClientId = tab2.clientId;
|
|
68
|
-
break;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
return {
|
|
72
|
-
tabIndex: _tabIndex,
|
|
73
|
-
tabsClientId: _tabsClientId,
|
|
74
|
-
selectedTabClientId: _selectedTabClientId
|
|
75
|
-
};
|
|
76
|
-
},
|
|
77
|
-
[clientId, tabsList]
|
|
78
|
-
);
|
|
79
|
-
const tab = tabsList[tabIndex] || {};
|
|
80
|
-
const tabListIndex = tab.index ?? tabIndex;
|
|
81
|
-
const tabClientId = tab.clientId || "";
|
|
82
|
-
const label = tab.label || "";
|
|
83
|
-
const isActive = tabListIndex === effectiveActiveIndex;
|
|
84
|
-
const isSelected = tabClientId === selectedTabClientId;
|
|
85
|
-
const { __unstableMarkNextChangeAsNotPersistent, updateBlockAttributes } = (0, import_data.useDispatch)(import_block_editor.store);
|
|
86
|
-
const handleTabClick = (0, import_element.useCallback)(
|
|
87
|
-
(event) => {
|
|
88
|
-
event.preventDefault();
|
|
89
|
-
if (tabsClientId && tabListIndex !== effectiveActiveIndex) {
|
|
90
|
-
__unstableMarkNextChangeAsNotPersistent();
|
|
91
|
-
updateBlockAttributes(tabsClientId, {
|
|
92
|
-
editorActiveTabIndex: tabListIndex
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
[
|
|
97
|
-
tabsClientId,
|
|
98
|
-
tabListIndex,
|
|
99
|
-
effectiveActiveIndex,
|
|
100
|
-
updateBlockAttributes,
|
|
101
|
-
__unstableMarkNextChangeAsNotPersistent
|
|
102
|
-
]
|
|
103
|
-
);
|
|
104
|
-
const handleLabelChange = (0, import_element.useCallback)(
|
|
105
|
-
(newLabel) => {
|
|
106
|
-
if (tabClientId) {
|
|
107
|
-
updateBlockAttributes(tabClientId, { label: newLabel });
|
|
108
|
-
}
|
|
109
|
-
},
|
|
110
|
-
[tabClientId, updateBlockAttributes]
|
|
111
|
-
);
|
|
112
|
-
const blockProps = (0, import_block_editor.useBlockProps)({
|
|
113
|
-
className: (0, import_clsx.default)({
|
|
114
|
-
"is-active": isActive,
|
|
115
|
-
"is-selected": isSelected
|
|
116
|
-
}),
|
|
117
|
-
tabIndex: -1,
|
|
118
|
-
onClick: handleTabClick
|
|
119
|
-
});
|
|
120
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
121
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_controls.default, { tabsClientId }),
|
|
122
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { ...blockProps, type: "button", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
123
|
-
import_block_editor.RichText,
|
|
124
|
-
{
|
|
125
|
-
tagName: "span",
|
|
126
|
-
withoutInteractiveFormatting: true,
|
|
127
|
-
placeholder: (0, import_i18n.__)("Tab title"),
|
|
128
|
-
value: label,
|
|
129
|
-
onChange: handleLabelChange
|
|
130
|
-
}
|
|
131
|
-
) })
|
|
132
|
-
] });
|
|
133
|
-
}
|
|
134
|
-
var edit_default = Edit;
|
|
135
|
-
//# sourceMappingURL=edit.cjs.map
|
package/build/tab/edit.cjs.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/tab/edit.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tuseBlockProps,\n\tstore as blockEditorStore,\n\tRichText,\n} from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useMemo, useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport Controls from './controls';\n\nconst EMPTY_ARRAY = [];\n\nfunction Edit( { context, clientId } ) {\n\tconst tabsList = context[ 'core/tabs-list' ] || EMPTY_ARRAY;\n\tconst activeTabIndex = context[ 'core/tabs-activeTabIndex' ];\n\tconst editorActiveTabIndex = context[ 'core/tabs-editorActiveTabIndex' ];\n\n\tconst effectiveActiveIndex = useMemo( () => {\n\t\treturn editorActiveTabIndex ?? activeTabIndex;\n\t}, [ editorActiveTabIndex, activeTabIndex ] );\n\n\tconst { tabIndex, tabsClientId, selectedTabClientId } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockOrder,\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\tgetSelectedBlockClientIds,\n\t\t\t\thasSelectedInnerBlock,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tconst _tabsListClientId = getBlockRootClientId( clientId );\n\t\t\tconst _tabsClientId = _tabsListClientId\n\t\t\t\t? getBlockRootClientId( _tabsListClientId )\n\t\t\t\t: null;\n\n\t\t\tconst siblings = getBlockOrder( _tabsListClientId );\n\t\t\tconst _tabIndex = siblings.indexOf( clientId );\n\n\t\t\t// Find which tab panel block is currently selected.\n\t\t\tconst selectedIds = getSelectedBlockClientIds();\n\t\t\tlet _selectedTabClientId = null;\n\t\t\tfor ( const tab of tabsList ) {\n\t\t\t\tif (\n\t\t\t\t\tselectedIds.includes( tab.clientId ) ||\n\t\t\t\t\thasSelectedInnerBlock( tab.clientId, true )\n\t\t\t\t) {\n\t\t\t\t\t_selectedTabClientId = tab.clientId;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\ttabIndex: _tabIndex,\n\t\t\t\ttabsClientId: _tabsClientId,\n\t\t\t\tselectedTabClientId: _selectedTabClientId,\n\t\t\t};\n\t\t},\n\t\t[ clientId, tabsList ]\n\t);\n\n\tconst tab = tabsList[ tabIndex ] || {};\n\n\t// tabListIndex is the tab's position in tabsList, used for active-state\n\t// checks and click handling.\n\tconst tabListIndex = tab.index ?? tabIndex;\n\n\tconst tabClientId = tab.clientId || '';\n\tconst label = tab.label || '';\n\n\tconst isActive = tabListIndex === effectiveActiveIndex;\n\tconst isSelected = tabClientId === selectedTabClientId;\n\n\tconst { __unstableMarkNextChangeAsNotPersistent, updateBlockAttributes } =\n\t\tuseDispatch( blockEditorStore );\n\n\tconst handleTabClick = useCallback(\n\t\t( event ) => {\n\t\t\tevent.preventDefault();\n\t\t\tif ( tabsClientId && tabListIndex !== effectiveActiveIndex ) {\n\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\tupdateBlockAttributes( tabsClientId, {\n\t\t\t\t\teditorActiveTabIndex: tabListIndex,\n\t\t\t\t} );\n\t\t\t}\n\t\t},\n\t\t[\n\t\t\ttabsClientId,\n\t\t\ttabListIndex,\n\t\t\teffectiveActiveIndex,\n\t\t\tupdateBlockAttributes,\n\t\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\t]\n\t);\n\n\tconst handleLabelChange = useCallback(\n\t\t( newLabel ) => {\n\t\t\tif ( tabClientId ) {\n\t\t\t\tupdateBlockAttributes( tabClientId, { label: newLabel } );\n\t\t\t}\n\t\t},\n\t\t[ tabClientId, updateBlockAttributes ]\n\t);\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( {\n\t\t\t'is-active': isActive,\n\t\t\t'is-selected': isSelected,\n\t\t} ),\n\t\ttabIndex: -1,\n\t\tonClick: handleTabClick,\n\t} );\n\n\treturn (\n\t\t<>\n\t\t\t<Controls tabsClientId={ tabsClientId } />\n\t\t\t<button { ...blockProps } type=\"button\">\n\t\t\t\t<RichText\n\t\t\t\t\ttagName=\"span\"\n\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\tplaceholder={ __( 'Tab title' ) }\n\t\t\t\t\tvalue={ label }\n\t\t\t\t\tonChange={ handleLabelChange }\n\t\t\t\t/>\n\t\t\t</button>\n\t\t</>\n\t);\n}\n\nexport default Edit;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,kBAAmB;AACnB,0BAIO;AACP,kBAAuC;AACvC,qBAAqC;AAKrC,sBAAqB;AAyGnB;AAvGF,IAAM,cAAc,CAAC;AAErB,SAAS,KAAM,EAAE,SAAS,SAAS,GAAI;AACtC,QAAM,WAAW,QAAS,gBAAiB,KAAK;AAChD,QAAM,iBAAiB,QAAS,0BAA2B;AAC3D,QAAM,uBAAuB,QAAS,gCAAiC;AAEvE,QAAM,2BAAuB,wBAAS,MAAM;AAC3C,WAAO,wBAAwB;AAAA,EAChC,GAAG,CAAE,sBAAsB,cAAe,CAAE;AAE5C,QAAM,EAAE,UAAU,cAAc,oBAAoB,QAAI;AAAA,IACvD,CAAE,WAAY;AACb,YAAM;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACD,IAAI,OAAQ,oBAAAA,KAAiB;AAE7B,YAAM,oBAAoB,qBAAsB,QAAS;AACzD,YAAM,gBAAgB,oBACnB,qBAAsB,iBAAkB,IACxC;AAEH,YAAM,WAAW,cAAe,iBAAkB;AAClD,YAAM,YAAY,SAAS,QAAS,QAAS;AAG7C,YAAM,cAAc,0BAA0B;AAC9C,UAAI,uBAAuB;AAC3B,iBAAYC,QAAO,UAAW;AAC7B,YACC,YAAY,SAAUA,KAAI,QAAS,KACnC,sBAAuBA,KAAI,UAAU,IAAK,GACzC;AACD,iCAAuBA,KAAI;AAC3B;AAAA,QACD;AAAA,MACD;AAEA,aAAO;AAAA,QACN,UAAU;AAAA,QACV,cAAc;AAAA,QACd,qBAAqB;AAAA,MACtB;AAAA,IACD;AAAA,IACA,CAAE,UAAU,QAAS;AAAA,EACtB;AAEA,QAAM,MAAM,SAAU,QAAS,KAAK,CAAC;AAIrC,QAAM,eAAe,IAAI,SAAS;AAElC,QAAM,cAAc,IAAI,YAAY;AACpC,QAAM,QAAQ,IAAI,SAAS;AAE3B,QAAM,WAAW,iBAAiB;AAClC,QAAM,aAAa,gBAAgB;AAEnC,QAAM,EAAE,yCAAyC,sBAAsB,QACtE,yBAAa,oBAAAD,KAAiB;AAE/B,QAAM,qBAAiB;AAAA,IACtB,CAAE,UAAW;AACZ,YAAM,eAAe;AACrB,UAAK,gBAAgB,iBAAiB,sBAAuB;AAC5D,gDAAwC;AACxC,8BAAuB,cAAc;AAAA,UACpC,sBAAsB;AAAA,QACvB,CAAE;AAAA,MACH;AAAA,IACD;AAAA,IACA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,EACD;AAEA,QAAM,wBAAoB;AAAA,IACzB,CAAE,aAAc;AACf,UAAK,aAAc;AAClB,8BAAuB,aAAa,EAAE,OAAO,SAAS,CAAE;AAAA,MACzD;AAAA,IACD;AAAA,IACA,CAAE,aAAa,qBAAsB;AAAA,EACtC;AAEA,QAAM,iBAAa,mCAAe;AAAA,IACjC,eAAW,YAAAE,SAAM;AAAA,MAChB,aAAa;AAAA,MACb,eAAe;AAAA,IAChB,CAAE;AAAA,IACF,UAAU;AAAA,IACV,SAAS;AAAA,EACV,CAAE;AAEF,SACC,4EACC;AAAA,gDAAC,gBAAAC,SAAA,EAAS,cAA8B;AAAA,IACxC,4CAAC,YAAS,GAAG,YAAa,MAAK,UAC9B;AAAA,MAAC;AAAA;AAAA,QACA,SAAQ;AAAA,QACR,8BAA4B;AAAA,QAC5B,iBAAc,gBAAI,WAAY;AAAA,QAC9B,OAAQ;AAAA,QACR,UAAW;AAAA;AAAA,IACZ,GACD;AAAA,KACD;AAEF;AAEA,IAAO,eAAQ;",
|
|
6
|
-
"names": ["blockEditorStore", "tab", "clsx", "Controls"]
|
|
7
|
-
}
|
package/build/tab/index.cjs
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name2 in all)
|
|
10
|
-
__defProp(target, name2, { get: all[name2], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
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
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// packages/block-library/src/tab/index.js
|
|
31
|
-
var tab_exports = {};
|
|
32
|
-
__export(tab_exports, {
|
|
33
|
-
init: () => init,
|
|
34
|
-
metadata: () => import_block.default,
|
|
35
|
-
name: () => name,
|
|
36
|
-
settings: () => settings
|
|
37
|
-
});
|
|
38
|
-
module.exports = __toCommonJS(tab_exports);
|
|
39
|
-
var import_icons = require("@wordpress/icons");
|
|
40
|
-
var import_init_block = __toESM(require("../utils/init-block.cjs"));
|
|
41
|
-
var import_edit = __toESM(require("./edit.cjs"));
|
|
42
|
-
var import_save = __toESM(require("./save.cjs"));
|
|
43
|
-
var import_block = __toESM(require("./block.json"));
|
|
44
|
-
var { name } = import_block.default;
|
|
45
|
-
var settings = {
|
|
46
|
-
icon: import_icons.tab,
|
|
47
|
-
edit: import_edit.default,
|
|
48
|
-
save: import_save.default
|
|
49
|
-
};
|
|
50
|
-
var init = () => (0, import_init_block.default)({ name, metadata: import_block.default, settings });
|
|
51
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
52
|
-
0 && (module.exports = {
|
|
53
|
-
init,
|
|
54
|
-
metadata,
|
|
55
|
-
name,
|
|
56
|
-
settings
|
|
57
|
-
});
|
|
58
|
-
//# sourceMappingURL=index.cjs.map
|
package/build/tab/index.cjs.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/tab/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { tab as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport edit from './edit';\nimport save from './save';\nimport metadata from './block.json';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\tsave,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,+BAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAGA,mBAA4B;AAK5B,wBAAsB;AACtB,kBAAiB;AACjB,kBAAiB;AACjB,mBAAqB;AAErB,IAAM,EAAE,KAAK,IAAI,aAAAA;AAIV,IAAM,WAAW;AAAA,EACvB,mBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,kBAAAC;AACD;AAEO,IAAM,OAAO,UAAM,kBAAAC,SAAW,EAAE,MAAM,uBAAAC,SAAU,SAAS,CAAE;",
|
|
6
|
-
"names": ["metadata", "icon", "edit", "save", "initBlock", "metadata"]
|
|
7
|
-
}
|
package/build/tab/save.cjs.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/tab/save.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useBlockProps } from '@wordpress/block-editor';\n\nexport default function save() {\n\tconst blockProps = useBlockProps.save( {\n\t\ttype: 'button',\n\t\trole: 'tab',\n\t} );\n\n\treturn <button { ...blockProps } />;\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,0BAA8B;AAQtB;AANO,SAAR,OAAwB;AAC9B,QAAM,aAAa,kCAAc,KAAM;AAAA,IACtC,MAAM;AAAA,IACN,MAAM;AAAA,EACP,CAAE;AAEF,SAAO,4CAAC,YAAS,GAAG,YAAa;AAClC;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|