@wordpress/block-library 9.38.0 → 9.39.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 +2 -0
- package/build/block/block.json +2 -1
- package/build/breadcrumbs/edit.cjs +15 -5
- package/build/breadcrumbs/edit.cjs.map +2 -2
- package/build/breadcrumbs/index.cjs +1 -0
- package/build/breadcrumbs/index.cjs.map +2 -2
- package/build/button/index.cjs +3 -0
- package/build/button/index.cjs.map +2 -2
- package/build/comment-date/block.json +1 -0
- package/build/comment-edit-link/block.json +1 -3
- package/build/comment-edit-link/deprecated.cjs +91 -0
- package/build/comment-edit-link/deprecated.cjs.map +7 -0
- package/build/comment-edit-link/edit.cjs +6 -18
- package/build/comment-edit-link/edit.cjs.map +3 -3
- package/build/comment-edit-link/index.cjs +2 -0
- package/build/comment-edit-link/index.cjs.map +3 -3
- package/build/comment-reply-link/block.json +1 -5
- package/build/comment-reply-link/deprecated.cjs +84 -0
- package/build/comment-reply-link/deprecated.cjs.map +7 -0
- package/build/comment-reply-link/edit.cjs +10 -23
- package/build/comment-reply-link/edit.cjs.map +3 -3
- package/build/comment-reply-link/index.cjs +2 -0
- package/build/comment-reply-link/index.cjs.map +3 -3
- package/build/comments-title/block.json +1 -3
- package/build/comments-title/deprecated.cjs +148 -24
- package/build/comments-title/deprecated.cjs.map +3 -3
- package/build/comments-title/edit.cjs +17 -31
- package/build/comments-title/edit.cjs.map +3 -3
- package/build/cover/edit/block-controls.cjs +10 -2
- package/build/cover/edit/block-controls.cjs.map +2 -2
- package/build/cover/edit/embed-video-url-input.cjs +6 -2
- package/build/cover/edit/embed-video-url-input.cjs.map +2 -2
- package/build/cover/edit/inspector-controls.cjs +1 -1
- package/build/cover/edit/inspector-controls.cjs.map +2 -2
- package/build/details/index.cjs +3 -0
- package/build/details/index.cjs.map +2 -2
- package/build/embed/util.cjs +9 -0
- package/build/embed/util.cjs.map +2 -2
- package/build/freeform/block.json +2 -1
- package/build/heading/index.cjs +3 -0
- package/build/heading/index.cjs.map +2 -2
- package/build/html/block.json +2 -1
- package/build/image/image.cjs +43 -9
- 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/index.cjs +6 -0
- package/build/index.cjs.map +2 -2
- package/build/list-item/index.cjs +12 -1
- package/build/list-item/index.cjs.map +2 -2
- package/build/missing/block.json +2 -1
- package/build/more/block.json +2 -1
- package/build/more/index.cjs +1 -1
- package/build/more/index.cjs.map +2 -2
- package/build/navigation/block.json +5 -4
- package/build/navigation/deprecated.cjs +133 -5
- package/build/navigation/deprecated.cjs.map +2 -2
- package/build/navigation/edit/deleted-overlay-warning.cjs +70 -0
- package/build/navigation/edit/deleted-overlay-warning.cjs.map +7 -0
- package/build/navigation/edit/index.cjs +143 -65
- package/build/navigation/edit/index.cjs.map +3 -3
- package/build/navigation/edit/overlay-panel.cjs +10 -1
- package/build/navigation/edit/overlay-panel.cjs.map +3 -3
- package/build/navigation/edit/overlay-preview.cjs +120 -0
- package/build/navigation/edit/overlay-preview.cjs.map +7 -0
- package/build/navigation/edit/overlay-template-part-selector.cjs +59 -24
- package/build/navigation/edit/overlay-template-part-selector.cjs.map +3 -3
- package/build/navigation/edit/responsive-wrapper.cjs +12 -1
- package/build/navigation/edit/responsive-wrapper.cjs.map +3 -3
- package/build/navigation/edit/use-create-overlay.cjs +19 -2
- package/build/navigation/edit/use-create-overlay.cjs.map +3 -3
- package/build/navigation/utils/get-submenu-visibility.cjs +37 -0
- package/build/navigation/utils/get-submenu-visibility.cjs.map +7 -0
- package/build/navigation-link/edit.cjs +2 -40
- package/build/navigation-link/edit.cjs.map +2 -2
- package/build/navigation-link/shared/index.cjs +6 -0
- package/build/navigation-link/shared/index.cjs.map +2 -2
- package/build/navigation-link/shared/select-label-text.cjs +40 -0
- package/build/navigation-link/shared/select-label-text.cjs.map +7 -0
- package/build/navigation-link/shared/use-is-dragging-within.cjs +59 -0
- package/build/navigation-link/shared/use-is-dragging-within.cjs.map +7 -0
- package/build/navigation-submenu/block.json +1 -1
- package/build/navigation-submenu/edit.cjs +8 -47
- package/build/navigation-submenu/edit.cjs.map +2 -2
- package/build/navigation-submenu/index.cjs +2 -2
- package/build/navigation-submenu/index.cjs.map +2 -2
- package/build/nextpage/block.json +2 -1
- package/build/paragraph/block.json +1 -0
- package/build/paragraph/index.cjs +1 -1
- package/build/paragraph/index.cjs.map +2 -2
- package/build/post-excerpt/edit.cjs +1 -1
- package/build/post-excerpt/edit.cjs.map +2 -2
- package/build/shortcode/block.json +2 -1
- package/build/tab/add-tab-toolbar-control.cjs +31 -9
- package/build/tab/add-tab-toolbar-control.cjs.map +2 -2
- package/build/tab/block.json +18 -4
- package/build/tab/controls.cjs +4 -8
- package/build/tab/controls.cjs.map +3 -3
- package/build/tab/edit.cjs +46 -118
- package/build/tab/edit.cjs.map +3 -3
- package/build/tab/remove-tab-toolbar-control.cjs +91 -0
- package/build/tab/remove-tab-toolbar-control.cjs.map +7 -0
- package/build/tab/save.cjs +2 -2
- package/build/tab/save.cjs.map +2 -2
- package/build/tab-panels/block.json +70 -0
- package/build/tab-panels/edit.cjs +63 -0
- package/build/tab-panels/edit.cjs.map +7 -0
- package/build/tab-panels/icon.cjs +29 -0
- package/build/tab-panels/icon.cjs.map +7 -0
- package/build/tab-panels/index.cjs +58 -0
- package/build/tab-panels/index.cjs.map +7 -0
- package/build/tab-panels/save.cjs +33 -0
- package/build/tab-panels/save.cjs.map +7 -0
- package/build/tabs/block.json +61 -90
- package/build/tabs/controls.cjs +19 -221
- package/build/tabs/controls.cjs.map +3 -3
- package/build/tabs/deprecated.cjs +179 -0
- package/build/tabs/deprecated.cjs.map +7 -0
- package/build/tabs/edit.cjs +84 -62
- package/build/tabs/edit.cjs.map +3 -3
- package/build/tabs/index.cjs +3 -1
- package/build/tabs/index.cjs.map +3 -3
- package/build/tabs/save.cjs +6 -9
- package/build/tabs/save.cjs.map +2 -2
- package/build/tabs-menu/block.json +77 -0
- package/build/tabs-menu/edit.cjs +204 -0
- package/build/tabs-menu/edit.cjs.map +7 -0
- package/build/tabs-menu/icon.cjs +29 -0
- package/build/tabs-menu/icon.cjs.map +7 -0
- package/build/tabs-menu/index.cjs +58 -0
- package/build/tabs-menu/index.cjs.map +7 -0
- package/build/tabs-menu/save.cjs +35 -0
- package/build/tabs-menu/save.cjs.map +7 -0
- package/build/tabs-menu-item/block.json +98 -0
- package/build/tabs-menu-item/controls.cjs +247 -0
- package/build/tabs-menu-item/controls.cjs.map +7 -0
- package/build/tabs-menu-item/edit.cjs +272 -0
- package/build/tabs-menu-item/edit.cjs.map +7 -0
- package/build/tabs-menu-item/icon.cjs +29 -0
- package/build/tabs-menu-item/icon.cjs.map +7 -0
- package/build/tabs-menu-item/index.cjs +58 -0
- package/build/tabs-menu-item/index.cjs.map +7 -0
- package/build/tabs-menu-item/save.cjs +50 -0
- package/build/tabs-menu-item/save.cjs.map +7 -0
- package/build/template-part/edit/index.cjs +2 -2
- package/build/template-part/edit/index.cjs.map +2 -2
- package/build/utils/caption.cjs +4 -6
- package/build/utils/caption.cjs.map +3 -3
- package/build/verse/block.json +1 -3
- package/build/verse/deprecated.cjs +74 -5
- package/build/verse/deprecated.cjs.map +3 -3
- package/build/verse/edit.cjs +33 -48
- package/build/verse/edit.cjs.map +3 -3
- package/build/verse/save.cjs +2 -16
- package/build/verse/save.cjs.map +3 -3
- package/build/video/edit.cjs +4 -2
- package/build/video/edit.cjs.map +2 -2
- package/build-module/block/block.json +2 -1
- package/build-module/breadcrumbs/edit.mjs +15 -5
- package/build-module/breadcrumbs/edit.mjs.map +2 -2
- package/build-module/breadcrumbs/index.mjs +1 -0
- package/build-module/breadcrumbs/index.mjs.map +2 -2
- package/build-module/button/index.mjs +3 -0
- package/build-module/button/index.mjs.map +2 -2
- package/build-module/comment-date/block.json +1 -0
- package/build-module/comment-edit-link/block.json +1 -3
- package/build-module/comment-edit-link/deprecated.mjs +60 -0
- package/build-module/comment-edit-link/deprecated.mjs.map +7 -0
- package/build-module/comment-edit-link/edit.mjs +7 -24
- package/build-module/comment-edit-link/edit.mjs.map +2 -2
- package/build-module/comment-edit-link/index.mjs +2 -0
- package/build-module/comment-edit-link/index.mjs.map +2 -2
- package/build-module/comment-reply-link/block.json +1 -5
- package/build-module/comment-reply-link/deprecated.mjs +53 -0
- package/build-module/comment-reply-link/deprecated.mjs.map +7 -0
- package/build-module/comment-reply-link/edit.mjs +12 -29
- package/build-module/comment-reply-link/edit.mjs.map +2 -2
- package/build-module/comment-reply-link/index.mjs +2 -0
- package/build-module/comment-reply-link/index.mjs.map +2 -2
- package/build-module/comments-title/block.json +1 -3
- package/build-module/comments-title/deprecated.mjs +148 -24
- package/build-module/comments-title/deprecated.mjs.map +2 -2
- package/build-module/comments-title/edit.mjs +17 -32
- package/build-module/comments-title/edit.mjs.map +2 -2
- package/build-module/cover/edit/block-controls.mjs +11 -3
- package/build-module/cover/edit/block-controls.mjs.map +2 -2
- package/build-module/cover/edit/embed-video-url-input.mjs +6 -2
- package/build-module/cover/edit/embed-video-url-input.mjs.map +2 -2
- package/build-module/cover/edit/inspector-controls.mjs +1 -1
- package/build-module/cover/edit/inspector-controls.mjs.map +2 -2
- package/build-module/details/index.mjs +3 -0
- package/build-module/details/index.mjs.map +2 -2
- package/build-module/embed/util.mjs +8 -0
- package/build-module/embed/util.mjs.map +2 -2
- package/build-module/freeform/block.json +2 -1
- package/build-module/heading/index.mjs +3 -0
- package/build-module/heading/index.mjs.map +2 -2
- package/build-module/html/block.json +2 -1
- package/build-module/image/image.mjs +43 -9
- 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/index.mjs +6 -0
- package/build-module/index.mjs.map +2 -2
- package/build-module/list-item/index.mjs +12 -1
- package/build-module/list-item/index.mjs.map +2 -2
- package/build-module/missing/block.json +2 -1
- package/build-module/more/block.json +2 -1
- package/build-module/more/index.mjs +1 -1
- package/build-module/more/index.mjs.map +2 -2
- package/build-module/navigation/block.json +5 -4
- package/build-module/navigation/deprecated.mjs +133 -5
- package/build-module/navigation/deprecated.mjs.map +2 -2
- package/build-module/navigation/edit/deleted-overlay-warning.mjs +49 -0
- package/build-module/navigation/edit/deleted-overlay-warning.mjs.map +7 -0
- package/build-module/navigation/edit/index.mjs +145 -65
- package/build-module/navigation/edit/index.mjs.map +2 -2
- package/build-module/navigation/edit/overlay-panel.mjs +10 -1
- package/build-module/navigation/edit/overlay-panel.mjs.map +2 -2
- package/build-module/navigation/edit/overlay-preview.mjs +99 -0
- package/build-module/navigation/edit/overlay-preview.mjs.map +7 -0
- package/build-module/navigation/edit/overlay-template-part-selector.mjs +61 -26
- package/build-module/navigation/edit/overlay-template-part-selector.mjs.map +2 -2
- package/build-module/navigation/edit/responsive-wrapper.mjs +12 -1
- package/build-module/navigation/edit/responsive-wrapper.mjs.map +2 -2
- package/build-module/navigation/edit/use-create-overlay.mjs +21 -4
- package/build-module/navigation/edit/use-create-overlay.mjs.map +2 -2
- package/build-module/navigation/utils/get-submenu-visibility.mjs +12 -0
- package/build-module/navigation/utils/get-submenu-visibility.mjs.map +7 -0
- package/build-module/navigation-link/edit.mjs +4 -40
- package/build-module/navigation-link/edit.mjs.map +2 -2
- package/build-module/navigation-link/shared/index.mjs +4 -0
- package/build-module/navigation-link/shared/index.mjs.map +2 -2
- package/build-module/navigation-link/shared/select-label-text.mjs +15 -0
- package/build-module/navigation-link/shared/select-label-text.mjs.map +7 -0
- package/build-module/navigation-link/shared/use-is-dragging-within.mjs +34 -0
- package/build-module/navigation-link/shared/use-is-dragging-within.mjs.map +7 -0
- package/build-module/navigation-submenu/block.json +1 -1
- package/build-module/navigation-submenu/edit.mjs +10 -47
- package/build-module/navigation-submenu/edit.mjs.map +2 -2
- package/build-module/navigation-submenu/index.mjs +2 -2
- package/build-module/navigation-submenu/index.mjs.map +2 -2
- package/build-module/nextpage/block.json +2 -1
- package/build-module/paragraph/block.json +1 -0
- package/build-module/paragraph/index.mjs +1 -1
- package/build-module/paragraph/index.mjs.map +2 -2
- package/build-module/post-excerpt/edit.mjs +1 -1
- package/build-module/post-excerpt/edit.mjs.map +2 -2
- package/build-module/shortcode/block.json +2 -1
- package/build-module/tab/add-tab-toolbar-control.mjs +32 -10
- package/build-module/tab/add-tab-toolbar-control.mjs.map +2 -2
- package/build-module/tab/block.json +18 -4
- package/build-module/tab/controls.mjs +4 -8
- package/build-module/tab/controls.mjs.map +2 -2
- package/build-module/tab/edit.mjs +48 -128
- package/build-module/tab/edit.mjs.map +2 -2
- package/build-module/tab/remove-tab-toolbar-control.mjs +73 -0
- package/build-module/tab/remove-tab-toolbar-control.mjs.map +7 -0
- package/build-module/tab/save.mjs +2 -2
- package/build-module/tab/save.mjs.map +2 -2
- package/build-module/tab-panels/block.json +70 -0
- package/build-module/tab-panels/edit.mjs +36 -0
- package/build-module/tab-panels/edit.mjs.map +7 -0
- package/build-module/tab-panels/icon.mjs +8 -0
- package/build-module/tab-panels/icon.mjs.map +7 -0
- package/build-module/tab-panels/index.mjs +20 -0
- package/build-module/tab-panels/index.mjs.map +7 -0
- package/build-module/tab-panels/save.mjs +12 -0
- package/build-module/tab-panels/save.mjs.map +7 -0
- package/build-module/tabs/block.json +61 -90
- package/build-module/tabs/controls.mjs +21 -228
- package/build-module/tabs/controls.mjs.map +2 -2
- package/build-module/tabs/deprecated.mjs +158 -0
- package/build-module/tabs/deprecated.mjs.map +7 -0
- package/build-module/tabs/edit.mjs +87 -64
- package/build-module/tabs/edit.mjs.map +2 -2
- package/build-module/tabs/index.mjs +3 -1
- package/build-module/tabs/index.mjs.map +2 -2
- package/build-module/tabs/save.mjs +7 -10
- package/build-module/tabs/save.mjs.map +2 -2
- package/build-module/tabs-menu/block.json +77 -0
- package/build-module/tabs-menu/edit.mjs +186 -0
- package/build-module/tabs-menu/edit.mjs.map +7 -0
- package/build-module/tabs-menu/icon.mjs +8 -0
- package/build-module/tabs-menu/icon.mjs.map +7 -0
- package/build-module/tabs-menu/index.mjs +20 -0
- package/build-module/tabs-menu/index.mjs.map +7 -0
- package/build-module/tabs-menu/save.mjs +14 -0
- package/build-module/tabs-menu/save.mjs.map +7 -0
- package/build-module/tabs-menu-item/block.json +98 -0
- package/build-module/tabs-menu-item/controls.mjs +227 -0
- package/build-module/tabs-menu-item/controls.mjs.map +7 -0
- package/build-module/tabs-menu-item/edit.mjs +253 -0
- package/build-module/tabs-menu-item/edit.mjs.map +7 -0
- package/build-module/tabs-menu-item/icon.mjs +8 -0
- package/build-module/tabs-menu-item/icon.mjs.map +7 -0
- package/build-module/tabs-menu-item/index.mjs +20 -0
- package/build-module/tabs-menu-item/index.mjs.map +7 -0
- package/build-module/tabs-menu-item/save.mjs +29 -0
- package/build-module/tabs-menu-item/save.mjs.map +7 -0
- package/build-module/template-part/edit/index.mjs +2 -2
- package/build-module/template-part/edit/index.mjs.map +2 -2
- package/build-module/utils/caption.mjs +1 -3
- package/build-module/utils/caption.mjs.map +2 -2
- package/build-module/verse/block.json +1 -3
- package/build-module/verse/deprecated.mjs +74 -5
- package/build-module/verse/deprecated.mjs.map +2 -2
- package/build-module/verse/edit.mjs +35 -55
- package/build-module/verse/edit.mjs.map +2 -2
- package/build-module/verse/save.mjs +2 -6
- package/build-module/verse/save.mjs.map +2 -2
- package/build-module/video/edit.mjs +4 -2
- package/build-module/video/edit.mjs.map +2 -2
- package/build-style/editor-rtl.css +64 -21
- package/build-style/editor.css +64 -21
- package/build-style/gallery/style-rtl.css +1 -1
- package/build-style/gallery/style.css +1 -1
- package/build-style/media-text/style-rtl.css +2 -0
- package/build-style/media-text/style.css +2 -0
- package/build-style/navigation/editor-rtl.css +48 -0
- package/build-style/navigation/editor.css +48 -0
- package/build-style/navigation/style-rtl.css +64 -18
- package/build-style/navigation/style.css +64 -18
- package/build-style/style-rtl.css +109 -171
- package/build-style/style.css +109 -171
- package/build-style/tab/style-rtl.css +7 -1
- package/build-style/tab/style.css +7 -1
- package/build-style/tab-panels/style-rtl.css +4 -0
- package/build-style/tab-panels/style.css +4 -0
- package/build-style/tabs/style-rtl.css +1 -167
- package/build-style/tabs/style.css +1 -167
- package/build-style/tabs-menu/editor-rtl.css +4 -0
- package/build-style/tabs-menu/editor.css +4 -0
- package/build-style/tabs-menu/style-rtl.css +8 -0
- package/build-style/tabs-menu/style.css +8 -0
- package/build-style/tabs-menu-item/editor-rtl.css +16 -0
- package/build-style/tabs-menu-item/editor.css +16 -0
- package/build-style/tabs-menu-item/style-rtl.css +34 -0
- package/build-style/tabs-menu-item/style.css +34 -0
- package/build-style/verse/style-rtl.css +1 -0
- package/build-style/verse/style.css +1 -0
- package/package.json +37 -37
- package/src/block/block.json +2 -1
- package/src/breadcrumbs/edit.js +10 -2
- package/src/breadcrumbs/index.js +1 -0
- package/src/button/index.js +4 -0
- package/src/categories/index.php +5 -1
- package/src/comment-date/block.json +1 -0
- package/src/comment-edit-link/block.json +1 -3
- package/src/comment-edit-link/deprecated.js +63 -0
- package/src/comment-edit-link/edit.js +7 -31
- package/src/comment-edit-link/index.js +2 -0
- package/src/comment-reply-link/block.json +1 -5
- package/src/comment-reply-link/deprecated.js +56 -0
- package/src/comment-reply-link/edit.js +6 -35
- package/src/comment-reply-link/index.js +2 -0
- package/src/comments-title/block.json +1 -3
- package/src/comments-title/deprecated.js +153 -23
- package/src/comments-title/edit.js +9 -25
- package/src/cover/edit/block-controls.js +14 -3
- package/src/cover/edit/embed-video-url-input.js +6 -2
- package/src/cover/edit/inspector-controls.js +1 -3
- package/src/details/index.js +4 -0
- package/src/editor.scss +2 -1
- package/src/embed/test/index.js +49 -0
- package/src/embed/util.js +21 -0
- package/src/freeform/block.json +2 -1
- package/src/gallery/style.scss +1 -1
- package/src/heading/index.js +4 -0
- package/src/html/block.json +2 -1
- package/src/image/image.js +63 -11
- package/src/image/index.js +4 -1
- package/src/index.js +6 -0
- package/src/list-item/index.js +16 -0
- package/src/media-text/style.scss +2 -0
- package/src/missing/block.json +2 -1
- package/src/more/block.json +2 -1
- package/src/more/index.js +4 -1
- package/src/navigation/block.json +5 -4
- package/src/navigation/deprecated.js +144 -5
- package/src/navigation/edit/deleted-overlay-warning.js +56 -0
- package/src/navigation/edit/index.js +181 -70
- package/src/navigation/edit/overlay-panel.js +10 -0
- package/src/navigation/edit/overlay-preview.js +133 -0
- package/src/navigation/edit/overlay-template-part-selector.js +76 -26
- package/src/navigation/edit/responsive-wrapper.js +14 -1
- package/src/navigation/edit/test/overlay-template-part-selector.js +24 -16
- package/src/navigation/edit/test/responsive-wrapper.js +179 -0
- package/src/navigation/edit/test/use-create-overlay.js +129 -2
- package/src/navigation/edit/use-create-overlay.js +26 -4
- package/src/navigation/editor.scss +51 -0
- package/src/navigation/index.php +59 -11
- package/src/navigation/style.scss +140 -76
- package/src/navigation/utils/get-submenu-visibility.js +27 -0
- package/src/navigation/utils/test/get-submenu-visibility.js +47 -0
- package/src/navigation-link/edit.js +3 -67
- package/src/navigation-link/shared/index.js +2 -0
- package/src/navigation-link/shared/select-label-text.js +16 -0
- package/src/navigation-link/shared/use-is-dragging-within.js +55 -0
- package/src/navigation-submenu/block.json +1 -1
- package/src/navigation-submenu/edit.js +10 -73
- package/src/navigation-submenu/index.js +6 -3
- package/src/navigation-submenu/index.php +36 -5
- package/src/nextpage/block.json +2 -1
- package/src/paragraph/block.json +1 -0
- package/src/paragraph/index.js +4 -1
- package/src/post-excerpt/edit.js +1 -1
- package/src/post-excerpt/index.php +39 -16
- package/src/shortcode/block.json +2 -1
- package/src/style.scss +3 -0
- package/src/tab/add-tab-toolbar-control.js +36 -11
- package/src/tab/block.json +18 -4
- package/src/tab/controls.js +4 -5
- package/src/tab/edit.js +75 -150
- package/src/tab/index.php +5 -63
- package/src/tab/remove-tab-toolbar-control.js +103 -0
- package/src/tab/save.js +1 -3
- package/src/tab/style.scss +8 -1
- package/src/tab-panels/block.json +70 -0
- package/src/tab-panels/edit.js +44 -0
- package/src/tab-panels/icon.js +10 -0
- package/src/tab-panels/index.js +21 -0
- package/src/tab-panels/save.js +11 -0
- package/src/tab-panels/style.scss +4 -0
- package/src/tabs/block.json +61 -90
- package/src/tabs/controls.js +7 -221
- package/src/tabs/deprecated.js +214 -0
- package/src/tabs/edit.js +108 -68
- package/src/tabs/index.js +2 -0
- package/src/tabs/index.php +86 -191
- package/src/tabs/save.js +6 -13
- package/src/tabs/style.scss +1 -187
- package/src/tabs-menu/block.json +77 -0
- package/src/tabs-menu/edit.js +251 -0
- package/src/tabs-menu/editor.scss +6 -0
- package/src/tabs-menu/icon.js +10 -0
- package/src/tabs-menu/index.js +21 -0
- package/src/tabs-menu/index.php +74 -0
- package/src/tabs-menu/save.js +18 -0
- package/src/tabs-menu/style.scss +8 -0
- package/src/tabs-menu-item/block.json +98 -0
- package/src/tabs-menu-item/controls.js +262 -0
- package/src/tabs-menu-item/edit.js +322 -0
- package/src/tabs-menu-item/editor.scss +20 -0
- package/src/tabs-menu-item/icon.js +10 -0
- package/src/tabs-menu-item/index.js +21 -0
- package/src/tabs-menu-item/index.php +82 -0
- package/src/tabs-menu-item/save.js +44 -0
- package/src/tabs-menu-item/style.scss +42 -0
- package/src/template-part/edit/index.js +2 -4
- package/src/utils/caption.js +1 -7
- package/src/verse/block.json +1 -3
- package/src/verse/deprecated.js +83 -4
- package/src/verse/edit.js +37 -56
- package/src/verse/save.js +2 -11
- package/src/verse/style.scss +1 -0
- package/src/video/edit.js +4 -2
- package/build/tab/tabs-list.cjs +0 -132
- package/build/tab/tabs-list.cjs.map +0 -7
- package/build/tabs/style-engine.cjs +0 -119
- package/build/tabs/style-engine.cjs.map +0 -7
- package/build-module/tab/tabs-list.mjs +0 -101
- package/build-module/tab/tabs-list.mjs.map +0 -7
- package/build-module/tabs/style-engine.mjs +0 -101
- package/build-module/tabs/style-engine.mjs.map +0 -7
- package/build-style/tabs/editor-rtl.css +0 -26
- package/build-style/tabs/editor.css +0 -26
- package/src/tab/tabs-list.js +0 -122
- package/src/tabs/editor.scss +0 -30
- package/src/tabs/style-engine.js +0 -164
package/CHANGELOG.md
CHANGED
package/build/block/block.json
CHANGED
|
@@ -138,10 +138,20 @@ function BreadcrumbEdit({
|
|
|
138
138
|
} else {
|
|
139
139
|
placeholderItems.push((0, import_i18n.__)("Ancestor"), (0, import_i18n.__)("Parent"));
|
|
140
140
|
}
|
|
141
|
-
placeholder = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
141
|
+
placeholder = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
142
|
+
"nav",
|
|
143
|
+
{
|
|
144
|
+
...blockProps,
|
|
145
|
+
style: {
|
|
146
|
+
"--separator": `"${separator.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`,
|
|
147
|
+
...blockProps.style
|
|
148
|
+
},
|
|
149
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("ol", { children: [
|
|
150
|
+
placeholderItems.map((text, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("a", { href: `#breadcrumbs-pseudo-link-${index}`, children: text }) }, index)),
|
|
151
|
+
showCurrentItem && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { "aria-current": "page", children: (0, import_i18n.__)("Current") }) })
|
|
152
|
+
] })
|
|
153
|
+
}
|
|
154
|
+
);
|
|
145
155
|
}
|
|
146
156
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
147
157
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
@@ -250,7 +260,7 @@ function BreadcrumbEdit({
|
|
|
250
260
|
}
|
|
251
261
|
)
|
|
252
262
|
] }),
|
|
253
|
-
status === "loading" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Spinner, {}) }),
|
|
263
|
+
status === "loading" && !showPlaceholder && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Spinner, {}) }),
|
|
254
264
|
status === "error" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: (0, import_i18n.sprintf)(
|
|
255
265
|
/* translators: %s: error message returned when rendering the block. */
|
|
256
266
|
(0, import_i18n.__)("Error: %s"),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/breadcrumbs/edit.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { InspectorControls, useBlockProps } from '@wordpress/block-editor';\nimport {\n\tToggleControl,\n\tTextControl,\n\tCheckboxControl,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\tSpinner,\n} from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useEffect, useState } from '@wordpress/element';\nimport { useServerSideRender } from '@wordpress/server-side-render';\nimport { useDisabled } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\nimport HtmlRenderer from '../utils/html-renderer';\n\nconst separatorDefaultValue = '/';\n\nexport default function BreadcrumbEdit( {\n\tattributes,\n\tsetAttributes,\n\tname,\n\tcontext: { postId, postType, templateSlug },\n} ) {\n\tconst {\n\t\tseparator,\n\t\tshowHomeItem,\n\t\tshowCurrentItem,\n\t\tprefersTaxonomy,\n\t\tshowOnHomePage,\n\t} = attributes;\n\tconst {\n\t\tpost,\n\t\tisPostTypeHierarchical,\n\t\tpostTypeHasTaxonomies,\n\t\thasTermsAssigned,\n\t\tisLoading,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! postType ) {\n\t\t\t\treturn {};\n\t\t\t}\n\t\t\tconst _post = select( coreStore ).getEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId\n\t\t\t);\n\t\t\tconst postTypeObject = select( coreStore ).getPostType( postType );\n\t\t\tconst _postTypeHasTaxonomies =\n\t\t\t\tpostTypeObject && postTypeObject.taxonomies.length;\n\t\t\tlet taxonomies;\n\t\t\tif ( _postTypeHasTaxonomies ) {\n\t\t\t\ttaxonomies = select( coreStore ).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\t\tpost: _post,\n\t\t\t\tisPostTypeHierarchical: postTypeObject?.hierarchical,\n\t\t\t\tpostTypeHasTaxonomies: _postTypeHasTaxonomies,\n\t\t\t\thasTermsAssigned:\n\t\t\t\t\t_post &&\n\t\t\t\t\t( taxonomies || [] )\n\t\t\t\t\t\t.filter(\n\t\t\t\t\t\t\t( { visibility } ) => visibility?.publicly_queryable\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.some( ( taxonomy ) => {\n\t\t\t\t\t\t\treturn !! _post[ taxonomy.rest_base ]?.length;\n\t\t\t\t\t\t} ),\n\t\t\t\tisLoading:\n\t\t\t\t\t( postId && ! _post ) ||\n\t\t\t\t\t! postTypeObject ||\n\t\t\t\t\t( _postTypeHasTaxonomies && ! taxonomies ),\n\t\t\t};\n\t\t},\n\t\t[ postType, postId ]\n\t);\n\n\t/**\n\t * Counter used to cache-bust `useServerSideRender`.\n\t *\n\t * This is a catch-all signal to re-render the block when a post's title,\n\t * parent ID, or terms change.\n\t *\n\t * This is fundamentally imperfect, because there are other entities which\n\t * could change in the meantime (the titles of ancestor posts, or the\n\t * labels of taxonomy terms), hence the choice to re-render systematically\n\t * upon saving.\n\t */\n\tconst [ invalidationKey, setInvalidationKey ] = useState( 0 );\n\tuseEffect( () => {\n\t\tsetInvalidationKey( ( c ) => c + 1 );\n\t}, [ post ] );\n\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\tconst { content, status, error } = useServerSideRender( {\n\t\tattributes,\n\t\tskipBlockSupportAttributes: true,\n\t\tblock: name,\n\t\turlQueryArgs: { post_id: postId, invalidationKey },\n\t} );\n\n\tconst disabledRef = useDisabled();\n\tconst blockProps = useBlockProps( { ref: disabledRef } );\n\n\tif ( isLoading ) {\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<Spinner />\n\t\t\t</div>\n\t\t);\n\t}\n\n\t// Try to determine breadcrumb type for more accurate previews.\n\tlet _showTerms;\n\t// Some non-hierarchical post types (e.g., attachments) can have parents.\n\t// Use hierarchical breadcrumbs if a parent exists, otherwise use taxonomy breadcrumbs.\n\tif ( ! isPostTypeHierarchical && ! post?.parent ) {\n\t\t_showTerms = true;\n\t} else if ( ! postTypeHasTaxonomies ) {\n\t\t// Hierarchical post type without taxonomies can only use ancestors.\n\t\t_showTerms = false;\n\t} else {\n\t\t// For hierarchical post types with taxonomies, use the attribute.\n\t\t_showTerms = prefersTaxonomy;\n\t}\n\tlet placeholder = null;\n\t// This is fragile because this block is server side rendered and we'll have to\n\t// update the placeholder html if the server side rendering output changes.\n\tconst showPlaceholder =\n\t\t! postId ||\n\t\t! postType ||\n\t\t// When `templateSlug` is set only show placeholder if the post type is not.\n\t\t// This is needed because when we are showing the template in post editor we\n\t\t// want to show the real breadcrumbs if we have the post type.\n\t\t( templateSlug && ! postType ) ||\n\t\t( ! _showTerms && ! isPostTypeHierarchical ) ||\n\t\t( _showTerms && ! hasTermsAssigned );\n\tif ( showPlaceholder ) {\n\t\tconst placeholderItems = [];\n\t\tif ( showHomeItem ) {\n\t\t\tplaceholderItems.push( __( 'Home' ) );\n\t\t}\n\t\tif ( templateSlug && ! postId ) {\n\t\t\tplaceholderItems.push( __( 'Page' ) );\n\t\t} else if ( _showTerms ) {\n\t\t\tplaceholderItems.push( __( 'Category' ) );\n\t\t} else {\n\t\t\tplaceholderItems.push( __( 'Ancestor' ), __( 'Parent' ) );\n\t\t}\n\t\tplaceholder = (\n\t\t\t<nav { ...blockProps }>\n\t\t\t\t<ol>\n\t\t\t\t\t{ placeholderItems.map( ( text, index ) => (\n\t\t\t\t\t\t<li key={ index }>\n\t\t\t\t\t\t\t<a href={ `#breadcrumbs-pseudo-link-${ index }` }>\n\t\t\t\t\t\t\t\t{ text }\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t) ) }\n\t\t\t\t\t{ showCurrentItem && (\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<span aria-current=\"page\">{ __( 'Current' ) }</span>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t) }\n\t\t\t\t</ol>\n\t\t\t</nav>\n\t\t);\n\t}\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\tseparator: separatorDefaultValue,\n\t\t\t\t\t\t\tshowHomeItem: true,\n\t\t\t\t\t\t\tshowCurrentItem: true,\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Show home breadcrumb' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => ! showHomeItem }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tshowHomeItem: true,\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\t\t<ToggleControl\n\t\t\t\t\t\t\tlabel={ __( 'Show home breadcrumb' ) }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { showHomeItem: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tchecked={ showHomeItem }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Show current breadcrumb' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => ! showCurrentItem }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tshowCurrentItem: true,\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\t\t<ToggleControl\n\t\t\t\t\t\t\tlabel={ __( 'Show current breadcrumb' ) }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { showCurrentItem: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tchecked={ showCurrentItem }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Separator' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => separator !== separatorDefaultValue }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tseparator: separatorDefaultValue,\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\t\t<TextControl\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\t\tlabel={ __( 'Separator' ) }\n\t\t\t\t\t\t\tvalue={ separator }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { separator: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonBlur={ () => {\n\t\t\t\t\t\t\t\tif ( ! separator ) {\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tseparator: separatorDefaultValue,\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} }\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<InspectorControls group=\"advanced\">\n\t\t\t\t<CheckboxControl\n\t\t\t\t\tlabel={ __( 'Show on homepage' ) }\n\t\t\t\t\tchecked={ showOnHomePage }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { showOnHomePage: value } )\n\t\t\t\t\t}\n\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t'If this breadcrumbs block appears in a template or template part that\u2019s shown on the homepage, enable this option to display the breadcrumb trail. Otherwise, this setting has no effect.'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t\t<CheckboxControl\n\t\t\t\t\tlabel={ __( 'Prefer taxonomy terms' ) }\n\t\t\t\t\tchecked={ prefersTaxonomy }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { prefersTaxonomy: value } )\n\t\t\t\t\t}\n\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t'The exact type of breadcrumbs shown will vary automatically depending on the page in which this block is displayed. In the specific case of a hierarchical post type with taxonomies, the breadcrumbs can either reflect its post hierarchy (default) or the hierarchy of its assigned taxonomy terms.'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t{ status === 'loading' && (\n\t\t\t\t<div { ...blockProps }>\n\t\t\t\t\t<Spinner />\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t{ status === 'error' && (\n\t\t\t\t<div { ...blockProps }>\n\t\t\t\t\t<p>\n\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t/* translators: %s: error message returned when rendering the block. */\n\t\t\t\t\t\t\t__( 'Error: %s' ),\n\t\t\t\t\t\t\terror\n\t\t\t\t\t\t) }\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t{ showPlaceholder && placeholder }\n\t\t\t{ ! showPlaceholder && status === 'success' && (\n\t\t\t\t<HtmlRenderer wrapperProps={ blockProps } html={ content } />\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAA4B;AAC5B,0BAAiD;AACjD,wBAOO;AACP,kBAA0B;AAC1B,uBAAmC;AACnC,qBAAoC;AACpC,gCAAoC;AACpC,qBAA4B;AAK5B,mBAA+C;AAC/C,2BAAyB;AA+FrB;AA7FJ,IAAM,wBAAwB;AAEf,SAAR,eAAiC;AAAA,EACvC;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS,EAAE,QAAQ,UAAU,aAAa;AAC3C,GAAI;AACH,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,IAAI;AACJ,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,QAAI;AAAA,IACH,CAAE,WAAY;AACb,UAAK,CAAE,UAAW;AACjB,eAAO,CAAC;AAAA,MACT;AACA,YAAM,QAAQ,OAAQ,iBAAAA,KAAU,EAAE;AAAA,QACjC;AAAA,QACA;AAAA,QACA;AAAA,MACD;AACA,YAAM,iBAAiB,OAAQ,iBAAAA,KAAU,EAAE,YAAa,QAAS;AACjE,YAAM,yBACL,kBAAkB,eAAe,WAAW;AAC7C,UAAI;AACJ,UAAK,wBAAyB;AAC7B,qBAAa,OAAQ,iBAAA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E,cAAc,CAAE,0BAClB,cAAc,CAAE;AACnB,MAAK,iBAAkB;AACtB,UAAM,mBAAmB,CAAC;AAC1B,QAAK,cAAe;AACnB,uBAAiB,SAAM,gBAAI,MAAO,CAAE;AAAA,IACrC;AACA,QAAK,gBAAgB,CAAE,QAAS;AAC/B,uBAAiB,SAAM,gBAAI,MAAO,CAAE;AAAA,IACrC,WAAY,YAAa;AACxB,uBAAiB,SAAM,gBAAI,UAAW,CAAE;AAAA,IACzC,OAAO;AACN,uBAAiB,SAAM,gBAAI,UAAW,OAAG,gBAAI,QAAS,CAAE;AAAA,IACzD;AACA,kBACC,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { InspectorControls, useBlockProps } from '@wordpress/block-editor';\nimport {\n\tToggleControl,\n\tTextControl,\n\tCheckboxControl,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\tSpinner,\n} from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useEffect, useState } from '@wordpress/element';\nimport { useServerSideRender } from '@wordpress/server-side-render';\nimport { useDisabled } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\nimport HtmlRenderer from '../utils/html-renderer';\n\nconst separatorDefaultValue = '/';\n\nexport default function BreadcrumbEdit( {\n\tattributes,\n\tsetAttributes,\n\tname,\n\tcontext: { postId, postType, templateSlug },\n} ) {\n\tconst {\n\t\tseparator,\n\t\tshowHomeItem,\n\t\tshowCurrentItem,\n\t\tprefersTaxonomy,\n\t\tshowOnHomePage,\n\t} = attributes;\n\tconst {\n\t\tpost,\n\t\tisPostTypeHierarchical,\n\t\tpostTypeHasTaxonomies,\n\t\thasTermsAssigned,\n\t\tisLoading,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! postType ) {\n\t\t\t\treturn {};\n\t\t\t}\n\t\t\tconst _post = select( coreStore ).getEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId\n\t\t\t);\n\t\t\tconst postTypeObject = select( coreStore ).getPostType( postType );\n\t\t\tconst _postTypeHasTaxonomies =\n\t\t\t\tpostTypeObject && postTypeObject.taxonomies.length;\n\t\t\tlet taxonomies;\n\t\t\tif ( _postTypeHasTaxonomies ) {\n\t\t\t\ttaxonomies = select( coreStore ).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\t\tpost: _post,\n\t\t\t\tisPostTypeHierarchical: postTypeObject?.hierarchical,\n\t\t\t\tpostTypeHasTaxonomies: _postTypeHasTaxonomies,\n\t\t\t\thasTermsAssigned:\n\t\t\t\t\t_post &&\n\t\t\t\t\t( taxonomies || [] )\n\t\t\t\t\t\t.filter(\n\t\t\t\t\t\t\t( { visibility } ) => visibility?.publicly_queryable\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.some( ( taxonomy ) => {\n\t\t\t\t\t\t\treturn !! _post[ taxonomy.rest_base ]?.length;\n\t\t\t\t\t\t} ),\n\t\t\t\tisLoading:\n\t\t\t\t\t( postId && ! _post ) ||\n\t\t\t\t\t! postTypeObject ||\n\t\t\t\t\t( _postTypeHasTaxonomies && ! taxonomies ),\n\t\t\t};\n\t\t},\n\t\t[ postType, postId ]\n\t);\n\n\t/**\n\t * Counter used to cache-bust `useServerSideRender`.\n\t *\n\t * This is a catch-all signal to re-render the block when a post's title,\n\t * parent ID, or terms change.\n\t *\n\t * This is fundamentally imperfect, because there are other entities which\n\t * could change in the meantime (the titles of ancestor posts, or the\n\t * labels of taxonomy terms), hence the choice to re-render systematically\n\t * upon saving.\n\t */\n\tconst [ invalidationKey, setInvalidationKey ] = useState( 0 );\n\tuseEffect( () => {\n\t\tsetInvalidationKey( ( c ) => c + 1 );\n\t}, [ post ] );\n\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\tconst { content, status, error } = useServerSideRender( {\n\t\tattributes,\n\t\tskipBlockSupportAttributes: true,\n\t\tblock: name,\n\t\turlQueryArgs: { post_id: postId, invalidationKey },\n\t} );\n\n\tconst disabledRef = useDisabled();\n\tconst blockProps = useBlockProps( { ref: disabledRef } );\n\n\tif ( isLoading ) {\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<Spinner />\n\t\t\t</div>\n\t\t);\n\t}\n\n\t// Try to determine breadcrumb type for more accurate previews.\n\tlet _showTerms;\n\t// Some non-hierarchical post types (e.g., attachments) can have parents.\n\t// Use hierarchical breadcrumbs if a parent exists, otherwise use taxonomy breadcrumbs.\n\tif ( ! isPostTypeHierarchical && ! post?.parent ) {\n\t\t_showTerms = true;\n\t} else if ( ! postTypeHasTaxonomies ) {\n\t\t// Hierarchical post type without taxonomies can only use ancestors.\n\t\t_showTerms = false;\n\t} else {\n\t\t// For hierarchical post types with taxonomies, use the attribute.\n\t\t_showTerms = prefersTaxonomy;\n\t}\n\tlet placeholder = null;\n\t// This is fragile because this block is server side rendered and we'll have to\n\t// update the placeholder html if the server side rendering output changes.\n\tconst showPlaceholder =\n\t\t! postId ||\n\t\t! postType ||\n\t\t// When `templateSlug` is set only show placeholder if the post type is not.\n\t\t// This is needed because when we are showing the template in post editor we\n\t\t// want to show the real breadcrumbs if we have the post type.\n\t\t( templateSlug && ! postType ) ||\n\t\t( ! _showTerms && ! isPostTypeHierarchical ) ||\n\t\t( _showTerms && ! hasTermsAssigned );\n\tif ( showPlaceholder ) {\n\t\tconst placeholderItems = [];\n\t\tif ( showHomeItem ) {\n\t\t\tplaceholderItems.push( __( 'Home' ) );\n\t\t}\n\t\tif ( templateSlug && ! postId ) {\n\t\t\tplaceholderItems.push( __( 'Page' ) );\n\t\t} else if ( _showTerms ) {\n\t\t\tplaceholderItems.push( __( 'Category' ) );\n\t\t} else {\n\t\t\tplaceholderItems.push( __( 'Ancestor' ), __( 'Parent' ) );\n\t\t}\n\t\tplaceholder = (\n\t\t\t<nav\n\t\t\t\t{ ...blockProps }\n\t\t\t\tstyle={ {\n\t\t\t\t\t'--separator': `\"${ separator\n\t\t\t\t\t\t.replace( /\\\\/g, '\\\\\\\\' )\n\t\t\t\t\t\t.replace( /\"/g, '\\\\\"' ) }\"`,\n\t\t\t\t\t...blockProps.style,\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<ol>\n\t\t\t\t\t{ placeholderItems.map( ( text, index ) => (\n\t\t\t\t\t\t<li key={ index }>\n\t\t\t\t\t\t\t<a href={ `#breadcrumbs-pseudo-link-${ index }` }>\n\t\t\t\t\t\t\t\t{ text }\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t) ) }\n\t\t\t\t\t{ showCurrentItem && (\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<span aria-current=\"page\">{ __( 'Current' ) }</span>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t) }\n\t\t\t\t</ol>\n\t\t\t</nav>\n\t\t);\n\t}\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\tseparator: separatorDefaultValue,\n\t\t\t\t\t\t\tshowHomeItem: true,\n\t\t\t\t\t\t\tshowCurrentItem: true,\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Show home breadcrumb' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => ! showHomeItem }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tshowHomeItem: true,\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\t\t<ToggleControl\n\t\t\t\t\t\t\tlabel={ __( 'Show home breadcrumb' ) }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { showHomeItem: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tchecked={ showHomeItem }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Show current breadcrumb' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => ! showCurrentItem }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tshowCurrentItem: true,\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\t\t<ToggleControl\n\t\t\t\t\t\t\tlabel={ __( 'Show current breadcrumb' ) }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { showCurrentItem: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tchecked={ showCurrentItem }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Separator' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => separator !== separatorDefaultValue }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tseparator: separatorDefaultValue,\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\t\t<TextControl\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\t\tlabel={ __( 'Separator' ) }\n\t\t\t\t\t\t\tvalue={ separator }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { separator: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonBlur={ () => {\n\t\t\t\t\t\t\t\tif ( ! separator ) {\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tseparator: separatorDefaultValue,\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} }\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<InspectorControls group=\"advanced\">\n\t\t\t\t<CheckboxControl\n\t\t\t\t\tlabel={ __( 'Show on homepage' ) }\n\t\t\t\t\tchecked={ showOnHomePage }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { showOnHomePage: value } )\n\t\t\t\t\t}\n\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t'If this breadcrumbs block appears in a template or template part that\u2019s shown on the homepage, enable this option to display the breadcrumb trail. Otherwise, this setting has no effect.'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t\t<CheckboxControl\n\t\t\t\t\tlabel={ __( 'Prefer taxonomy terms' ) }\n\t\t\t\t\tchecked={ prefersTaxonomy }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { prefersTaxonomy: value } )\n\t\t\t\t\t}\n\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t'The exact type of breadcrumbs shown will vary automatically depending on the page in which this block is displayed. In the specific case of a hierarchical post type with taxonomies, the breadcrumbs can either reflect its post hierarchy (default) or the hierarchy of its assigned taxonomy terms.'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t{ status === 'loading' && ! showPlaceholder && (\n\t\t\t\t<div { ...blockProps }>\n\t\t\t\t\t<Spinner />\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t{ status === 'error' && (\n\t\t\t\t<div { ...blockProps }>\n\t\t\t\t\t<p>\n\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t/* translators: %s: error message returned when rendering the block. */\n\t\t\t\t\t\t\t__( 'Error: %s' ),\n\t\t\t\t\t\t\terror\n\t\t\t\t\t\t) }\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t{ showPlaceholder && placeholder }\n\t\t\t{ ! showPlaceholder && status === 'success' && (\n\t\t\t\t<HtmlRenderer wrapperProps={ blockProps } html={ content } />\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAA4B;AAC5B,0BAAiD;AACjD,wBAOO;AACP,kBAA0B;AAC1B,uBAAmC;AACnC,qBAAoC;AACpC,gCAAoC;AACpC,qBAA4B;AAK5B,mBAA+C;AAC/C,2BAAyB;AA+FrB;AA7FJ,IAAM,wBAAwB;AAEf,SAAR,eAAiC;AAAA,EACvC;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS,EAAE,QAAQ,UAAU,aAAa;AAC3C,GAAI;AACH,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,IAAI;AACJ,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,QAAI;AAAA,IACH,CAAE,WAAY;AACb,UAAK,CAAE,UAAW;AACjB,eAAO,CAAC;AAAA,MACT;AACA,YAAM,QAAQ,OAAQ,iBAAAA,KAAU,EAAE;AAAA,QACjC;AAAA,QACA;AAAA,QACA;AAAA,MACD;AACA,YAAM,iBAAiB,OAAQ,iBAAAA,KAAU,EAAE,YAAa,QAAS;AACjE,YAAM,y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AAC,yCAAkB,OAAM,YACxB;AAAA;AAAA,QAAC;AAAA;AAAA,UACA,WAAQ,gBAAI,kBAAmB;AAAA,UAC/B,SAAU;AAAA,UACV,UAAW,CAAE,UACZ,cAAe,EAAE,gBAAgB,MAAM,CAAE;AAAA,UAE1C,UAAO;AAAA,YACN;AAAA,UACD;AAAA;AAAA,MACD;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACA,WAAQ,gBAAI,uBAAwB;AAAA,UACpC,SAAU;AAAA,UACV,UAAW,CAAE,UACZ,cAAe,EAAE,iBAAiB,MAAM,CAAE;AAAA,UAE3C,UAAO;AAAA,YACN;AAAA,UACD;AAAA;AAAA,MACD;AAAA,OACD;AAAA,IACE,WAAW,aAAa,CAAE,mBAC3B,4CAAC,SAAM,GAAG,YACT,sDAAC,6BAAQ,GACV;AAAA,IAEC,WAAW,WACZ,4CAAC,SAAM,GAAG,YACT,sDAAC,OACE;AAAA;AAAA,UAED,gBAAI,WAAY;AAAA,MAChB;AAAA,IACD,GACD,GACD;AAAA,IAEC,mBAAmB;AAAA,IACnB,CAAE,mBAAmB,WAAW,aACjC,4CAAC,qBAAAC,SAAA,EAAa,cAAe,YAAa,MAAO,SAAU;AAAA,KAE7D;AAEF;",
|
|
6
6
|
"names": ["coreStore", "ToolsPanel", "ToolsPanelItem", "HtmlRenderer"]
|
|
7
7
|
}
|
|
@@ -43,6 +43,7 @@ var import_edit = __toESM(require("./edit.cjs"));
|
|
|
43
43
|
var { name } = import_block.default;
|
|
44
44
|
var settings = {
|
|
45
45
|
icon: import_icons.breadcrumbs,
|
|
46
|
+
example: {},
|
|
46
47
|
edit: import_edit.default
|
|
47
48
|
};
|
|
48
49
|
var init = () => (0, import_init_block.default)({ name, metadata: import_block.default, settings });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/breadcrumbs/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { breadcrumbs } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon: breadcrumbs,\n\tedit,\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,mBAAqB;AACrB,kBAAiB;AAEjB,IAAM,EAAE,KAAK,IAAI,aAAAA;AAIV,IAAM,WAAW;AAAA,EACvB,MAAM;AAAA,EACN,kBAAAC;AACD;AAEO,IAAM,OAAO,UAAM,kBAAAC,SAAW,EAAE,MAAM,uBAAAC,SAAU,SAAS,CAAE;",
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { breadcrumbs } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon: breadcrumbs,\n\texample: {},\n\tedit,\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,mBAAqB;AACrB,kBAAiB;AAEjB,IAAM,EAAE,KAAK,IAAI,aAAAA;AAIV,IAAM,WAAW;AAAA,EACvB,MAAM;AAAA,EACN,SAAS,CAAC;AAAA,EACV,kBAAAC;AACD;AAEO,IAAM,OAAO,UAAM,kBAAAC,SAAW,EAAE,MAAM,uBAAAC,SAAU,SAAS,CAAE;",
|
|
6
6
|
"names": ["metadata", "edit", "initBlock", "metadata"]
|
|
7
7
|
}
|
package/build/button/index.cjs
CHANGED
|
@@ -69,6 +69,9 @@ var settings = {
|
|
|
69
69
|
if (context === "list-view" && (customName || hasContent)) {
|
|
70
70
|
return customName || text;
|
|
71
71
|
}
|
|
72
|
+
if (context === "breadcrumb" && customName) {
|
|
73
|
+
return customName;
|
|
74
|
+
}
|
|
72
75
|
}
|
|
73
76
|
};
|
|
74
77
|
if (window.__experimentalContentOnlyInspectorFields) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/button/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { button as icon } from '@wordpress/icons';\nimport { privateApis as blocksPrivateApis } from '@wordpress/blocks';\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 { unlock } from '../lock-unlock';\n\nconst { fieldsKey, formKey } = unlock( blocksPrivateApis );\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tclassName: 'is-style-fill',\n\t\t\ttext: __( 'Call to action' ),\n\t\t},\n\t},\n\tedit,\n\tsave,\n\tdeprecated,\n\tmerge: ( a, { text = '' } ) => ( {\n\t\t...a,\n\t\ttext: ( a.text || '' ) + text,\n\t} ),\n\t__experimentalLabel( attributes, { context } ) {\n\t\tconst { text } = attributes;\n\n\t\tconst customName = attributes?.metadata?.name;\n\t\tconst hasContent = text?.trim().length > 0;\n\n\t\t// In the list view, use the block's text as the label.\n\t\t// If the text is empty, fall back to the default label.\n\t\tif ( context === 'list-view' && ( customName || hasContent ) ) {\n\t\t\treturn customName || text;\n\t\t}\n\t},\n};\n\nif ( window.__experimentalContentOnlyInspectorFields ) {\n\tsettings[ fieldsKey ] = [\n\t\t{\n\t\t\tid: 'text',\n\t\t\tlabel: __( 'Content' ),\n\t\t\ttype: 'text',\n\t\t\tEdit: 'rich-text', // TODO: replace with custom component\n\t\t},\n\t\t{\n\t\t\tid: 'link',\n\t\t\tlabel: __( 'Link' ),\n\t\t\ttype: 'url',\n\t\t\tEdit: 'link', // TODO: replace with custom component\n\t\t\tgetValue: ( { item } ) => ( {\n\t\t\t\turl: item.url,\n\t\t\t\trel: item.rel,\n\t\t\t\tlinkTarget: item.linkTarget,\n\t\t\t} ),\n\t\t\tsetValue: ( { value } ) => ( {\n\t\t\t\turl: value.url,\n\t\t\t\trel: value.rel,\n\t\t\t\tlinkTarget: value.linkTarget,\n\t\t\t} ),\n\t\t},\n\t];\n\tsettings[ formKey ] = {\n\t\tfields: [ 'text', 'link' ],\n\t};\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,mBAA+B;AAC/B,oBAAiD;AAKjD,wBAAsB;AACtB,wBAAuB;AACvB,kBAAiB;AACjB,mBAAqB;AACrB,kBAAiB;AACjB,yBAAuB;AAEvB,IAAM,EAAE,WAAW,QAAQ,QAAI,2BAAQ,cAAAC,WAAkB;AAEzD,IAAM,EAAE,KAAK,IAAI,aAAAD;AAIV,IAAM,WAAW;AAAA,EACvB,mBAAAE;AAAA,EACA,SAAS;AAAA,IACR,YAAY;AAAA,MACX,WAAW;AAAA,MACX,UAAM,gBAAI,gBAAiB;AAAA,IAC5B;AAAA,EACD;AAAA,EACA,kBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,8BAAAC;AAAA,EACA,OAAO,CAAE,GAAG,EAAE,OAAO,GAAG,OAAS;AAAA,IAChC,GAAG;AAAA,IACH,OAAQ,EAAE,QAAQ,MAAO;AAAA,EAC1B;AAAA,EACA,oBAAqB,YAAY,EAAE,QAAQ,GAAI;AAC9C,UAAM,EAAE,KAAK,IAAI;AAEjB,UAAM,aAAa,YAAY,UAAU;AACzC,UAAM,aAAa,MAAM,KAAK,EAAE,SAAS;AAIzC,QAAK,YAAY,gBAAiB,cAAc,aAAe;AAC9D,aAAO,cAAc;AAAA,IACtB;AAAA,EACD;AACD;AAEA,IAAK,OAAO,0CAA2C;AACtD,WAAU,SAAU,IAAI;AAAA,IACvB;AAAA,MACC,IAAI;AAAA,MACJ,WAAO,gBAAI,SAAU;AAAA,MACrB,MAAM;AAAA,MACN,MAAM;AAAA;AAAA,IACP;AAAA,IACA;AAAA,MACC,IAAI;AAAA,MACJ,WAAO,gBAAI,MAAO;AAAA,MAClB,MAAM;AAAA,MACN,MAAM;AAAA;AAAA,MACN,UAAU,CAAE,EAAE,KAAK,OAAS;AAAA,QAC3B,KAAK,KAAK;AAAA,QACV,KAAK,KAAK;AAAA,QACV,YAAY,KAAK;AAAA,MAClB;AAAA,MACA,UAAU,CAAE,EAAE,MAAM,OAAS;AAAA,QAC5B,KAAK,MAAM;AAAA,QACX,KAAK,MAAM;AAAA,QACX,YAAY,MAAM;AAAA,MACnB;AAAA,IACD;AAAA,EACD;AACA,WAAU,OAAQ,IAAI;AAAA,IACrB,QAAQ,CAAE,QAAQ,MAAO;AAAA,EAC1B;AACD;AAEO,IAAM,OAAO,UAAM,kBAAAC,SAAW,EAAE,MAAM,uBAAAC,SAAU,SAAS,CAAE;",
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { button as icon } from '@wordpress/icons';\nimport { privateApis as blocksPrivateApis } from '@wordpress/blocks';\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 { unlock } from '../lock-unlock';\n\nconst { fieldsKey, formKey } = unlock( blocksPrivateApis );\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tclassName: 'is-style-fill',\n\t\t\ttext: __( 'Call to action' ),\n\t\t},\n\t},\n\tedit,\n\tsave,\n\tdeprecated,\n\tmerge: ( a, { text = '' } ) => ( {\n\t\t...a,\n\t\ttext: ( a.text || '' ) + text,\n\t} ),\n\t__experimentalLabel( attributes, { context } ) {\n\t\tconst { text } = attributes;\n\n\t\tconst customName = attributes?.metadata?.name;\n\t\tconst hasContent = text?.trim().length > 0;\n\n\t\t// In the list view, use the block's text as the label.\n\t\t// If the text is empty, fall back to the default label.\n\t\tif ( context === 'list-view' && ( customName || hasContent ) ) {\n\t\t\treturn customName || text;\n\t\t}\n\n\t\tif ( context === 'breadcrumb' && customName ) {\n\t\t\treturn customName;\n\t\t}\n\t},\n};\n\nif ( window.__experimentalContentOnlyInspectorFields ) {\n\tsettings[ fieldsKey ] = [\n\t\t{\n\t\t\tid: 'text',\n\t\t\tlabel: __( 'Content' ),\n\t\t\ttype: 'text',\n\t\t\tEdit: 'rich-text', // TODO: replace with custom component\n\t\t},\n\t\t{\n\t\t\tid: 'link',\n\t\t\tlabel: __( 'Link' ),\n\t\t\ttype: 'url',\n\t\t\tEdit: 'link', // TODO: replace with custom component\n\t\t\tgetValue: ( { item } ) => ( {\n\t\t\t\turl: item.url,\n\t\t\t\trel: item.rel,\n\t\t\t\tlinkTarget: item.linkTarget,\n\t\t\t} ),\n\t\t\tsetValue: ( { value } ) => ( {\n\t\t\t\turl: value.url,\n\t\t\t\trel: value.rel,\n\t\t\t\tlinkTarget: value.linkTarget,\n\t\t\t} ),\n\t\t},\n\t];\n\tsettings[ formKey ] = {\n\t\tfields: [ 'text', 'link' ],\n\t};\n}\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,+BAAAA;AAAA,EAAA;AAAA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AAK;AAAA,MAClB;AAAA,MACA,UAAU,CAAE,EAAE,MAAM,OAAS;AAAA,QAC5B,KAAK,MAAM;AAAA,QACX,KAAK,MAAM;AAAA,QACX,YAAY,MAAM;AAAA,MACnB;AAAA,IACD;AAAA,EACD;AACA,WAAU,OAAQ,IAAI;AAAA,IACrB,QAAQ,CAAE,QAAQ,MAAO;AAAA,EAC1B;AACD;AAEO,IAAM,OAAO,UAAM,kBAAAC,SAAW,EAAE,MAAM,uBAAAC,SAAU,SAAS,CAAE;",
|
|
6
6
|
"names": ["metadata", "blocksPrivateApis", "icon", "edit", "save", "deprecated", "initBlock", "metadata"]
|
|
7
7
|
}
|
|
@@ -12,9 +12,6 @@
|
|
|
12
12
|
"linkTarget": {
|
|
13
13
|
"type": "string",
|
|
14
14
|
"default": "_self"
|
|
15
|
-
},
|
|
16
|
-
"textAlign": {
|
|
17
|
-
"type": "string"
|
|
18
15
|
}
|
|
19
16
|
},
|
|
20
17
|
"supports": {
|
|
@@ -40,6 +37,7 @@
|
|
|
40
37
|
"typography": {
|
|
41
38
|
"fontSize": true,
|
|
42
39
|
"lineHeight": true,
|
|
40
|
+
"textAlign": true,
|
|
43
41
|
"__experimentalFontFamily": true,
|
|
44
42
|
"__experimentalFontWeight": true,
|
|
45
43
|
"__experimentalFontStyle": true,
|
|
@@ -0,0 +1,91 @@
|
|
|
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/comment-edit-link/deprecated.js
|
|
31
|
+
var deprecated_exports = {};
|
|
32
|
+
__export(deprecated_exports, {
|
|
33
|
+
default: () => deprecated_default
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(deprecated_exports);
|
|
36
|
+
var import_migrate_text_align = __toESM(require("../utils/migrate-text-align.cjs"));
|
|
37
|
+
var v1 = {
|
|
38
|
+
attributes: {
|
|
39
|
+
linkTarget: {
|
|
40
|
+
type: "string",
|
|
41
|
+
default: "_self"
|
|
42
|
+
},
|
|
43
|
+
textAlign: {
|
|
44
|
+
type: "string"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
usesContext: ["commentId"],
|
|
48
|
+
supports: {
|
|
49
|
+
anchor: true,
|
|
50
|
+
html: false,
|
|
51
|
+
color: {
|
|
52
|
+
link: true,
|
|
53
|
+
gradients: true,
|
|
54
|
+
text: false
|
|
55
|
+
},
|
|
56
|
+
spacing: {
|
|
57
|
+
margin: true,
|
|
58
|
+
padding: true
|
|
59
|
+
},
|
|
60
|
+
typography: {
|
|
61
|
+
fontSize: true,
|
|
62
|
+
lineHeight: true,
|
|
63
|
+
__experimentalFontFamily: true,
|
|
64
|
+
__experimentalFontWeight: true,
|
|
65
|
+
__experimentalFontStyle: true,
|
|
66
|
+
__experimentalTextTransform: true,
|
|
67
|
+
__experimentalTextDecoration: true,
|
|
68
|
+
__experimentalLetterSpacing: true
|
|
69
|
+
},
|
|
70
|
+
interactivity: {
|
|
71
|
+
clientNavigation: true
|
|
72
|
+
},
|
|
73
|
+
__experimentalBorder: {
|
|
74
|
+
radius: true,
|
|
75
|
+
color: true,
|
|
76
|
+
width: true,
|
|
77
|
+
style: true
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
save() {
|
|
81
|
+
return null;
|
|
82
|
+
},
|
|
83
|
+
migrate: import_migrate_text_align.default,
|
|
84
|
+
isEligible(attributes) {
|
|
85
|
+
return !!attributes.textAlign || !!attributes.className?.match(
|
|
86
|
+
/\bhas-text-align-(left|center|right)\b/
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
var deprecated_default = [v1];
|
|
91
|
+
//# sourceMappingURL=deprecated.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/comment-edit-link/deprecated.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport migrateTextAlign from '../utils/migrate-text-align';\n\nconst v1 = {\n\tattributes: {\n\t\tlinkTarget: {\n\t\t\ttype: 'string',\n\t\t\tdefault: '_self',\n\t\t},\n\t\ttextAlign: {\n\t\t\ttype: 'string',\n\t\t},\n\t},\n\tusesContext: [ 'commentId' ],\n\tsupports: {\n\t\tanchor: true,\n\t\thtml: false,\n\t\tcolor: {\n\t\t\tlink: true,\n\t\t\tgradients: true,\n\t\t\ttext: false,\n\t\t},\n\t\tspacing: {\n\t\t\tmargin: true,\n\t\t\tpadding: true,\n\t\t},\n\t\ttypography: {\n\t\t\tfontSize: true,\n\t\t\tlineHeight: true,\n\t\t\t__experimentalFontFamily: true,\n\t\t\t__experimentalFontWeight: true,\n\t\t\t__experimentalFontStyle: true,\n\t\t\t__experimentalTextTransform: true,\n\t\t\t__experimentalTextDecoration: true,\n\t\t\t__experimentalLetterSpacing: true,\n\t\t},\n\t\tinteractivity: {\n\t\t\tclientNavigation: true,\n\t\t},\n\t\t__experimentalBorder: {\n\t\t\tradius: true,\n\t\t\tcolor: true,\n\t\t\twidth: true,\n\t\t\tstyle: true,\n\t\t},\n\t},\n\tsave() {\n\t\treturn null;\n\t},\n\tmigrate: migrateTextAlign,\n\tisEligible( attributes ) {\n\t\treturn (\n\t\t\t!! attributes.textAlign ||\n\t\t\t!! attributes.className?.match(\n\t\t\t\t/\\bhas-text-align-(left|center|right)\\b/\n\t\t\t)\n\t\t);\n\t},\n};\n\nexport default [ v1 ];\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,gCAA6B;AAE7B,IAAM,KAAK;AAAA,EACV,YAAY;AAAA,IACX,YAAY;AAAA,MACX,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA,IACA,WAAW;AAAA,MACV,MAAM;AAAA,IACP;AAAA,EACD;AAAA,EACA,aAAa,CAAE,WAAY;AAAA,EAC3B,UAAU;AAAA,IACT,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,OAAO;AAAA,MACN,MAAM;AAAA,MACN,WAAW;AAAA,MACX,MAAM;AAAA,IACP;AAAA,IACA,SAAS;AAAA,MACR,QAAQ;AAAA,MACR,SAAS;AAAA,IACV;AAAA,IACA,YAAY;AAAA,MACX,UAAU;AAAA,MACV,YAAY;AAAA,MACZ,0BAA0B;AAAA,MAC1B,0BAA0B;AAAA,MAC1B,yBAAyB;AAAA,MACzB,6BAA6B;AAAA,MAC7B,8BAA8B;AAAA,MAC9B,6BAA6B;AAAA,IAC9B;AAAA,IACA,eAAe;AAAA,MACd,kBAAkB;AAAA,IACnB;AAAA,IACA,sBAAsB;AAAA,MACrB,QAAQ;AAAA,MACR,OAAO;AAAA,MACP,OAAO;AAAA,MACP,OAAO;AAAA,IACR;AAAA,EACD;AAAA,EACA,OAAO;AACN,WAAO;AAAA,EACR;AAAA,EACA,SAAS,0BAAAA;AAAA,EACT,WAAY,YAAa;AACxB,WACC,CAAC,CAAE,WAAW,aACd,CAAC,CAAE,WAAW,WAAW;AAAA,MACxB;AAAA,IACD;AAAA,EAEF;AACD;AAEA,IAAO,qBAAQ,CAAE,EAAG;",
|
|
6
|
+
"names": ["migrateTextAlign"]
|
|
7
|
+
}
|
|
@@ -33,29 +33,18 @@ __export(edit_exports, {
|
|
|
33
33
|
default: () => Edit
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(edit_exports);
|
|
36
|
-
var import_clsx = __toESM(require("clsx"));
|
|
37
36
|
var import_block_editor = require("@wordpress/block-editor");
|
|
38
37
|
var import_components = require("@wordpress/components");
|
|
39
38
|
var import_i18n = require("@wordpress/i18n");
|
|
40
39
|
var import_hooks = require("../utils/hooks.cjs");
|
|
40
|
+
var import_deprecated_text_align_attributes = __toESM(require("../utils/deprecated-text-align-attributes.cjs"));
|
|
41
41
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
42
|
-
function Edit({
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const blockProps = (0, import_block_editor.useBlockProps)(
|
|
47
|
-
className: (0, import_clsx.default)({
|
|
48
|
-
[`has-text-align-${textAlign}`]: textAlign
|
|
49
|
-
})
|
|
50
|
-
});
|
|
42
|
+
function Edit(props) {
|
|
43
|
+
const { attributes, setAttributes } = props;
|
|
44
|
+
const { linkTarget } = attributes;
|
|
45
|
+
(0, import_deprecated_text_align_attributes.default)(props);
|
|
46
|
+
const blockProps = (0, import_block_editor.useBlockProps)();
|
|
51
47
|
const dropdownMenuProps = (0, import_hooks.useToolsPanelDropdownMenuProps)();
|
|
52
|
-
const blockControls = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.BlockControls, { group: "block", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
53
|
-
import_block_editor.AlignmentControl,
|
|
54
|
-
{
|
|
55
|
-
value: textAlign,
|
|
56
|
-
onChange: (newAlign) => setAttributes({ textAlign: newAlign })
|
|
57
|
-
}
|
|
58
|
-
) });
|
|
59
48
|
const inspectorControls = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
60
49
|
import_components.__experimentalToolsPanel,
|
|
61
50
|
{
|
|
@@ -88,7 +77,6 @@ function Edit({
|
|
|
88
77
|
}
|
|
89
78
|
) });
|
|
90
79
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
91
|
-
blockControls,
|
|
92
80
|
inspectorControls,
|
|
93
81
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
94
82
|
"a",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/comment-edit-link/edit.js"],
|
|
4
|
-
"sourcesContent": ["/**\n *
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,
|
|
6
|
-
"names": ["
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { InspectorControls, useBlockProps } from '@wordpress/block-editor';\nimport {\n\tToggleControl,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\nimport useDeprecatedTextAlign from '../utils/deprecated-text-align-attributes';\n\nexport default function Edit( props ) {\n\tconst { attributes, setAttributes } = props;\n\tconst { linkTarget } = attributes;\n\tuseDeprecatedTextAlign( props );\n\tconst blockProps = useBlockProps();\n\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tconst inspectorControls = (\n\t\t<InspectorControls>\n\t\t\t<ToolsPanel\n\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\tresetAll={ () => {\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\tlinkTarget: '_self',\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t>\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\tlabel={ __( 'Open in new tab' ) }\n\t\t\t\t\tisShownByDefault\n\t\t\t\t\thasValue={ () => linkTarget === '_blank' }\n\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\tsetAttributes( { linkTarget: '_self' } )\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\tlabel={ __( 'Open in new tab' ) }\n\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tlinkTarget: value ? '_blank' : '_self',\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tchecked={ linkTarget === '_blank' }\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t</ToolsPanel>\n\t\t</InspectorControls>\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t{ inspectorControls }\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<a\n\t\t\t\t\thref=\"#edit-comment-pseudo-link\"\n\t\t\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\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D;AAEF;",
|
|
6
|
+
"names": ["useDeprecatedTextAlign", "ToolsPanel", "ToolsPanelItem"]
|
|
7
7
|
}
|
|
@@ -40,10 +40,12 @@ var import_icons = require("@wordpress/icons");
|
|
|
40
40
|
var import_init_block = __toESM(require("../utils/init-block.cjs"));
|
|
41
41
|
var import_block = __toESM(require("./block.json"));
|
|
42
42
|
var import_edit = __toESM(require("./edit.cjs"));
|
|
43
|
+
var import_deprecated = __toESM(require("./deprecated.cjs"));
|
|
43
44
|
var { name } = import_block.default;
|
|
44
45
|
var settings = {
|
|
45
46
|
icon: import_icons.commentEditLink,
|
|
46
47
|
edit: import_edit.default,
|
|
48
|
+
deprecated: import_deprecated.default,
|
|
47
49
|
example: {}
|
|
48
50
|
};
|
|
49
51
|
var init = () => (0, import_init_block.default)({ name, metadata: import_block.default, settings });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/comment-edit-link/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { commentEditLink as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\texample: {},\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,+BAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAGA,mBAAwC;AAKxC,wBAAsB;AACtB,mBAAqB;AACrB,kBAAiB;
|
|
6
|
-
"names": ["metadata", "icon", "edit", "initBlock", "metadata"]
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { commentEditLink as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport deprecated from './deprecated';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\tdeprecated,\n\texample: {},\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,+BAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAGA,mBAAwC;AAKxC,wBAAsB;AACtB,mBAAqB;AACrB,kBAAiB;AACjB,wBAAuB;AAEvB,IAAM,EAAE,KAAK,IAAI,aAAAA;AAGV,IAAM,WAAW;AAAA,EACvB,mBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,8BAAAC;AAAA,EACA,SAAS,CAAC;AACX;AAEO,IAAM,OAAO,UAAM,kBAAAC,SAAW,EAAE,MAAM,uBAAAC,SAAU,SAAS,CAAE;",
|
|
6
|
+
"names": ["metadata", "icon", "edit", "deprecated", "initBlock", "metadata"]
|
|
7
7
|
}
|
|
@@ -8,11 +8,6 @@
|
|
|
8
8
|
"description": "Displays a link to reply to a comment.",
|
|
9
9
|
"textdomain": "default",
|
|
10
10
|
"usesContext": [ "commentId" ],
|
|
11
|
-
"attributes": {
|
|
12
|
-
"textAlign": {
|
|
13
|
-
"type": "string"
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
11
|
"supports": {
|
|
17
12
|
"anchor": true,
|
|
18
13
|
"color": {
|
|
@@ -35,6 +30,7 @@
|
|
|
35
30
|
"typography": {
|
|
36
31
|
"fontSize": true,
|
|
37
32
|
"lineHeight": true,
|
|
33
|
+
"textAlign": true,
|
|
38
34
|
"__experimentalFontFamily": true,
|
|
39
35
|
"__experimentalFontWeight": true,
|
|
40
36
|
"__experimentalFontStyle": true,
|
|
@@ -0,0 +1,84 @@
|
|
|
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/comment-reply-link/deprecated.js
|
|
31
|
+
var deprecated_exports = {};
|
|
32
|
+
__export(deprecated_exports, {
|
|
33
|
+
default: () => deprecated_default
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(deprecated_exports);
|
|
36
|
+
var import_migrate_text_align = __toESM(require("../utils/migrate-text-align.cjs"));
|
|
37
|
+
var v1 = {
|
|
38
|
+
attributes: {
|
|
39
|
+
textAlign: {
|
|
40
|
+
type: "string"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
usesContext: ["commentId"],
|
|
44
|
+
supports: {
|
|
45
|
+
anchor: true,
|
|
46
|
+
color: {
|
|
47
|
+
gradients: true,
|
|
48
|
+
link: true,
|
|
49
|
+
text: false
|
|
50
|
+
},
|
|
51
|
+
spacing: {
|
|
52
|
+
margin: true,
|
|
53
|
+
padding: true
|
|
54
|
+
},
|
|
55
|
+
typography: {
|
|
56
|
+
fontSize: true,
|
|
57
|
+
lineHeight: true,
|
|
58
|
+
__experimentalFontFamily: true,
|
|
59
|
+
__experimentalFontWeight: true,
|
|
60
|
+
__experimentalFontStyle: true,
|
|
61
|
+
__experimentalTextTransform: true,
|
|
62
|
+
__experimentalTextDecoration: true,
|
|
63
|
+
__experimentalLetterSpacing: true
|
|
64
|
+
},
|
|
65
|
+
__experimentalBorder: {
|
|
66
|
+
radius: true,
|
|
67
|
+
color: true,
|
|
68
|
+
width: true,
|
|
69
|
+
style: true
|
|
70
|
+
},
|
|
71
|
+
html: false
|
|
72
|
+
},
|
|
73
|
+
save() {
|
|
74
|
+
return null;
|
|
75
|
+
},
|
|
76
|
+
migrate: import_migrate_text_align.default,
|
|
77
|
+
isEligible(attributes) {
|
|
78
|
+
return !!attributes.textAlign || !!attributes.className?.match(
|
|
79
|
+
/\bhas-text-align-(left|center|right)\b/
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
var deprecated_default = [v1];
|
|
84
|
+
//# sourceMappingURL=deprecated.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/comment-reply-link/deprecated.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport migrateTextAlign from '../utils/migrate-text-align';\n\nconst v1 = {\n\tattributes: {\n\t\ttextAlign: {\n\t\t\ttype: 'string',\n\t\t},\n\t},\n\tusesContext: [ 'commentId' ],\n\tsupports: {\n\t\tanchor: true,\n\t\tcolor: {\n\t\t\tgradients: true,\n\t\t\tlink: true,\n\t\t\ttext: false,\n\t\t},\n\t\tspacing: {\n\t\t\tmargin: true,\n\t\t\tpadding: true,\n\t\t},\n\t\ttypography: {\n\t\t\tfontSize: true,\n\t\t\tlineHeight: true,\n\t\t\t__experimentalFontFamily: true,\n\t\t\t__experimentalFontWeight: true,\n\t\t\t__experimentalFontStyle: true,\n\t\t\t__experimentalTextTransform: true,\n\t\t\t__experimentalTextDecoration: true,\n\t\t\t__experimentalLetterSpacing: true,\n\t\t},\n\t\t__experimentalBorder: {\n\t\t\tradius: true,\n\t\t\tcolor: true,\n\t\t\twidth: true,\n\t\t\tstyle: true,\n\t\t},\n\t\thtml: false,\n\t},\n\tsave() {\n\t\treturn null;\n\t},\n\tmigrate: migrateTextAlign,\n\tisEligible( attributes ) {\n\t\treturn (\n\t\t\t!! attributes.textAlign ||\n\t\t\t!! attributes.className?.match(\n\t\t\t\t/\\bhas-text-align-(left|center|right)\\b/\n\t\t\t)\n\t\t);\n\t},\n};\n\nexport default [ v1 ];\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,gCAA6B;AAE7B,IAAM,KAAK;AAAA,EACV,YAAY;AAAA,IACX,WAAW;AAAA,MACV,MAAM;AAAA,IACP;AAAA,EACD;AAAA,EACA,aAAa,CAAE,WAAY;AAAA,EAC3B,UAAU;AAAA,IACT,QAAQ;AAAA,IACR,OAAO;AAAA,MACN,WAAW;AAAA,MACX,MAAM;AAAA,MACN,MAAM;AAAA,IACP;AAAA,IACA,SAAS;AAAA,MACR,QAAQ;AAAA,MACR,SAAS;AAAA,IACV;AAAA,IACA,YAAY;AAAA,MACX,UAAU;AAAA,MACV,YAAY;AAAA,MACZ,0BAA0B;AAAA,MAC1B,0BAA0B;AAAA,MAC1B,yBAAyB;AAAA,MACzB,6BAA6B;AAAA,MAC7B,8BAA8B;AAAA,MAC9B,6BAA6B;AAAA,IAC9B;AAAA,IACA,sBAAsB;AAAA,MACrB,QAAQ;AAAA,MACR,OAAO;AAAA,MACP,OAAO;AAAA,MACP,OAAO;AAAA,IACR;AAAA,IACA,MAAM;AAAA,EACP;AAAA,EACA,OAAO;AACN,WAAO;AAAA,EACR;AAAA,EACA,SAAS,0BAAAA;AAAA,EACT,WAAY,YAAa;AACxB,WACC,CAAC,CAAE,WAAW,aACd,CAAC,CAAE,WAAW,WAAW;AAAA,MACxB;AAAA,IACD;AAAA,EAEF;AACD;AAEA,IAAO,qBAAQ,CAAE,EAAG;",
|
|
6
|
+
"names": ["migrateTextAlign"]
|
|
7
|
+
}
|
|
@@ -33,34 +33,21 @@ __export(edit_exports, {
|
|
|
33
33
|
default: () => edit_default
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(edit_exports);
|
|
36
|
-
var import_clsx = __toESM(require("clsx"));
|
|
37
36
|
var import_i18n = require("@wordpress/i18n");
|
|
38
37
|
var import_block_editor = require("@wordpress/block-editor");
|
|
38
|
+
var import_deprecated_text_align_attributes = __toESM(require("../utils/deprecated-text-align-attributes.cjs"));
|
|
39
39
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
40
|
-
function Edit(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
});
|
|
46
|
-
const blockControls = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.BlockControls, { group: "block", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
47
|
-
import_block_editor.AlignmentControl,
|
|
40
|
+
function Edit(props) {
|
|
41
|
+
(0, import_deprecated_text_align_attributes.default)(props);
|
|
42
|
+
const blockProps = (0, import_block_editor.useBlockProps)();
|
|
43
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
44
|
+
"a",
|
|
48
45
|
{
|
|
49
|
-
|
|
50
|
-
|
|
46
|
+
href: "#comment-reply-pseudo-link",
|
|
47
|
+
onClick: (event) => event.preventDefault(),
|
|
48
|
+
children: (0, import_i18n.__)("Reply")
|
|
51
49
|
}
|
|
52
|
-
) });
|
|
53
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
54
|
-
blockControls,
|
|
55
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
56
|
-
"a",
|
|
57
|
-
{
|
|
58
|
-
href: "#comment-reply-pseudo-link",
|
|
59
|
-
onClick: (event) => event.preventDefault(),
|
|
60
|
-
children: (0, import_i18n.__)("Reply")
|
|
61
|
-
}
|
|
62
|
-
) })
|
|
63
|
-
] });
|
|
50
|
+
) }) });
|
|
64
51
|
}
|
|
65
52
|
var edit_default = Edit;
|
|
66
53
|
//# sourceMappingURL=edit.cjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/comment-reply-link/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 { useBlockProps } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport useDeprecatedTextAlign from '../utils/deprecated-text-align-attributes';\n\nfunction Edit( props ) {\n\tuseDeprecatedTextAlign( props );\n\tconst blockProps = useBlockProps();\n\n\treturn (\n\t\t<>\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<a\n\t\t\t\t\thref=\"#comment-reply-pseudo-link\"\n\t\t\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Reply' ) }\n\t\t\t\t</a>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default Edit;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AACnB,0BAA8B;AAK9B,8CAAmC;AAOjC;AALF,SAAS,KAAM,OAAQ;AACtB,8CAAAA,SAAwB,KAAM;AAC9B,QAAM,iBAAa,mCAAc;AAEjC,SACC,2EACC,sDAAC,SAAM,GAAG,YACT;AAAA,IAAC;AAAA;AAAA,MACA,MAAK;AAAA,MACL,SAAU,CAAE,UAAW,MAAM,eAAe;AAAA,MAE1C,8BAAI,OAAQ;AAAA;AAAA,EACf,GACD,GACD;AAEF;AAEA,IAAO,eAAQ;",
|
|
6
|
+
"names": ["useDeprecatedTextAlign"]
|
|
7
7
|
}
|
|
@@ -40,10 +40,12 @@ var import_icons = require("@wordpress/icons");
|
|
|
40
40
|
var import_init_block = __toESM(require("../utils/init-block.cjs"));
|
|
41
41
|
var import_block = __toESM(require("./block.json"));
|
|
42
42
|
var import_edit = __toESM(require("./edit.cjs"));
|
|
43
|
+
var import_deprecated = __toESM(require("./deprecated.cjs"));
|
|
43
44
|
var { name } = import_block.default;
|
|
44
45
|
var settings = {
|
|
45
46
|
edit: import_edit.default,
|
|
46
47
|
icon: import_icons.commentReplyLink,
|
|
48
|
+
deprecated: import_deprecated.default,
|
|
47
49
|
example: {}
|
|
48
50
|
};
|
|
49
51
|
var init = () => (0, import_init_block.default)({ name, metadata: import_block.default, settings });
|