@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,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import PostPanelRow from '../post-panel-row';
|
|
5
|
+
import PostStickyForm from './';
|
|
6
|
+
import PostStickyCheck from './check';
|
|
7
|
+
|
|
8
|
+
export function PostStickyPanel() {
|
|
9
|
+
return (
|
|
10
|
+
<PostStickyCheck>
|
|
11
|
+
<PostPanelRow>
|
|
12
|
+
<PostStickyForm />
|
|
13
|
+
</PostPanelRow>
|
|
14
|
+
</PostStickyCheck>
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export default PostStickyPanel;
|
|
@@ -76,7 +76,7 @@ export default function BlockThemeControl( { id } ) {
|
|
|
76
76
|
popoverProps={ POPOVER_PROPS }
|
|
77
77
|
focusOnMount
|
|
78
78
|
toggleProps={ {
|
|
79
|
-
|
|
79
|
+
size: 'compact',
|
|
80
80
|
variant: 'tertiary',
|
|
81
81
|
} }
|
|
82
82
|
label={ __( 'Template options' ) }
|
|
@@ -128,7 +128,7 @@ export default function BlockThemeControl( { id } ) {
|
|
|
128
128
|
);
|
|
129
129
|
} }
|
|
130
130
|
>
|
|
131
|
-
{ __( '
|
|
131
|
+
{ __( 'Show template' ) }
|
|
132
132
|
</MenuItem>
|
|
133
133
|
</MenuGroup>
|
|
134
134
|
</>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { useMemo, useState
|
|
4
|
+
import { useMemo, useState } from '@wordpress/element';
|
|
5
5
|
import { decodeEntities } from '@wordpress/html-entities';
|
|
6
6
|
import { __experimentalBlockPatternsList as BlockPatternsList } from '@wordpress/block-editor';
|
|
7
7
|
import { MenuItem, Modal } from '@wordpress/components';
|
|
@@ -18,9 +18,6 @@ import { useAvailableTemplates, useEditedPostContext } from './hooks';
|
|
|
18
18
|
|
|
19
19
|
export default function SwapTemplateButton( { onClick } ) {
|
|
20
20
|
const [ showModal, setShowModal ] = useState( false );
|
|
21
|
-
const onClose = useCallback( () => {
|
|
22
|
-
setShowModal( false );
|
|
23
|
-
}, [] );
|
|
24
21
|
const { postType, postId } = useEditedPostContext();
|
|
25
22
|
const availableTemplates = useAvailableTemplates( postType );
|
|
26
23
|
const { editEntityRecord } = useDispatch( coreStore );
|
|
@@ -35,7 +32,7 @@ export default function SwapTemplateButton( { onClick } ) {
|
|
|
35
32
|
{ template: template.name },
|
|
36
33
|
{ undoIgnore: true }
|
|
37
34
|
);
|
|
38
|
-
|
|
35
|
+
setShowModal( false ); // Close the template suggestions modal first.
|
|
39
36
|
onClick();
|
|
40
37
|
};
|
|
41
38
|
return (
|
|
@@ -46,7 +43,7 @@ export default function SwapTemplateButton( { onClick } ) {
|
|
|
46
43
|
{ showModal && (
|
|
47
44
|
<Modal
|
|
48
45
|
title={ __( 'Choose a template' ) }
|
|
49
|
-
onRequestClose={
|
|
46
|
+
onRequestClose={ () => setShowModal( false ) }
|
|
50
47
|
overlayClassName="editor-post-template__swap-template-modal"
|
|
51
48
|
isFullScreen
|
|
52
49
|
>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
4
|
+
import clsx from 'clsx';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
@@ -185,7 +185,7 @@ function PostTitle( _, forwardedRef ) {
|
|
|
185
185
|
|
|
186
186
|
// The wp-block className is important for editor styles.
|
|
187
187
|
// This same block is used in both the visual and the code editor.
|
|
188
|
-
const className =
|
|
188
|
+
const className = clsx( DEFAULT_CLASSNAMES, {
|
|
189
189
|
'is-selected': isSelected,
|
|
190
190
|
'has-fixed-toolbar': hasFixedToolbar,
|
|
191
191
|
} );
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
4
|
+
import clsx from 'clsx';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
@@ -51,7 +51,7 @@ function PostTitleRaw( _, forwardedRef ) {
|
|
|
51
51
|
|
|
52
52
|
// The wp-block className is important for editor styles.
|
|
53
53
|
// This same block is used in both the visual and the code editor.
|
|
54
|
-
const className =
|
|
54
|
+
const className = clsx( DEFAULT_CLASSNAMES, {
|
|
55
55
|
'is-selected': isSelected,
|
|
56
56
|
'has-fixed-toolbar': hasFixedToolbar,
|
|
57
57
|
'is-raw-text': true,
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { useSelect } from '@wordpress/data';
|
|
5
|
+
import { useMemo } from '@wordpress/element';
|
|
6
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
7
|
+
import { parse } from '@wordpress/blocks';
|
|
8
|
+
import { privateApis as patternsPrivateApis } from '@wordpress/patterns';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Internal dependencies
|
|
12
|
+
*/
|
|
13
|
+
import { unlock } from '../../lock-unlock';
|
|
14
|
+
import { store as editorStore } from '../../store';
|
|
15
|
+
|
|
16
|
+
const { EXCLUDED_PATTERN_SOURCES, PATTERN_TYPES } =
|
|
17
|
+
unlock( patternsPrivateApis );
|
|
18
|
+
|
|
19
|
+
function injectThemeAttributeInBlockTemplateContent(
|
|
20
|
+
block,
|
|
21
|
+
currentThemeStylesheet
|
|
22
|
+
) {
|
|
23
|
+
block.innerBlocks = block.innerBlocks.map( ( innerBlock ) => {
|
|
24
|
+
return injectThemeAttributeInBlockTemplateContent(
|
|
25
|
+
innerBlock,
|
|
26
|
+
currentThemeStylesheet
|
|
27
|
+
);
|
|
28
|
+
} );
|
|
29
|
+
|
|
30
|
+
if (
|
|
31
|
+
block.name === 'core/template-part' &&
|
|
32
|
+
block.attributes.theme === undefined
|
|
33
|
+
) {
|
|
34
|
+
block.attributes.theme = currentThemeStylesheet;
|
|
35
|
+
}
|
|
36
|
+
return block;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Filter all patterns and return only the ones that are compatible with the current template.
|
|
41
|
+
*
|
|
42
|
+
* @param {Array} patterns An array of patterns.
|
|
43
|
+
* @param {Object} template The current template.
|
|
44
|
+
* @return {Array} Array of patterns that are compatible with the current template.
|
|
45
|
+
*/
|
|
46
|
+
function filterPatterns( patterns, template ) {
|
|
47
|
+
// Filter out duplicates.
|
|
48
|
+
const filterOutDuplicatesByName = ( currentItem, index, items ) =>
|
|
49
|
+
index === items.findIndex( ( item ) => currentItem.name === item.name );
|
|
50
|
+
|
|
51
|
+
// Filter out core/directory patterns not included in theme.json.
|
|
52
|
+
const filterOutExcludedPatternSources = ( pattern ) =>
|
|
53
|
+
! EXCLUDED_PATTERN_SOURCES.includes( pattern.source );
|
|
54
|
+
|
|
55
|
+
// Looks for patterns that have the same template type as the current template,
|
|
56
|
+
// or have a block type that matches the current template area.
|
|
57
|
+
const filterCompatiblePatterns = ( pattern ) =>
|
|
58
|
+
pattern.templateTypes?.includes( template.slug ) ||
|
|
59
|
+
pattern.blockTypes?.includes( 'core/template-part/' + template.area );
|
|
60
|
+
|
|
61
|
+
return patterns.filter( ( pattern, index, items ) => {
|
|
62
|
+
return (
|
|
63
|
+
filterOutDuplicatesByName( pattern, index, items ) &&
|
|
64
|
+
filterOutExcludedPatternSources( pattern ) &&
|
|
65
|
+
filterCompatiblePatterns( pattern )
|
|
66
|
+
);
|
|
67
|
+
} );
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function preparePatterns( patterns, currentThemeStylesheet ) {
|
|
71
|
+
return patterns.map( ( pattern ) => ( {
|
|
72
|
+
...pattern,
|
|
73
|
+
keywords: pattern.keywords || [],
|
|
74
|
+
type: PATTERN_TYPES.theme,
|
|
75
|
+
blocks: parse( pattern.content, {
|
|
76
|
+
__unstableSkipMigrationLogs: true,
|
|
77
|
+
} ).map( ( block ) =>
|
|
78
|
+
injectThemeAttributeInBlockTemplateContent(
|
|
79
|
+
block,
|
|
80
|
+
currentThemeStylesheet
|
|
81
|
+
)
|
|
82
|
+
),
|
|
83
|
+
} ) );
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export function useAvailablePatterns( template ) {
|
|
87
|
+
const { blockPatterns, restBlockPatterns, currentThemeStylesheet } =
|
|
88
|
+
useSelect( ( select ) => {
|
|
89
|
+
const { getEditorSettings } = select( editorStore );
|
|
90
|
+
const settings = getEditorSettings();
|
|
91
|
+
|
|
92
|
+
return {
|
|
93
|
+
blockPatterns:
|
|
94
|
+
settings.__experimentalAdditionalBlockPatterns ??
|
|
95
|
+
settings.__experimentalBlockPatterns,
|
|
96
|
+
restBlockPatterns: select( coreStore ).getBlockPatterns(),
|
|
97
|
+
currentThemeStylesheet:
|
|
98
|
+
select( coreStore ).getCurrentTheme().stylesheet,
|
|
99
|
+
};
|
|
100
|
+
}, [] );
|
|
101
|
+
|
|
102
|
+
return useMemo( () => {
|
|
103
|
+
const mergedPatterns = [
|
|
104
|
+
...( blockPatterns || [] ),
|
|
105
|
+
...( restBlockPatterns || [] ),
|
|
106
|
+
];
|
|
107
|
+
const filteredPatterns = filterPatterns( mergedPatterns, template );
|
|
108
|
+
return preparePatterns(
|
|
109
|
+
filteredPatterns,
|
|
110
|
+
template,
|
|
111
|
+
currentThemeStylesheet
|
|
112
|
+
);
|
|
113
|
+
}, [ blockPatterns, restBlockPatterns, template, currentThemeStylesheet ] );
|
|
114
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { useSelect, useDispatch } from '@wordpress/data';
|
|
5
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
6
|
+
import { PanelBody, PanelRow } from '@wordpress/components';
|
|
7
|
+
import { __ } from '@wordpress/i18n';
|
|
8
|
+
import { useAsyncList } from '@wordpress/compose';
|
|
9
|
+
import { __experimentalBlockPatternsList as BlockPatternsList } from '@wordpress/block-editor';
|
|
10
|
+
import { serialize } from '@wordpress/blocks';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Internal dependencies
|
|
14
|
+
*/
|
|
15
|
+
import { store as editorStore } from '../../store';
|
|
16
|
+
import { useAvailablePatterns } from './hooks';
|
|
17
|
+
import {
|
|
18
|
+
TEMPLATE_POST_TYPE,
|
|
19
|
+
TEMPLATE_PART_POST_TYPE,
|
|
20
|
+
} from '../../store/constants';
|
|
21
|
+
|
|
22
|
+
function TemplatesList( { availableTemplates, onSelect } ) {
|
|
23
|
+
const shownTemplates = useAsyncList( availableTemplates );
|
|
24
|
+
if ( ! availableTemplates || availableTemplates?.length === 0 ) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<BlockPatternsList
|
|
30
|
+
label={ __( 'Templates' ) }
|
|
31
|
+
blockPatterns={ availableTemplates }
|
|
32
|
+
shownPatterns={ shownTemplates }
|
|
33
|
+
onClickPattern={ onSelect }
|
|
34
|
+
showTitlesAsTooltip
|
|
35
|
+
/>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function PostTransform() {
|
|
40
|
+
const { record, postType, postId } = useSelect( ( select ) => {
|
|
41
|
+
const { getCurrentPostType, getCurrentPostId } = select( editorStore );
|
|
42
|
+
const { getEditedEntityRecord } = select( coreStore );
|
|
43
|
+
const type = getCurrentPostType();
|
|
44
|
+
const id = getCurrentPostId();
|
|
45
|
+
return {
|
|
46
|
+
postType: type,
|
|
47
|
+
postId: id,
|
|
48
|
+
record: getEditedEntityRecord( 'postType', type, id ),
|
|
49
|
+
};
|
|
50
|
+
}, [] );
|
|
51
|
+
const { editEntityRecord } = useDispatch( coreStore );
|
|
52
|
+
const availablePatterns = useAvailablePatterns( record );
|
|
53
|
+
const onTemplateSelect = async ( selectedTemplate ) => {
|
|
54
|
+
await editEntityRecord( 'postType', postType, postId, {
|
|
55
|
+
blocks: selectedTemplate.blocks,
|
|
56
|
+
content: serialize( selectedTemplate.blocks ),
|
|
57
|
+
} );
|
|
58
|
+
};
|
|
59
|
+
if ( ! availablePatterns?.length ) {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<PanelBody
|
|
65
|
+
title={ __( 'Transform into:' ) }
|
|
66
|
+
initialOpen={ record.type === TEMPLATE_PART_POST_TYPE }
|
|
67
|
+
>
|
|
68
|
+
<PanelRow>
|
|
69
|
+
<p>
|
|
70
|
+
{ __(
|
|
71
|
+
'Choose a predefined pattern to switch up the look of your template.' // TODO - make this dynamic?
|
|
72
|
+
) }
|
|
73
|
+
</p>
|
|
74
|
+
</PanelRow>
|
|
75
|
+
|
|
76
|
+
<TemplatesList
|
|
77
|
+
availableTemplates={ availablePatterns }
|
|
78
|
+
onSelect={ onTemplateSelect }
|
|
79
|
+
/>
|
|
80
|
+
</PanelBody>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export default function PostTransformPanel() {
|
|
85
|
+
const { postType } = useSelect( ( select ) => {
|
|
86
|
+
const { getCurrentPostType } = select( editorStore );
|
|
87
|
+
return {
|
|
88
|
+
postType: getCurrentPostType(),
|
|
89
|
+
};
|
|
90
|
+
}, [] );
|
|
91
|
+
|
|
92
|
+
if (
|
|
93
|
+
! [ TEMPLATE_PART_POST_TYPE, TEMPLATE_POST_TYPE ].includes( postType )
|
|
94
|
+
) {
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return <PostTransform />;
|
|
99
|
+
}
|
|
@@ -27,7 +27,7 @@ function PostTypeSupportCheck( { children, supportKeys } ) {
|
|
|
27
27
|
const { getPostType } = select( coreStore );
|
|
28
28
|
return getPostType( getEditedPostAttribute( 'type' ) );
|
|
29
29
|
}, [] );
|
|
30
|
-
let isSupported =
|
|
30
|
+
let isSupported = !! postType;
|
|
31
31
|
if ( postType ) {
|
|
32
32
|
isSupported = (
|
|
33
33
|
Array.isArray( supportKeys ) ? supportKeys : [ supportKeys ]
|
|
@@ -29,7 +29,7 @@ function setupUseSelectMock( postType ) {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
describe( 'PostTypeSupportCheck', () => {
|
|
32
|
-
it( '
|
|
32
|
+
it( 'does not render its children when post type is not known', () => {
|
|
33
33
|
setupUseSelectMock( undefined );
|
|
34
34
|
|
|
35
35
|
const { container } = render(
|
|
@@ -38,7 +38,7 @@ describe( 'PostTypeSupportCheck', () => {
|
|
|
38
38
|
</PostTypeSupportCheck>
|
|
39
39
|
);
|
|
40
40
|
|
|
41
|
-
expect( container ).toHaveTextContent( 'Supported' );
|
|
41
|
+
expect( container ).not.toHaveTextContent( 'Supported' );
|
|
42
42
|
} );
|
|
43
43
|
|
|
44
44
|
it( 'does not render its children when post type is known and not supports', () => {
|
|
@@ -60,7 +60,7 @@ function PostURLToggle( { isOpen, onClick } ) {
|
|
|
60
60
|
const decodedSlug = safeDecodeURIComponent( slug );
|
|
61
61
|
return (
|
|
62
62
|
<Button
|
|
63
|
-
|
|
63
|
+
size="compact"
|
|
64
64
|
className="editor-post-url__panel-toggle"
|
|
65
65
|
variant="tertiary"
|
|
66
66
|
aria-expanded={ isOpen }
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { compose } from '@wordpress/compose';
|
|
5
|
+
import { withSelect, withDispatch } from '@wordpress/data';
|
|
6
|
+
import { privateApis as preferencesPrivateApis } from '@wordpress/preferences';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Internal dependencies
|
|
10
|
+
*/
|
|
11
|
+
import { unlock } from '../../lock-unlock';
|
|
12
|
+
import { store as editorStore } from '../../store';
|
|
13
|
+
|
|
14
|
+
const { PreferenceBaseOption } = unlock( preferencesPrivateApis );
|
|
15
|
+
|
|
16
|
+
export default compose(
|
|
17
|
+
withSelect( ( select ) => ( {
|
|
18
|
+
isChecked: select( editorStore ).isPublishSidebarEnabled(),
|
|
19
|
+
} ) ),
|
|
20
|
+
withDispatch( ( dispatch ) => {
|
|
21
|
+
const { enablePublishSidebar, disablePublishSidebar } =
|
|
22
|
+
dispatch( editorStore );
|
|
23
|
+
return {
|
|
24
|
+
onChange: ( isEnabled ) =>
|
|
25
|
+
isEnabled ? enablePublishSidebar() : disablePublishSidebar(),
|
|
26
|
+
};
|
|
27
|
+
} )
|
|
28
|
+
)( PreferenceBaseOption );
|
|
@@ -17,6 +17,7 @@ import { store as interfaceStore } from '@wordpress/interface';
|
|
|
17
17
|
*/
|
|
18
18
|
import EnablePanelOption from './enable-panel';
|
|
19
19
|
import EnablePluginDocumentSettingPanelOption from './enable-plugin-document-setting-panel';
|
|
20
|
+
import EnablePublishSidebarOption from './enable-publish-sidebar';
|
|
20
21
|
import BlockManager from '../block-manager';
|
|
21
22
|
import PostTaxonomies from '../post-taxonomies';
|
|
22
23
|
import PostFeaturedImageCheck from '../post-featured-image/check';
|
|
@@ -69,9 +70,9 @@ export default function EditorPreferencesModal( { extraSections = {} } ) {
|
|
|
69
70
|
scope="core"
|
|
70
71
|
featureName="showListViewByDefault"
|
|
71
72
|
help={ __(
|
|
72
|
-
'Opens the
|
|
73
|
+
'Opens the List View sidebar by default.'
|
|
73
74
|
) }
|
|
74
|
-
label={ __( 'Always open
|
|
75
|
+
label={ __( 'Always open List View' ) }
|
|
75
76
|
/>
|
|
76
77
|
{ showBlockBreadcrumbsOption && (
|
|
77
78
|
<PreferenceToggleControl
|
|
@@ -87,7 +88,7 @@ export default function EditorPreferencesModal( { extraSections = {} } ) {
|
|
|
87
88
|
scope="core"
|
|
88
89
|
featureName="allowRightClickOverrides"
|
|
89
90
|
help={ __(
|
|
90
|
-
'Allows contextual
|
|
91
|
+
'Allows contextual List View menus via right-click, overriding browser defaults.'
|
|
91
92
|
) }
|
|
92
93
|
label={ __(
|
|
93
94
|
'Allow right-click contextual menus'
|
|
@@ -136,6 +137,18 @@ export default function EditorPreferencesModal( { extraSections = {} } ) {
|
|
|
136
137
|
/>
|
|
137
138
|
</PageAttributesCheck>
|
|
138
139
|
</PreferencesModalSection>
|
|
140
|
+
{ isLargeViewport && (
|
|
141
|
+
<PreferencesModalSection
|
|
142
|
+
title={ __( 'Publishing' ) }
|
|
143
|
+
>
|
|
144
|
+
<EnablePublishSidebarOption
|
|
145
|
+
help={ __(
|
|
146
|
+
'Review settings, such as visibility and tags.'
|
|
147
|
+
) }
|
|
148
|
+
label={ __( 'Enable pre-publish checks' ) }
|
|
149
|
+
/>
|
|
150
|
+
</PreferencesModalSection>
|
|
151
|
+
) }
|
|
139
152
|
{ extraSections?.general }
|
|
140
153
|
</>
|
|
141
154
|
),
|
|
@@ -258,6 +271,7 @@ export default function EditorPreferencesModal( { extraSections = {} } ) {
|
|
|
258
271
|
setIsInserterOpened,
|
|
259
272
|
setIsListViewOpened,
|
|
260
273
|
setPreference,
|
|
274
|
+
isLargeViewport,
|
|
261
275
|
]
|
|
262
276
|
);
|
|
263
277
|
|
|
@@ -38,7 +38,9 @@ export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {
|
|
|
38
38
|
}, [] );
|
|
39
39
|
const { setDeviceType } = useDispatch( editorStore );
|
|
40
40
|
const isMobile = useViewportMatch( 'medium', '<' );
|
|
41
|
-
if ( isMobile )
|
|
41
|
+
if ( isMobile ) {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
42
44
|
|
|
43
45
|
const popoverProps = {
|
|
44
46
|
placement: 'bottom-end',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { useSelect,
|
|
4
|
+
import { useSelect, useRegistry } from '@wordpress/data';
|
|
5
5
|
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
6
6
|
import { useEffect } from '@wordpress/element';
|
|
7
7
|
import { applyFilters } from '@wordpress/hooks';
|
|
@@ -18,6 +18,8 @@ const CONTENT_ONLY_BLOCKS = applyFilters( 'editor.postContentBlockTypes', [
|
|
|
18
18
|
* page content to be edited.
|
|
19
19
|
*/
|
|
20
20
|
export default function DisableNonPageContentBlocks() {
|
|
21
|
+
// Note that there are two separate subscription because the result for each
|
|
22
|
+
// returns a new array.
|
|
21
23
|
const contentOnlyIds = useSelect( ( select ) => {
|
|
22
24
|
const { getBlocksByName, getBlockParents, getBlockName } =
|
|
23
25
|
select( blockEditorStore );
|
|
@@ -33,7 +35,6 @@ export default function DisableNonPageContentBlocks() {
|
|
|
33
35
|
} )
|
|
34
36
|
);
|
|
35
37
|
}, [] );
|
|
36
|
-
|
|
37
38
|
const disabledIds = useSelect( ( select ) => {
|
|
38
39
|
const { getBlocksByName, getBlockOrder } = select( blockEditorStore );
|
|
39
40
|
return getBlocksByName( [ 'core/template-part' ] ).flatMap(
|
|
@@ -41,33 +42,34 @@ export default function DisableNonPageContentBlocks() {
|
|
|
41
42
|
);
|
|
42
43
|
}, [] );
|
|
43
44
|
|
|
44
|
-
const
|
|
45
|
-
useDispatch( blockEditorStore );
|
|
45
|
+
const registry = useRegistry();
|
|
46
46
|
|
|
47
47
|
useEffect( () => {
|
|
48
|
-
setBlockEditingMode
|
|
49
|
-
|
|
50
|
-
setBlockEditingMode( clientId, 'contentOnly' );
|
|
51
|
-
}
|
|
52
|
-
for ( const clientId of disabledIds ) {
|
|
53
|
-
setBlockEditingMode( clientId, 'disabled' );
|
|
54
|
-
}
|
|
48
|
+
const { setBlockEditingMode, unsetBlockEditingMode } =
|
|
49
|
+
registry.dispatch( blockEditorStore );
|
|
55
50
|
|
|
56
|
-
|
|
57
|
-
|
|
51
|
+
registry.batch( () => {
|
|
52
|
+
setBlockEditingMode( '', 'disabled' );
|
|
58
53
|
for ( const clientId of contentOnlyIds ) {
|
|
59
|
-
|
|
54
|
+
setBlockEditingMode( clientId, 'contentOnly' );
|
|
60
55
|
}
|
|
61
56
|
for ( const clientId of disabledIds ) {
|
|
62
|
-
|
|
57
|
+
setBlockEditingMode( clientId, 'disabled' );
|
|
63
58
|
}
|
|
59
|
+
} );
|
|
60
|
+
|
|
61
|
+
return () => {
|
|
62
|
+
registry.batch( () => {
|
|
63
|
+
unsetBlockEditingMode( '' );
|
|
64
|
+
for ( const clientId of contentOnlyIds ) {
|
|
65
|
+
unsetBlockEditingMode( clientId );
|
|
66
|
+
}
|
|
67
|
+
for ( const clientId of disabledIds ) {
|
|
68
|
+
unsetBlockEditingMode( clientId );
|
|
69
|
+
}
|
|
70
|
+
} );
|
|
64
71
|
};
|
|
65
|
-
}, [
|
|
66
|
-
contentOnlyIds,
|
|
67
|
-
disabledIds,
|
|
68
|
-
setBlockEditingMode,
|
|
69
|
-
unsetBlockEditingMode,
|
|
70
|
-
] );
|
|
72
|
+
}, [ contentOnlyIds, disabledIds, registry ] );
|
|
71
73
|
|
|
72
74
|
return null;
|
|
73
75
|
}
|
|
@@ -28,6 +28,8 @@ import useCommands from '../commands';
|
|
|
28
28
|
import BlockRemovalWarnings from '../block-removal-warnings';
|
|
29
29
|
import StartPageOptions from '../start-page-options';
|
|
30
30
|
import KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';
|
|
31
|
+
import ContentOnlySettingsMenu from '../block-settings-menu/content-only-settings-menu';
|
|
32
|
+
import StartTemplateOptions from '../start-template-options';
|
|
31
33
|
|
|
32
34
|
const { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );
|
|
33
35
|
const { PatternsMenuItems } = unlock( editPatternsPrivateApis );
|
|
@@ -264,6 +266,7 @@ export const ExperimentalEditorProvider = withRegistryProvider(
|
|
|
264
266
|
{ ! settings.__unstableIsPreviewMode && (
|
|
265
267
|
<>
|
|
266
268
|
<PatternsMenuItems />
|
|
269
|
+
<ContentOnlySettingsMenu />
|
|
267
270
|
{ mode === 'template-locked' && (
|
|
268
271
|
<DisableNonPageContentBlocks />
|
|
269
272
|
) }
|
|
@@ -273,6 +276,7 @@ export const ExperimentalEditorProvider = withRegistryProvider(
|
|
|
273
276
|
<KeyboardShortcutHelpModal />
|
|
274
277
|
<BlockRemovalWarnings />
|
|
275
278
|
<StartPageOptions />
|
|
279
|
+
<StartTemplateOptions />
|
|
276
280
|
</>
|
|
277
281
|
) }
|
|
278
282
|
</BlockEditorProviderComponent>
|
|
@@ -24,8 +24,10 @@ import inserterMediaCategories from '../media-categories';
|
|
|
24
24
|
import { mediaUpload } from '../../utils';
|
|
25
25
|
import { store as editorStore } from '../../store';
|
|
26
26
|
import { lock, unlock } from '../../lock-unlock';
|
|
27
|
+
import { useGlobalStylesContext } from '../global-styles-provider';
|
|
27
28
|
|
|
28
29
|
const EMPTY_BLOCKS_LIST = [];
|
|
30
|
+
const DEFAULT_STYLES = {};
|
|
29
31
|
|
|
30
32
|
function __experimentalReusableBlocksSelect( select ) {
|
|
31
33
|
return (
|
|
@@ -173,6 +175,9 @@ function useBlockEditorSettings( settings, postType, postId, renderingMode ) {
|
|
|
173
175
|
[ postType, postId, isLargeViewport, renderingMode ]
|
|
174
176
|
);
|
|
175
177
|
|
|
178
|
+
const { merged: mergedGlobalStyles } = useGlobalStylesContext();
|
|
179
|
+
const globalStylesData = mergedGlobalStyles.styles ?? DEFAULT_STYLES;
|
|
180
|
+
|
|
176
181
|
const settingsBlockPatterns =
|
|
177
182
|
settings.__experimentalAdditionalBlockPatterns ?? // WP 6.0
|
|
178
183
|
settings.__experimentalBlockPatterns; // WP 5.9
|
|
@@ -251,6 +256,8 @@ function useBlockEditorSettings( settings, postType, postId, renderingMode ) {
|
|
|
251
256
|
}, [ settings.allowedBlockTypes, hiddenBlockTypes, blockTypes ] );
|
|
252
257
|
|
|
253
258
|
const forceDisableFocusMode = settings.focusMode === false;
|
|
259
|
+
const { globalStylesDataKey, selectBlockPatternsKey } =
|
|
260
|
+
unlock( privateApis );
|
|
254
261
|
|
|
255
262
|
return useMemo( () => {
|
|
256
263
|
const blockEditorSettings = {
|
|
@@ -259,6 +266,7 @@ function useBlockEditorSettings( settings, postType, postId, renderingMode ) {
|
|
|
259
266
|
BLOCK_EDITOR_SETTINGS.includes( key )
|
|
260
267
|
)
|
|
261
268
|
),
|
|
269
|
+
[ globalStylesDataKey ]: globalStylesData,
|
|
262
270
|
allowedBlockTypes,
|
|
263
271
|
allowRightClickOverrides,
|
|
264
272
|
focusMode: focusMode && ! forceDisableFocusMode,
|
|
@@ -267,10 +275,14 @@ function useBlockEditorSettings( settings, postType, postId, renderingMode ) {
|
|
|
267
275
|
keepCaretInsideBlock,
|
|
268
276
|
mediaUpload: hasUploadPermissions ? mediaUpload : undefined,
|
|
269
277
|
__experimentalBlockPatterns: blockPatterns,
|
|
270
|
-
[
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
)
|
|
278
|
+
[ selectBlockPatternsKey ]: ( select ) => {
|
|
279
|
+
const { hasFinishedResolution, getBlockPatternsForPostType } =
|
|
280
|
+
unlock( select( coreStore ) );
|
|
281
|
+
const patterns = getBlockPatternsForPostType( postType );
|
|
282
|
+
return hasFinishedResolution( 'getBlockPatterns' )
|
|
283
|
+
? patterns
|
|
284
|
+
: undefined;
|
|
285
|
+
},
|
|
274
286
|
[ unlock( privateApis ).reusableBlocksSelectKey ]:
|
|
275
287
|
__experimentalReusableBlocksSelect,
|
|
276
288
|
__experimentalBlockPatternCategories: blockPatternCategories,
|
|
@@ -327,6 +339,9 @@ function useBlockEditorSettings( settings, postType, postId, renderingMode ) {
|
|
|
327
339
|
postType,
|
|
328
340
|
setIsInserterOpened,
|
|
329
341
|
sectionRootClientId,
|
|
342
|
+
globalStylesData,
|
|
343
|
+
globalStylesDataKey,
|
|
344
|
+
selectBlockPatternsKey,
|
|
330
345
|
] );
|
|
331
346
|
}
|
|
332
347
|
|