@wordpress/editor 13.33.0 → 13.35.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 -4
- package/README.md +132 -20
- package/build/bindings/pattern-overrides.js +70 -1
- package/build/bindings/pattern-overrides.js.map +1 -1
- package/build/components/autosave-monitor/index.js +15 -12
- package/build/components/autosave-monitor/index.js.map +1 -1
- package/build/components/block-settings-menu/content-only-settings-menu.js +126 -0
- package/build/components/block-settings-menu/content-only-settings-menu.js.map +1 -0
- package/build/components/block-settings-menu/content-only-settings-menu.native.js +11 -0
- package/build/components/block-settings-menu/content-only-settings-menu.native.js.map +1 -0
- package/build/components/character-count/index.js +5 -0
- package/build/components/character-count/index.js.map +1 -1
- package/build/components/collapsible-block-toolbar/index.js +73 -0
- package/build/components/collapsible-block-toolbar/index.js.map +1 -0
- package/build/components/document-bar/index.js +2 -2
- package/build/components/document-bar/index.js.map +1 -1
- package/build/components/document-outline/check.js +8 -0
- package/build/components/document-outline/check.js.map +1 -1
- package/build/components/document-outline/index.js +11 -0
- package/build/components/document-outline/index.js.map +1 -1
- package/build/components/document-outline/item.js +2 -2
- package/build/components/document-outline/item.js.map +1 -1
- package/build/components/document-tools/index.js +15 -25
- package/build/components/document-tools/index.js.map +1 -1
- package/build/components/editor-canvas/edit-template-blocks-notification.js +1 -1
- package/build/components/editor-canvas/edit-template-blocks-notification.js.map +1 -1
- package/build/components/editor-canvas/index.js +19 -8
- package/build/components/editor-canvas/index.js.map +1 -1
- package/build/components/editor-history/redo.js +11 -0
- package/build/components/editor-history/redo.js.map +1 -1
- package/build/components/editor-history/undo.js +11 -0
- package/build/components/editor-history/undo.js.map +1 -1
- package/build/components/editor-snackbars/index.js +6 -0
- package/build/components/editor-snackbars/index.js.map +1 -1
- package/build/components/global-keyboard-shortcuts/index.js +7 -0
- package/build/components/global-keyboard-shortcuts/index.js.map +1 -1
- package/build/components/global-keyboard-shortcuts/register-shortcuts.js +35 -1
- package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
- package/build/components/global-styles-provider/index.js +130 -0
- package/build/components/global-styles-provider/index.js.map +1 -0
- package/build/components/header/index.js +147 -0
- package/build/components/header/index.js.map +1 -0
- package/build/components/inserter-sidebar/index.js +56 -34
- package/build/components/inserter-sidebar/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/config.js +4 -0
- package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +2 -2
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/list-view-sidebar/index.js +1 -1
- package/build/components/list-view-sidebar/index.js.map +1 -1
- package/build/components/more-menu/copy-content-menu-item.js +59 -0
- package/build/components/more-menu/copy-content-menu-item.js.map +1 -0
- package/build/components/more-menu/index.js +119 -0
- package/build/components/more-menu/index.js.map +1 -0
- package/build/components/more-menu/tools-more-menu-group.js +23 -0
- package/build/components/more-menu/tools-more-menu-group.js.map +1 -0
- package/build/components/more-menu/view-more-menu-group.js +24 -0
- package/build/components/more-menu/view-more-menu-group.js.map +1 -0
- package/build/components/page-attributes/check.js +8 -0
- package/build/components/page-attributes/check.js.map +1 -1
- package/build/components/page-attributes/order.js +7 -0
- package/build/components/page-attributes/order.js.map +1 -1
- package/build/components/page-attributes/panel.js +14 -8
- package/build/components/page-attributes/panel.js.map +1 -1
- package/build/components/page-attributes/parent.js +7 -0
- package/build/components/page-attributes/parent.js.map +1 -1
- package/build/components/plugin-post-publish-panel/index.js +1 -1
- package/build/components/plugin-post-publish-panel/index.js.map +1 -1
- package/build/components/plugin-pre-publish-panel/index.js +1 -1
- package/build/components/plugin-pre-publish-panel/index.js.map +1 -1
- package/build/components/plugin-sidebar/index.js +1 -1
- package/build/components/plugin-sidebar/index.js.map +1 -1
- package/build/components/post-actions/actions.js +219 -66
- package/build/components/post-actions/actions.js.map +1 -1
- package/build/components/post-actions/index.js +32 -16
- package/build/components/post-actions/index.js.map +1 -1
- package/build/components/post-author/check.js +9 -0
- package/build/components/post-author/check.js.map +1 -1
- package/build/components/post-author/index.js +6 -0
- package/build/components/post-author/index.js.map +1 -1
- package/build/components/post-author/panel.js +5 -0
- package/build/components/post-author/panel.js.map +1 -1
- package/build/components/post-card-panel/index.js +7 -66
- package/build/components/post-card-panel/index.js.map +1 -1
- package/build/components/post-comments/index.js +28 -8
- package/build/components/post-comments/index.js.map +1 -1
- package/build/components/post-content-information/index.js +72 -0
- package/build/components/post-content-information/index.js.map +1 -0
- package/build/components/post-discussion/panel.js +104 -20
- package/build/components/post-discussion/panel.js.map +1 -1
- package/build/components/post-excerpt/check.js +0 -19
- package/build/components/post-excerpt/check.js.map +1 -1
- package/build/components/post-excerpt/index.js +52 -12
- package/build/components/post-excerpt/index.js.map +1 -1
- package/build/components/post-excerpt/panel.js +118 -7
- package/build/components/post-excerpt/panel.js.map +1 -1
- package/build/components/post-excerpt/plugin.js +2 -2
- package/build/components/post-excerpt/plugin.js.map +1 -1
- package/build/components/post-featured-image/index.js +1 -1
- package/build/components/post-featured-image/index.js.map +1 -1
- package/build/components/post-format/panel.js +27 -0
- package/build/components/post-format/panel.js.map +1 -0
- package/build/components/post-last-edited-panel/index.js +33 -0
- package/build/components/post-last-edited-panel/index.js.map +1 -0
- package/build/components/post-panel-row/index.js +2 -2
- package/build/components/post-panel-row/index.js.map +1 -1
- package/build/components/post-panel-section/index.js +28 -0
- package/build/components/post-panel-section/index.js.map +1 -0
- package/build/components/post-pingbacks/index.js +5 -2
- package/build/components/post-pingbacks/index.js.map +1 -1
- package/build/components/post-publish-button/post-publish-button-or-toggle.js +100 -0
- package/build/components/post-publish-button/post-publish-button-or-toggle.js.map +1 -0
- package/build/components/post-saved-state/index.js +2 -2
- package/build/components/post-saved-state/index.js.map +1 -1
- package/build/components/post-schedule/panel.js +1 -1
- package/build/components/post-schedule/panel.js.map +1 -1
- package/build/components/post-slug/panel.js +27 -0
- package/build/components/post-slug/panel.js.map +1 -0
- package/build/components/post-status/index.js +13 -13
- package/build/components/post-status/index.js.map +1 -1
- package/build/components/post-sticky/panel.js +21 -0
- package/build/components/post-sticky/panel.js.map +1 -0
- package/build/components/post-template/block-theme.js +2 -2
- package/build/components/post-template/block-theme.js.map +1 -1
- package/build/components/post-template/classic-theme.js +0 -1
- package/build/components/post-template/classic-theme.js.map +1 -1
- package/build/components/post-template/swap-template-button.js +2 -5
- package/build/components/post-template/swap-template-button.js.map +1 -1
- package/build/components/post-title/index.js +2 -2
- package/build/components/post-title/index.js.map +1 -1
- package/build/components/post-title/post-title-raw.js +2 -2
- package/build/components/post-title/post-title-raw.js.map +1 -1
- package/build/components/post-transform-panel/hooks.js +90 -0
- package/build/components/post-transform-panel/hooks.js.map +1 -0
- package/build/components/post-transform-panel/index.js +101 -0
- package/build/components/post-transform-panel/index.js.map +1 -0
- package/build/components/post-trash/panel.js +18 -0
- package/build/components/post-trash/panel.js.map +1 -0
- package/build/components/post-type-support-check/index.js +1 -1
- package/build/components/post-type-support-check/index.js.map +1 -1
- package/build/components/post-url/index.js +2 -1
- package/build/components/post-url/index.js.map +1 -1
- package/build/components/post-url/panel.js +1 -1
- package/build/components/post-url/panel.js.map +1 -1
- package/build/components/preferences-modal/enable-publish-sidebar.js +34 -0
- package/build/components/preferences-modal/enable-publish-sidebar.js.map +1 -0
- package/build/components/preferences-modal/index.js +11 -5
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/preview-dropdown/index.js +3 -1
- package/build/components/preview-dropdown/index.js.map +1 -1
- package/build/components/provider/disable-non-page-content-blocks.js +23 -16
- package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
- package/build/components/provider/index.js +3 -1
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.js +21 -3
- package/build/components/provider/use-block-editor-settings.js.map +1 -1
- package/build/components/save-publish-panels/index.js +89 -0
- package/build/components/save-publish-panels/index.js.map +1 -0
- package/build/components/sidebar/constants.js +11 -0
- package/build/components/sidebar/constants.js.map +1 -0
- package/build/components/sidebar/header.js +53 -0
- package/build/components/sidebar/header.js.map +1 -0
- package/build/components/sidebar/index.js +157 -0
- package/build/components/sidebar/index.js.map +1 -0
- package/build/components/sidebar/post-summary.js +84 -0
- package/build/components/sidebar/post-summary.js.map +1 -0
- package/build/components/start-page-options/index.js +10 -8
- package/build/components/start-page-options/index.js.map +1 -1
- package/build/components/start-template-options/index.js +192 -0
- package/build/components/start-template-options/index.js.map +1 -0
- package/build/components/template-content-panel/index.js +38 -0
- package/build/components/template-content-panel/index.js.map +1 -0
- package/build/hooks/pattern-overrides.js +10 -5
- package/build/hooks/pattern-overrides.js.map +1 -1
- package/build/private-apis.js +19 -8
- package/build/private-apis.js.map +1 -1
- package/build/private-apis.native.js +72 -0
- package/build/private-apis.native.js.map +1 -0
- package/build/store/private-selectors.js +6 -1
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +15 -0
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +3 -1
- package/build/store/selectors.js.map +1 -1
- package/build-module/bindings/pattern-overrides.js +69 -1
- package/build-module/bindings/pattern-overrides.js.map +1 -1
- package/build-module/components/autosave-monitor/index.js +15 -13
- package/build-module/components/autosave-monitor/index.js.map +1 -1
- package/build-module/components/block-settings-menu/content-only-settings-menu.js +119 -0
- package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +1 -0
- package/build-module/components/block-settings-menu/content-only-settings-menu.native.js +5 -0
- package/build-module/components/block-settings-menu/content-only-settings-menu.native.js.map +1 -0
- package/build-module/components/character-count/index.js +6 -0
- package/build-module/components/character-count/index.js.map +1 -1
- package/build-module/components/collapsible-block-toolbar/index.js +65 -0
- package/build-module/components/collapsible-block-toolbar/index.js.map +1 -0
- package/build-module/components/document-bar/index.js +2 -2
- package/build-module/components/document-bar/index.js.map +1 -1
- package/build-module/components/document-outline/check.js +9 -0
- package/build-module/components/document-outline/check.js.map +1 -1
- package/build-module/components/document-outline/index.js +11 -0
- package/build-module/components/document-outline/index.js.map +1 -1
- package/build-module/components/document-outline/item.js +2 -2
- package/build-module/components/document-outline/item.js.map +1 -1
- package/build-module/components/document-tools/index.js +17 -27
- package/build-module/components/document-tools/index.js.map +1 -1
- package/build-module/components/editor-canvas/edit-template-blocks-notification.js +1 -1
- package/build-module/components/editor-canvas/edit-template-blocks-notification.js.map +1 -1
- package/build-module/components/editor-canvas/index.js +19 -8
- package/build-module/components/editor-canvas/index.js.map +1 -1
- package/build-module/components/editor-history/redo.js +11 -0
- package/build-module/components/editor-history/redo.js.map +1 -1
- package/build-module/components/editor-history/undo.js +11 -0
- package/build-module/components/editor-history/undo.js.map +1 -1
- package/build-module/components/editor-snackbars/index.js +6 -0
- package/build-module/components/editor-snackbars/index.js.map +1 -1
- package/build-module/components/global-keyboard-shortcuts/index.js +8 -0
- package/build-module/components/global-keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js +36 -1
- package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
- package/build-module/components/global-styles-provider/index.js +120 -0
- package/build-module/components/global-styles-provider/index.js.map +1 -0
- package/build-module/components/header/index.js +139 -0
- package/build-module/components/header/index.js.map +1 -0
- package/build-module/components/inserter-sidebar/index.js +59 -37
- package/build-module/components/inserter-sidebar/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js +4 -0
- package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +2 -2
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/list-view-sidebar/index.js +1 -1
- package/build-module/components/list-view-sidebar/index.js.map +1 -1
- package/build-module/components/more-menu/copy-content-menu-item.js +52 -0
- package/build-module/components/more-menu/copy-content-menu-item.js.map +1 -0
- package/build-module/components/more-menu/index.js +111 -0
- package/build-module/components/more-menu/index.js.map +1 -0
- package/build-module/components/more-menu/tools-more-menu-group.js +16 -0
- package/build-module/components/more-menu/tools-more-menu-group.js.map +1 -0
- package/build-module/components/more-menu/view-more-menu-group.js +17 -0
- package/build-module/components/more-menu/view-more-menu-group.js.map +1 -0
- package/build-module/components/page-attributes/check.js +9 -0
- package/build-module/components/page-attributes/check.js.map +1 -1
- package/build-module/components/page-attributes/order.js +7 -0
- package/build-module/components/page-attributes/order.js.map +1 -1
- package/build-module/components/page-attributes/panel.js +13 -6
- package/build-module/components/page-attributes/panel.js.map +1 -1
- package/build-module/components/page-attributes/parent.js +7 -0
- package/build-module/components/page-attributes/parent.js.map +1 -1
- package/build-module/components/plugin-post-publish-panel/index.js +1 -1
- package/build-module/components/plugin-post-publish-panel/index.js.map +1 -1
- package/build-module/components/plugin-pre-publish-panel/index.js +1 -1
- package/build-module/components/plugin-pre-publish-panel/index.js.map +1 -1
- package/build-module/components/plugin-sidebar/index.js +1 -1
- package/build-module/components/plugin-sidebar/index.js.map +1 -1
- package/build-module/components/post-actions/actions.js +223 -70
- package/build-module/components/post-actions/actions.js.map +1 -1
- package/build-module/components/post-actions/index.js +33 -17
- package/build-module/components/post-actions/index.js.map +1 -1
- package/build-module/components/post-author/check.js +10 -0
- package/build-module/components/post-author/check.js.map +1 -1
- package/build-module/components/post-author/index.js +6 -0
- package/build-module/components/post-author/index.js.map +1 -1
- package/build-module/components/post-author/panel.js +6 -0
- package/build-module/components/post-author/panel.js.map +1 -1
- package/build-module/components/post-card-panel/index.js +9 -67
- package/build-module/components/post-card-panel/index.js.map +1 -1
- package/build-module/components/post-comments/index.js +30 -10
- package/build-module/components/post-comments/index.js.map +1 -1
- package/build-module/components/post-content-information/index.js +66 -0
- package/build-module/components/post-content-information/index.js.map +1 -0
- package/build-module/components/post-discussion/panel.js +105 -21
- package/build-module/components/post-discussion/panel.js.map +1 -1
- package/build-module/components/post-excerpt/check.js +0 -19
- package/build-module/components/post-excerpt/check.js.map +1 -1
- package/build-module/components/post-excerpt/index.js +52 -11
- package/build-module/components/post-excerpt/index.js.map +1 -1
- package/build-module/components/post-excerpt/panel.js +118 -8
- package/build-module/components/post-excerpt/panel.js.map +1 -1
- package/build-module/components/post-excerpt/plugin.js +2 -2
- package/build-module/components/post-excerpt/plugin.js.map +1 -1
- package/build-module/components/post-featured-image/index.js +1 -1
- package/build-module/components/post-featured-image/index.js.map +1 -1
- package/build-module/components/post-format/panel.js +18 -0
- package/build-module/components/post-format/panel.js.map +1 -0
- package/build-module/components/post-last-edited-panel/index.js +26 -0
- package/build-module/components/post-last-edited-panel/index.js.map +1 -0
- package/build-module/components/post-panel-row/index.js +2 -2
- package/build-module/components/post-panel-row/index.js.map +1 -1
- package/build-module/components/post-panel-section/index.js +20 -0
- package/build-module/components/post-panel-section/index.js.map +1 -0
- package/build-module/components/post-pingbacks/index.js +6 -3
- package/build-module/components/post-pingbacks/index.js.map +1 -1
- package/build-module/components/post-publish-button/post-publish-button-or-toggle.js +91 -0
- package/build-module/components/post-publish-button/post-publish-button-or-toggle.js.map +1 -0
- package/build-module/components/post-saved-state/index.js +2 -2
- package/build-module/components/post-saved-state/index.js.map +1 -1
- package/build-module/components/post-schedule/panel.js +1 -1
- package/build-module/components/post-schedule/panel.js.map +1 -1
- package/build-module/components/post-slug/panel.js +18 -0
- package/build-module/components/post-slug/panel.js.map +1 -0
- package/build-module/components/post-status/index.js +13 -13
- package/build-module/components/post-status/index.js.map +1 -1
- package/build-module/components/post-sticky/panel.js +12 -0
- package/build-module/components/post-sticky/panel.js.map +1 -0
- package/build-module/components/post-template/block-theme.js +2 -2
- package/build-module/components/post-template/block-theme.js.map +1 -1
- package/build-module/components/post-template/classic-theme.js +0 -1
- package/build-module/components/post-template/classic-theme.js.map +1 -1
- package/build-module/components/post-template/swap-template-button.js +3 -6
- package/build-module/components/post-template/swap-template-button.js.map +1 -1
- package/build-module/components/post-title/index.js +2 -2
- package/build-module/components/post-title/index.js.map +1 -1
- package/build-module/components/post-title/post-title-raw.js +2 -2
- package/build-module/components/post-title/post-title-raw.js.map +1 -1
- package/build-module/components/post-transform-panel/hooks.js +83 -0
- package/build-module/components/post-transform-panel/hooks.js.map +1 -0
- package/build-module/components/post-transform-panel/index.js +94 -0
- package/build-module/components/post-transform-panel/index.js.map +1 -0
- package/build-module/components/post-trash/panel.js +10 -0
- package/build-module/components/post-trash/panel.js.map +1 -0
- package/build-module/components/post-type-support-check/index.js +1 -1
- package/build-module/components/post-type-support-check/index.js.map +1 -1
- package/build-module/components/post-url/index.js +2 -1
- package/build-module/components/post-url/index.js.map +1 -1
- package/build-module/components/post-url/panel.js +1 -1
- package/build-module/components/post-url/panel.js.map +1 -1
- package/build-module/components/preferences-modal/enable-publish-sidebar.js +27 -0
- package/build-module/components/preferences-modal/enable-publish-sidebar.js.map +1 -0
- package/build-module/components/preferences-modal/index.js +11 -5
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/preview-dropdown/index.js +3 -1
- package/build-module/components/preview-dropdown/index.js.map +1 -1
- package/build-module/components/provider/disable-non-page-content-blocks.js +24 -17
- package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
- package/build-module/components/provider/index.js +3 -1
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.js +21 -3
- package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
- package/build-module/components/save-publish-panels/index.js +80 -0
- package/build-module/components/save-publish-panels/index.js.map +1 -0
- package/build-module/components/sidebar/constants.js +5 -0
- package/build-module/components/sidebar/constants.js.map +1 -0
- package/build-module/components/sidebar/header.js +46 -0
- package/build-module/components/sidebar/header.js.map +1 -0
- package/build-module/components/sidebar/index.js +149 -0
- package/build-module/components/sidebar/index.js.map +1 -0
- package/build-module/components/sidebar/post-summary.js +77 -0
- package/build-module/components/sidebar/post-summary.js.map +1 -0
- package/build-module/components/start-page-options/index.js +10 -8
- package/build-module/components/start-page-options/index.js.map +1 -1
- package/build-module/components/start-template-options/index.js +185 -0
- package/build-module/components/start-template-options/index.js.map +1 -0
- package/build-module/components/template-content-panel/index.js +31 -0
- package/build-module/components/template-content-panel/index.js.map +1 -0
- package/build-module/hooks/pattern-overrides.js +10 -5
- package/build-module/hooks/pattern-overrides.js.map +1 -1
- package/build-module/private-apis.js +19 -8
- package/build-module/private-apis.js.map +1 -1
- package/build-module/private-apis.native.js +62 -0
- package/build-module/private-apis.native.js.map +1 -0
- package/build-module/store/private-selectors.js +3 -0
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +14 -0
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +3 -1
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +535 -48
- package/build-style/style.css +535 -48
- package/package.json +38 -36
- package/src/bindings/pattern-overrides.js +83 -1
- package/src/components/autocompleters/style.scss +1 -2
- package/src/components/autosave-monitor/index.js +15 -12
- package/src/components/block-settings-menu/content-only-settings-menu.js +175 -0
- package/src/components/block-settings-menu/content-only-settings-menu.native.js +4 -0
- package/src/components/block-settings-menu/style.scss +4 -0
- package/src/components/character-count/index.js +5 -0
- package/src/components/collapsible-block-toolbar/index.js +77 -0
- package/src/components/collapsible-block-toolbar/style.scss +80 -0
- package/src/components/document-bar/index.js +2 -2
- package/src/components/document-outline/check.js +8 -0
- package/src/components/document-outline/index.js +10 -0
- package/src/components/document-outline/item.js +2 -2
- package/src/components/document-tools/index.js +19 -26
- package/src/components/editor-canvas/edit-template-blocks-notification.js +1 -1
- package/src/components/editor-canvas/index.js +18 -6
- package/src/components/editor-history/redo.js +10 -0
- package/src/components/editor-history/undo.js +10 -0
- package/src/components/editor-snackbars/index.js +5 -0
- package/src/components/entities-saved-states/style.scss +7 -0
- package/src/components/global-keyboard-shortcuts/index.js +7 -0
- package/src/components/global-keyboard-shortcuts/register-shortcuts.js +42 -1
- package/src/components/global-styles-provider/index.js +162 -0
- package/src/components/header/index.js +154 -0
- package/src/components/header/style.scss +231 -0
- package/src/components/inserter-sidebar/index.js +52 -32
- package/src/components/inserter-sidebar/style.scss +10 -3
- package/src/components/keyboard-shortcut-help-modal/config.js +10 -1
- package/src/components/keyboard-shortcut-help-modal/index.js +2 -2
- package/src/components/list-view-sidebar/index.js +1 -1
- package/src/components/list-view-sidebar/style.scss +3 -2
- package/src/components/more-menu/copy-content-menu-item.js +51 -0
- package/src/components/more-menu/index.js +158 -0
- package/src/components/more-menu/tools-more-menu-group.js +11 -0
- package/src/components/more-menu/view-more-menu-group.js +13 -0
- package/src/components/page-attributes/check.js +8 -0
- package/src/components/page-attributes/order.js +6 -0
- package/src/components/page-attributes/panel.js +21 -17
- package/src/components/page-attributes/parent.js +6 -0
- package/src/components/page-attributes/test/order.js +5 -1
- package/src/components/plugin-post-publish-panel/index.js +1 -1
- package/src/components/plugin-pre-publish-panel/index.js +1 -1
- package/src/components/plugin-sidebar/index.js +1 -1
- package/src/components/post-actions/actions.js +373 -152
- package/src/components/post-actions/index.js +34 -33
- package/src/components/post-author/check.js +9 -0
- package/src/components/post-author/index.js +5 -0
- package/src/components/post-author/panel.js +5 -0
- package/src/components/post-card-panel/index.js +40 -141
- package/src/components/post-card-panel/style.scss +2 -6
- package/src/components/post-comments/index.js +47 -9
- package/src/components/post-content-information/index.js +83 -0
- package/src/components/post-content-information/style.scss +6 -0
- package/src/components/post-discussion/panel.js +108 -27
- package/src/components/post-discussion/style.scss +26 -0
- package/src/components/post-excerpt/check.js +0 -18
- package/src/components/post-excerpt/index.js +66 -15
- package/src/components/post-excerpt/panel.js +196 -19
- package/src/components/post-excerpt/plugin.js +2 -2
- package/src/components/post-excerpt/style.scss +24 -0
- package/src/components/post-featured-image/index.js +1 -1
- package/src/components/post-featured-image/style.scss +2 -8
- package/src/components/post-format/panel.js +22 -0
- package/src/components/post-format/style.scss +6 -0
- package/src/components/post-last-edited-panel/index.js +35 -0
- package/src/components/post-last-edited-panel/style.scss +6 -0
- package/src/components/post-last-revision/test/check.js +5 -1
- package/src/components/post-panel-row/index.js +2 -2
- package/src/components/post-panel-row/style.scss +3 -3
- package/src/components/post-panel-section/index.js +19 -0
- package/src/components/post-panel-section/style.scss +3 -0
- package/src/components/post-pingbacks/index.js +11 -2
- package/src/components/post-publish-button/post-publish-button-or-toggle.js +102 -0
- package/src/components/post-publish-button/test/post-publish-button-or-toggle.js +63 -0
- package/src/components/post-publish-panel/style.scss +48 -0
- package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +225 -75
- package/src/components/post-saved-state/index.js +2 -2
- package/src/components/post-schedule/panel.js +1 -1
- package/src/components/post-schedule/style.scss +2 -4
- package/src/components/post-slug/panel.js +22 -0
- package/src/components/post-slug/style.scss +5 -0
- package/src/components/post-slug/test/index.js +5 -1
- package/src/components/post-status/index.js +88 -80
- package/src/components/post-status/style.scss +0 -1
- package/src/components/post-sticky/panel.js +18 -0
- package/src/components/post-template/block-theme.js +2 -2
- package/src/components/post-template/classic-theme.js +0 -1
- package/src/components/post-template/swap-template-button.js +3 -6
- package/src/components/post-text-editor/style.scss +1 -1
- package/src/components/post-title/index.js +2 -2
- package/src/components/post-title/post-title-raw.js +2 -2
- package/src/components/post-title/style.scss +1 -1
- package/src/components/post-transform-panel/hooks.js +114 -0
- package/src/components/post-transform-panel/index.js +99 -0
- package/src/components/post-trash/panel.js +13 -0
- package/src/components/post-type-support-check/index.js +1 -1
- package/src/components/post-type-support-check/test/index.js +2 -2
- package/src/components/post-url/index.js +1 -0
- package/src/components/post-url/panel.js +1 -1
- package/src/components/preferences-modal/enable-publish-sidebar.js +28 -0
- package/src/components/preferences-modal/index.js +17 -3
- package/src/components/preview-dropdown/index.js +3 -1
- package/src/components/provider/disable-non-page-content-blocks.js +23 -21
- package/src/components/provider/index.js +4 -0
- package/src/components/provider/use-block-editor-settings.js +19 -4
- package/src/components/save-publish-panels/index.js +96 -0
- package/src/components/save-publish-panels/style.scss +36 -0
- package/src/components/sidebar/constants.js +4 -0
- package/src/components/sidebar/header.js +49 -0
- package/src/components/sidebar/index.js +200 -0
- package/src/components/sidebar/post-summary.js +104 -0
- package/src/components/sidebar/style.scss +18 -0
- package/src/components/start-page-options/index.js +12 -5
- package/src/components/start-template-options/index.js +219 -0
- package/src/components/start-template-options/style.scss +55 -0
- package/src/components/template-areas/style.scss +0 -1
- package/src/components/template-content-panel/index.js +36 -0
- package/src/hooks/pattern-overrides.js +12 -6
- package/src/private-apis.js +22 -8
- package/src/private-apis.native.js +61 -0
- package/src/store/private-selectors.js +3 -0
- package/src/store/reducer.js +12 -0
- package/src/store/selectors.js +3 -1
- package/src/style.scss +11 -0
- package/src/components/post-slug/test/check.js +0 -17
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { useSelect, useDispatch } from '@wordpress/data';
|
|
5
|
+
import { Button, createSlotFill } from '@wordpress/components';
|
|
6
|
+
import { __ } from '@wordpress/i18n';
|
|
7
|
+
import { useCallback } from '@wordpress/element';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Internal dependencies
|
|
11
|
+
*/
|
|
12
|
+
import EntitiesSavedStates from '../entities-saved-states';
|
|
13
|
+
import PostPublishPanel from '../post-publish-panel';
|
|
14
|
+
import PluginPrePublishPanel from '../plugin-pre-publish-panel';
|
|
15
|
+
import PluginPostPublishPanel from '../plugin-post-publish-panel';
|
|
16
|
+
import { store as editorStore } from '../../store';
|
|
17
|
+
|
|
18
|
+
const { Fill, Slot } = createSlotFill( 'ActionsPanel' );
|
|
19
|
+
|
|
20
|
+
export const ActionsPanelFill = Fill;
|
|
21
|
+
|
|
22
|
+
export default function SavePublishPanels( {
|
|
23
|
+
setEntitiesSavedStatesCallback,
|
|
24
|
+
closeEntitiesSavedStates,
|
|
25
|
+
isEntitiesSavedStatesOpen,
|
|
26
|
+
forceIsDirtyPublishPanel,
|
|
27
|
+
} ) {
|
|
28
|
+
const { closePublishSidebar, togglePublishSidebar } =
|
|
29
|
+
useDispatch( editorStore );
|
|
30
|
+
const { publishSidebarOpened, hasNonPostEntityChanges } = useSelect(
|
|
31
|
+
( select ) => ( {
|
|
32
|
+
publishSidebarOpened:
|
|
33
|
+
select( editorStore ).isPublishSidebarOpened(),
|
|
34
|
+
hasNonPostEntityChanges:
|
|
35
|
+
select( editorStore ).hasNonPostEntityChanges(),
|
|
36
|
+
} ),
|
|
37
|
+
[]
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
const openEntitiesSavedStates = useCallback(
|
|
41
|
+
() => setEntitiesSavedStatesCallback( true ),
|
|
42
|
+
[]
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
// It is ok for these components to be unmounted when not in visual use.
|
|
46
|
+
// We don't want more than one present at a time, decide which to render.
|
|
47
|
+
let unmountableContent;
|
|
48
|
+
if ( publishSidebarOpened ) {
|
|
49
|
+
unmountableContent = (
|
|
50
|
+
<PostPublishPanel
|
|
51
|
+
onClose={ closePublishSidebar }
|
|
52
|
+
forceIsDirty={ forceIsDirtyPublishPanel }
|
|
53
|
+
PrePublishExtension={ PluginPrePublishPanel.Slot }
|
|
54
|
+
PostPublishExtension={ PluginPostPublishPanel.Slot }
|
|
55
|
+
/>
|
|
56
|
+
);
|
|
57
|
+
} else if ( hasNonPostEntityChanges ) {
|
|
58
|
+
unmountableContent = (
|
|
59
|
+
<div className="editor-layout__toggle-entities-saved-states-panel">
|
|
60
|
+
<Button
|
|
61
|
+
variant="secondary"
|
|
62
|
+
className="editor-layout__toggle-entities-saved-states-panel-button"
|
|
63
|
+
onClick={ openEntitiesSavedStates }
|
|
64
|
+
aria-expanded={ false }
|
|
65
|
+
>
|
|
66
|
+
{ __( 'Open save panel' ) }
|
|
67
|
+
</Button>
|
|
68
|
+
</div>
|
|
69
|
+
);
|
|
70
|
+
} else {
|
|
71
|
+
unmountableContent = (
|
|
72
|
+
<div className="editor-layout__toggle-publish-panel">
|
|
73
|
+
<Button
|
|
74
|
+
variant="secondary"
|
|
75
|
+
className="editor-layout__toggle-publish-panel-button"
|
|
76
|
+
onClick={ togglePublishSidebar }
|
|
77
|
+
aria-expanded={ false }
|
|
78
|
+
>
|
|
79
|
+
{ __( 'Open publish panel' ) }
|
|
80
|
+
</Button>
|
|
81
|
+
</div>
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// Since EntitiesSavedStates controls its own panel, we can keep it
|
|
86
|
+
// always mounted to retain its own component state (such as checkboxes).
|
|
87
|
+
return (
|
|
88
|
+
<>
|
|
89
|
+
{ isEntitiesSavedStatesOpen && (
|
|
90
|
+
<EntitiesSavedStates close={ closeEntitiesSavedStates } />
|
|
91
|
+
) }
|
|
92
|
+
<Slot bubblesVirtually />
|
|
93
|
+
{ ! isEntitiesSavedStatesOpen && unmountableContent }
|
|
94
|
+
</>
|
|
95
|
+
);
|
|
96
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
|
|
2
|
+
.editor-layout__toggle-publish-panel,
|
|
3
|
+
.editor-layout__toggle-sidebar-panel,
|
|
4
|
+
.editor-layout__toggle-entities-saved-states-panel {
|
|
5
|
+
z-index: z-index(".editor-layout__toggle-sidebar-panel");
|
|
6
|
+
position: fixed !important; // Need to override the default relative positionning
|
|
7
|
+
top: -9999em;
|
|
8
|
+
bottom: auto;
|
|
9
|
+
left: auto;
|
|
10
|
+
right: 0;
|
|
11
|
+
box-sizing: border-box;
|
|
12
|
+
width: $sidebar-width;
|
|
13
|
+
background-color: $white;
|
|
14
|
+
border: 1px dotted $gray-300;
|
|
15
|
+
height: auto !important; // Need to override the default sidebar positionnings
|
|
16
|
+
padding: $grid-unit-30;
|
|
17
|
+
display: flex;
|
|
18
|
+
justify-content: center;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.editor-layout__toggle-entities-saved-states-panel,
|
|
22
|
+
.editor-layout__toggle-publish-panel {
|
|
23
|
+
.interface-interface-skeleton__actions:focus &,
|
|
24
|
+
.interface-interface-skeleton__actions:focus-within & {
|
|
25
|
+
top: auto;
|
|
26
|
+
bottom: 0;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.edit-post-layout__toggle-sidebar-panel {
|
|
31
|
+
.interface-interface-skeleton__sidebar:focus &,
|
|
32
|
+
.interface-interface-skeleton__sidebar:focus-within & {
|
|
33
|
+
top: auto;
|
|
34
|
+
bottom: 0;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { privateApis as componentsPrivateApis } from '@wordpress/components';
|
|
5
|
+
import { __, _x } from '@wordpress/i18n';
|
|
6
|
+
import { useSelect } from '@wordpress/data';
|
|
7
|
+
import { forwardRef } from '@wordpress/element';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Internal dependencies
|
|
11
|
+
*/
|
|
12
|
+
import { store as editorStore } from '../../store';
|
|
13
|
+
import { unlock } from '../../lock-unlock';
|
|
14
|
+
import { sidebars } from './constants';
|
|
15
|
+
|
|
16
|
+
const { Tabs } = unlock( componentsPrivateApis );
|
|
17
|
+
|
|
18
|
+
const SidebarHeader = ( _, ref ) => {
|
|
19
|
+
const { documentLabel } = useSelect( ( select ) => {
|
|
20
|
+
const { getPostTypeLabel } = select( editorStore );
|
|
21
|
+
|
|
22
|
+
return {
|
|
23
|
+
// translators: Default label for the Document sidebar tab, not selected.
|
|
24
|
+
documentLabel: getPostTypeLabel() || _x( 'Document', 'noun' ),
|
|
25
|
+
};
|
|
26
|
+
}, [] );
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<Tabs.TabList ref={ ref }>
|
|
30
|
+
<Tabs.Tab
|
|
31
|
+
tabId={ sidebars.document }
|
|
32
|
+
// Used for focus management in the SettingsSidebar component.
|
|
33
|
+
data-tab-id={ sidebars.document }
|
|
34
|
+
>
|
|
35
|
+
{ documentLabel }
|
|
36
|
+
</Tabs.Tab>
|
|
37
|
+
<Tabs.Tab
|
|
38
|
+
tabId={ sidebars.block }
|
|
39
|
+
// Used for focus management in the SettingsSidebar component.
|
|
40
|
+
data-tab-id={ sidebars.block }
|
|
41
|
+
>
|
|
42
|
+
{ /* translators: Text label for the Block Settings Sidebar tab. */ }
|
|
43
|
+
{ __( 'Block' ) }
|
|
44
|
+
</Tabs.Tab>
|
|
45
|
+
</Tabs.TabList>
|
|
46
|
+
);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export default forwardRef( SidebarHeader );
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import {
|
|
5
|
+
BlockInspector,
|
|
6
|
+
store as blockEditorStore,
|
|
7
|
+
} from '@wordpress/block-editor';
|
|
8
|
+
import { useSelect, useDispatch } from '@wordpress/data';
|
|
9
|
+
import {
|
|
10
|
+
Platform,
|
|
11
|
+
useCallback,
|
|
12
|
+
useContext,
|
|
13
|
+
useEffect,
|
|
14
|
+
useRef,
|
|
15
|
+
} from '@wordpress/element';
|
|
16
|
+
import { isRTL, __ } from '@wordpress/i18n';
|
|
17
|
+
import { drawerLeft, drawerRight } from '@wordpress/icons';
|
|
18
|
+
import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';
|
|
19
|
+
import { privateApis as componentsPrivateApis } from '@wordpress/components';
|
|
20
|
+
import { store as interfaceStore } from '@wordpress/interface';
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Internal dependencies
|
|
24
|
+
*/
|
|
25
|
+
import PageAttributesPanel from '../page-attributes/panel';
|
|
26
|
+
import PatternOverridesPanel from '../pattern-overrides-panel';
|
|
27
|
+
import PluginDocumentSettingPanel from '../plugin-document-setting-panel';
|
|
28
|
+
import PluginSidebar from '../plugin-sidebar';
|
|
29
|
+
import PostLastRevisionPanel from '../post-last-revision/panel';
|
|
30
|
+
import PostSummary from './post-summary';
|
|
31
|
+
import PostTaxonomiesPanel from '../post-taxonomies/panel';
|
|
32
|
+
import PostTransformPanel from '../post-transform-panel';
|
|
33
|
+
import SidebarHeader from './header';
|
|
34
|
+
import TemplateContentPanel from '../template-content-panel';
|
|
35
|
+
import useAutoSwitchEditorSidebars from '../provider/use-auto-switch-editor-sidebars';
|
|
36
|
+
import { sidebars } from './constants';
|
|
37
|
+
import { unlock } from '../../lock-unlock';
|
|
38
|
+
import { store as editorStore } from '../../store';
|
|
39
|
+
import {
|
|
40
|
+
NAVIGATION_POST_TYPE,
|
|
41
|
+
TEMPLATE_PART_POST_TYPE,
|
|
42
|
+
TEMPLATE_POST_TYPE,
|
|
43
|
+
} from '../../store/constants';
|
|
44
|
+
|
|
45
|
+
const { Tabs } = unlock( componentsPrivateApis );
|
|
46
|
+
|
|
47
|
+
const SIDEBAR_ACTIVE_BY_DEFAULT = Platform.select( {
|
|
48
|
+
web: true,
|
|
49
|
+
native: false,
|
|
50
|
+
} );
|
|
51
|
+
|
|
52
|
+
const SidebarContent = ( {
|
|
53
|
+
tabName,
|
|
54
|
+
keyboardShortcut,
|
|
55
|
+
renderingMode,
|
|
56
|
+
onActionPerformed,
|
|
57
|
+
extraPanels,
|
|
58
|
+
} ) => {
|
|
59
|
+
const tabListRef = useRef( null );
|
|
60
|
+
// Because `PluginSidebar` renders a `ComplementaryArea`, we
|
|
61
|
+
// need to forward the `Tabs` context so it can be passed through the
|
|
62
|
+
// underlying slot/fill.
|
|
63
|
+
const tabsContextValue = useContext( Tabs.Context );
|
|
64
|
+
|
|
65
|
+
// This effect addresses a race condition caused by tabbing from the last
|
|
66
|
+
// block in the editor into the settings sidebar. Without this effect, the
|
|
67
|
+
// selected tab and browser focus can become separated in an unexpected way
|
|
68
|
+
// (e.g the "block" tab is focused, but the "post" tab is selected).
|
|
69
|
+
useEffect( () => {
|
|
70
|
+
const tabsElements = Array.from(
|
|
71
|
+
tabListRef.current?.querySelectorAll( '[role="tab"]' ) || []
|
|
72
|
+
);
|
|
73
|
+
const selectedTabElement = tabsElements.find(
|
|
74
|
+
// We are purposefully using a custom `data-tab-id` attribute here
|
|
75
|
+
// because we don't want rely on any assumptions about `Tabs`
|
|
76
|
+
// component internals.
|
|
77
|
+
( element ) => element.getAttribute( 'data-tab-id' ) === tabName
|
|
78
|
+
);
|
|
79
|
+
const activeElement = selectedTabElement?.ownerDocument.activeElement;
|
|
80
|
+
const tabsHasFocus = tabsElements.some( ( element ) => {
|
|
81
|
+
return activeElement && activeElement.id === element.id;
|
|
82
|
+
} );
|
|
83
|
+
if (
|
|
84
|
+
tabsHasFocus &&
|
|
85
|
+
selectedTabElement &&
|
|
86
|
+
selectedTabElement.id !== activeElement?.id
|
|
87
|
+
) {
|
|
88
|
+
selectedTabElement?.focus();
|
|
89
|
+
}
|
|
90
|
+
}, [ tabName ] );
|
|
91
|
+
|
|
92
|
+
return (
|
|
93
|
+
<PluginSidebar
|
|
94
|
+
identifier={ tabName }
|
|
95
|
+
header={
|
|
96
|
+
<Tabs.Context.Provider value={ tabsContextValue }>
|
|
97
|
+
<SidebarHeader ref={ tabListRef } />
|
|
98
|
+
</Tabs.Context.Provider>
|
|
99
|
+
}
|
|
100
|
+
closeLabel={ __( 'Close Settings' ) }
|
|
101
|
+
// This classname is added so we can apply a corrective negative
|
|
102
|
+
// margin to the panel.
|
|
103
|
+
// see https://github.com/WordPress/gutenberg/pull/55360#pullrequestreview-1737671049
|
|
104
|
+
className="editor-sidebar__panel"
|
|
105
|
+
headerClassName="editor-sidebar__panel-tabs"
|
|
106
|
+
/* translators: button label text should, if possible, be under 16 characters. */
|
|
107
|
+
title={ __( 'Settings' ) }
|
|
108
|
+
toggleShortcut={ keyboardShortcut }
|
|
109
|
+
icon={ isRTL() ? drawerLeft : drawerRight }
|
|
110
|
+
isActiveByDefault={ SIDEBAR_ACTIVE_BY_DEFAULT }
|
|
111
|
+
>
|
|
112
|
+
<Tabs.Context.Provider value={ tabsContextValue }>
|
|
113
|
+
<Tabs.TabPanel tabId={ sidebars.document } focusable={ false }>
|
|
114
|
+
<PostSummary onActionPerformed={ onActionPerformed } />
|
|
115
|
+
<PluginDocumentSettingPanel.Slot />
|
|
116
|
+
{ renderingMode !== 'post-only' && (
|
|
117
|
+
<TemplateContentPanel />
|
|
118
|
+
) }
|
|
119
|
+
<PostTransformPanel />
|
|
120
|
+
<PostLastRevisionPanel />
|
|
121
|
+
<PostTaxonomiesPanel />
|
|
122
|
+
<PageAttributesPanel />
|
|
123
|
+
<PatternOverridesPanel />
|
|
124
|
+
{ extraPanels }
|
|
125
|
+
</Tabs.TabPanel>
|
|
126
|
+
<Tabs.TabPanel tabId={ sidebars.block } focusable={ false }>
|
|
127
|
+
<BlockInspector />
|
|
128
|
+
</Tabs.TabPanel>
|
|
129
|
+
</Tabs.Context.Provider>
|
|
130
|
+
</PluginSidebar>
|
|
131
|
+
);
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
const Sidebar = ( { extraPanels, onActionPerformed } ) => {
|
|
135
|
+
useAutoSwitchEditorSidebars();
|
|
136
|
+
const { tabName, keyboardShortcut, showSummary, renderingMode } = useSelect(
|
|
137
|
+
( select ) => {
|
|
138
|
+
const shortcut = select(
|
|
139
|
+
keyboardShortcutsStore
|
|
140
|
+
).getShortcutRepresentation( 'core/editor/toggle-sidebar' );
|
|
141
|
+
|
|
142
|
+
const sidebar =
|
|
143
|
+
select( interfaceStore ).getActiveComplementaryArea( 'core' );
|
|
144
|
+
const _isEditorSidebarOpened = [
|
|
145
|
+
sidebars.block,
|
|
146
|
+
sidebars.document,
|
|
147
|
+
].includes( sidebar );
|
|
148
|
+
let _tabName = sidebar;
|
|
149
|
+
if ( ! _isEditorSidebarOpened ) {
|
|
150
|
+
_tabName = !! select(
|
|
151
|
+
blockEditorStore
|
|
152
|
+
).getBlockSelectionStart()
|
|
153
|
+
? sidebars.block
|
|
154
|
+
: sidebars.document;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
return {
|
|
158
|
+
tabName: _tabName,
|
|
159
|
+
keyboardShortcut: shortcut,
|
|
160
|
+
showSummary: ! [
|
|
161
|
+
TEMPLATE_POST_TYPE,
|
|
162
|
+
TEMPLATE_PART_POST_TYPE,
|
|
163
|
+
NAVIGATION_POST_TYPE,
|
|
164
|
+
].includes( select( editorStore ).getCurrentPostType() ),
|
|
165
|
+
renderingMode: select( editorStore ).getRenderingMode(),
|
|
166
|
+
};
|
|
167
|
+
},
|
|
168
|
+
[]
|
|
169
|
+
);
|
|
170
|
+
|
|
171
|
+
const { enableComplementaryArea } = useDispatch( interfaceStore );
|
|
172
|
+
|
|
173
|
+
const onTabSelect = useCallback(
|
|
174
|
+
( newSelectedTabId ) => {
|
|
175
|
+
if ( !! newSelectedTabId ) {
|
|
176
|
+
enableComplementaryArea( 'core', newSelectedTabId );
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
[ enableComplementaryArea ]
|
|
180
|
+
);
|
|
181
|
+
|
|
182
|
+
return (
|
|
183
|
+
<Tabs
|
|
184
|
+
selectedTabId={ tabName }
|
|
185
|
+
onSelect={ onTabSelect }
|
|
186
|
+
selectOnMove={ false }
|
|
187
|
+
>
|
|
188
|
+
<SidebarContent
|
|
189
|
+
tabName={ tabName }
|
|
190
|
+
keyboardShortcut={ keyboardShortcut }
|
|
191
|
+
showSummary={ showSummary }
|
|
192
|
+
renderingMode={ renderingMode }
|
|
193
|
+
onActionPerformed={ onActionPerformed }
|
|
194
|
+
extraPanels={ extraPanels }
|
|
195
|
+
/>
|
|
196
|
+
</Tabs>
|
|
197
|
+
);
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
export default Sidebar;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __experimentalVStack as VStack } from '@wordpress/components';
|
|
5
|
+
import { useSelect } from '@wordpress/data';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Internal dependencies
|
|
9
|
+
*/
|
|
10
|
+
import PluginPostStatusInfo from '../plugin-post-status-info';
|
|
11
|
+
import PostActions from '../post-actions';
|
|
12
|
+
import PostAuthorPanel from '../post-author/panel';
|
|
13
|
+
import PostCardPanel from '../post-card-panel';
|
|
14
|
+
import PostContentInformation from '../post-content-information';
|
|
15
|
+
import PostDiscussionPanel from '../post-discussion/panel';
|
|
16
|
+
import { PrivatePostExcerptPanel as PostExcerptPanel } from '../post-excerpt/panel';
|
|
17
|
+
import PostFeaturedImagePanel from '../post-featured-image/panel';
|
|
18
|
+
import PostFormatPanel from '../post-format/panel';
|
|
19
|
+
import PostLastEditedPanel from '../post-last-edited-panel';
|
|
20
|
+
import PostPanelSection from '../post-panel-section';
|
|
21
|
+
import PostSchedulePanel from '../post-schedule/panel';
|
|
22
|
+
import PostStatusPanel from '../post-status';
|
|
23
|
+
import PostStickyPanel from '../post-sticky';
|
|
24
|
+
import PostSyncStatus from '../post-sync-status';
|
|
25
|
+
import PostTemplatePanel from '../post-template/panel';
|
|
26
|
+
import PostTrashPanel from '../post-trash/panel';
|
|
27
|
+
import PostURLPanel from '../post-url/panel';
|
|
28
|
+
import { store as editorStore } from '../../store';
|
|
29
|
+
import {
|
|
30
|
+
NAVIGATION_POST_TYPE,
|
|
31
|
+
PATTERN_POST_TYPE,
|
|
32
|
+
TEMPLATE_PART_POST_TYPE,
|
|
33
|
+
TEMPLATE_POST_TYPE,
|
|
34
|
+
} from '../../store/constants';
|
|
35
|
+
import TemplateAreas from '../template-areas';
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Module Constants
|
|
39
|
+
*/
|
|
40
|
+
const PANEL_NAME = 'post-status';
|
|
41
|
+
|
|
42
|
+
export default function PostSummary( { onActionPerformed } ) {
|
|
43
|
+
const { isRemovedPostStatusPanel, postType } = useSelect( ( select ) => {
|
|
44
|
+
// We use isEditorPanelRemoved to hide the panel if it was programatically removed. We do
|
|
45
|
+
// not use isEditorPanelEnabled since this panel should not be disabled through the UI.
|
|
46
|
+
const { isEditorPanelRemoved, getCurrentPostType } =
|
|
47
|
+
select( editorStore );
|
|
48
|
+
return {
|
|
49
|
+
isRemovedPostStatusPanel: isEditorPanelRemoved( PANEL_NAME ),
|
|
50
|
+
postType: getCurrentPostType(),
|
|
51
|
+
};
|
|
52
|
+
}, [] );
|
|
53
|
+
const isPattern = postType === PATTERN_POST_TYPE;
|
|
54
|
+
const isTemplate = postType === TEMPLATE_POST_TYPE;
|
|
55
|
+
const isTemplatePart = postType === TEMPLATE_PART_POST_TYPE;
|
|
56
|
+
const isNavigation = postType === NAVIGATION_POST_TYPE;
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<PostPanelSection className="editor-post-summary">
|
|
60
|
+
<PluginPostStatusInfo.Slot>
|
|
61
|
+
{ ( fills ) => (
|
|
62
|
+
<>
|
|
63
|
+
<VStack spacing={ 4 }>
|
|
64
|
+
<PostCardPanel
|
|
65
|
+
actions={
|
|
66
|
+
<PostActions
|
|
67
|
+
onActionPerformed={ onActionPerformed }
|
|
68
|
+
/>
|
|
69
|
+
}
|
|
70
|
+
/>
|
|
71
|
+
<PostFeaturedImagePanel withPanelBody={ false } />
|
|
72
|
+
<PostExcerptPanel />
|
|
73
|
+
<VStack spacing={ 1 }>
|
|
74
|
+
<PostContentInformation />
|
|
75
|
+
<PostLastEditedPanel />
|
|
76
|
+
</VStack>
|
|
77
|
+
{ ! isRemovedPostStatusPanel && (
|
|
78
|
+
<VStack spacing={ 2 }>
|
|
79
|
+
<VStack spacing={ 1 }>
|
|
80
|
+
<PostStatusPanel />
|
|
81
|
+
<PostSchedulePanel />
|
|
82
|
+
<PostTemplatePanel />
|
|
83
|
+
<PostURLPanel />
|
|
84
|
+
<PostDiscussionPanel />
|
|
85
|
+
<PostSyncStatus />
|
|
86
|
+
</VStack>
|
|
87
|
+
<PostStickyPanel />
|
|
88
|
+
<PostFormatPanel />
|
|
89
|
+
<PostAuthorPanel />
|
|
90
|
+
{ isTemplate && <TemplateAreas /> }
|
|
91
|
+
{ fills }
|
|
92
|
+
{ ! isPattern &&
|
|
93
|
+
! isTemplate &&
|
|
94
|
+
! isTemplatePart &&
|
|
95
|
+
! isNavigation && <PostTrashPanel /> }
|
|
96
|
+
</VStack>
|
|
97
|
+
) }
|
|
98
|
+
</VStack>
|
|
99
|
+
</>
|
|
100
|
+
) }
|
|
101
|
+
</PluginPostStatusInfo.Slot>
|
|
102
|
+
</PostPanelSection>
|
|
103
|
+
);
|
|
104
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
.components-panel__header.editor-sidebar__panel-tabs {
|
|
2
|
+
padding-left: 0;
|
|
3
|
+
padding-right: $grid-unit-20;
|
|
4
|
+
|
|
5
|
+
.components-button.has-icon {
|
|
6
|
+
padding: 0;
|
|
7
|
+
min-width: $icon-size;
|
|
8
|
+
height: $icon-size;
|
|
9
|
+
|
|
10
|
+
@include break-medium() {
|
|
11
|
+
display: flex;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.editor-post-summary .components-v-stack:empty {
|
|
17
|
+
display: none;
|
|
18
|
+
}
|
|
@@ -11,11 +11,13 @@ import {
|
|
|
11
11
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
12
12
|
import { useAsyncList } from '@wordpress/compose';
|
|
13
13
|
import { store as coreStore } from '@wordpress/core-data';
|
|
14
|
+
import { __unstableSerializeAndClean } from '@wordpress/blocks';
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
17
|
* Internal dependencies
|
|
17
18
|
*/
|
|
18
19
|
import { store as editorStore } from '../../store';
|
|
20
|
+
import { TEMPLATE_POST_TYPE } from '../../store/constants';
|
|
19
21
|
|
|
20
22
|
function useStartPatterns() {
|
|
21
23
|
// A pattern is a start pattern if it includes 'core/post-content' in its blockTypes,
|
|
@@ -71,7 +73,11 @@ function PatternSelection( { blockPatterns, onChoosePattern } ) {
|
|
|
71
73
|
blockPatterns={ blockPatterns }
|
|
72
74
|
shownPatterns={ shownBlockPatterns }
|
|
73
75
|
onClickPattern={ ( _pattern, blocks ) => {
|
|
74
|
-
editEntityRecord( 'postType', postType, postId, {
|
|
76
|
+
editEntityRecord( 'postType', postType, postId, {
|
|
77
|
+
blocks,
|
|
78
|
+
content: ( { blocks: blocksForSerialization = [] } ) =>
|
|
79
|
+
__unstableSerializeAndClean( blocksForSerialization ),
|
|
80
|
+
} );
|
|
75
81
|
onChoosePattern();
|
|
76
82
|
} }
|
|
77
83
|
/>
|
|
@@ -110,14 +116,15 @@ export default function StartPageOptions() {
|
|
|
110
116
|
isEditedPostEmpty,
|
|
111
117
|
getCurrentPostType,
|
|
112
118
|
getCurrentPostId,
|
|
113
|
-
getEditorSettings,
|
|
114
119
|
} = select( editorStore );
|
|
115
|
-
const
|
|
120
|
+
const _postType = getCurrentPostType();
|
|
116
121
|
|
|
117
122
|
return {
|
|
118
123
|
shouldEnableModal:
|
|
119
|
-
!
|
|
120
|
-
|
|
124
|
+
! isEditedPostDirty() &&
|
|
125
|
+
isEditedPostEmpty() &&
|
|
126
|
+
TEMPLATE_POST_TYPE !== _postType,
|
|
127
|
+
postType: _postType,
|
|
121
128
|
postId: getCurrentPostId(),
|
|
122
129
|
};
|
|
123
130
|
}, [] );
|