@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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/editor",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.35.0",
|
|
4
4
|
"description": "Enhanced block editor for WordPress posts.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -31,41 +31,43 @@
|
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@babel/runtime": "^7.16.0",
|
|
34
|
-
"@wordpress/a11y": "^3.
|
|
35
|
-
"@wordpress/api-fetch": "^6.
|
|
36
|
-
"@wordpress/blob": "^3.
|
|
37
|
-
"@wordpress/block-editor": "^12.
|
|
38
|
-
"@wordpress/blocks": "^12.
|
|
39
|
-
"@wordpress/commands": "^0.
|
|
40
|
-
"@wordpress/components": "^27.
|
|
41
|
-
"@wordpress/compose": "^6.
|
|
42
|
-
"@wordpress/core-data": "^6.
|
|
43
|
-
"@wordpress/data": "^9.
|
|
44
|
-
"@wordpress/date": "^4.
|
|
45
|
-
"@wordpress/deprecated": "^3.
|
|
46
|
-
"@wordpress/dom": "^3.
|
|
47
|
-
"@wordpress/element": "^5.
|
|
48
|
-
"@wordpress/hooks": "^3.
|
|
49
|
-
"@wordpress/html-entities": "^3.
|
|
50
|
-
"@wordpress/i18n": "^4.
|
|
51
|
-
"@wordpress/icons": "^9.
|
|
52
|
-
"@wordpress/interface": "^5.
|
|
53
|
-
"@wordpress/keyboard-shortcuts": "^4.
|
|
54
|
-
"@wordpress/keycodes": "^3.
|
|
55
|
-
"@wordpress/media-utils": "^4.
|
|
56
|
-
"@wordpress/notices": "^4.
|
|
57
|
-
"@wordpress/patterns": "^1.
|
|
58
|
-
"@wordpress/plugins": "^6.
|
|
59
|
-
"@wordpress/preferences": "^3.
|
|
60
|
-
"@wordpress/private-apis": "^0.
|
|
61
|
-
"@wordpress/reusable-blocks": "^4.
|
|
62
|
-
"@wordpress/rich-text": "^6.
|
|
63
|
-
"@wordpress/server-side-render": "^4.
|
|
64
|
-
"@wordpress/url": "^3.
|
|
65
|
-
"@wordpress/warning": "^2.
|
|
66
|
-
"@wordpress/wordcount": "^3.
|
|
67
|
-
"
|
|
34
|
+
"@wordpress/a11y": "^3.58.0",
|
|
35
|
+
"@wordpress/api-fetch": "^6.55.0",
|
|
36
|
+
"@wordpress/blob": "^3.58.0",
|
|
37
|
+
"@wordpress/block-editor": "^12.26.0",
|
|
38
|
+
"@wordpress/blocks": "^12.35.0",
|
|
39
|
+
"@wordpress/commands": "^0.29.0",
|
|
40
|
+
"@wordpress/components": "^27.6.0",
|
|
41
|
+
"@wordpress/compose": "^6.35.0",
|
|
42
|
+
"@wordpress/core-data": "^6.35.0",
|
|
43
|
+
"@wordpress/data": "^9.28.0",
|
|
44
|
+
"@wordpress/date": "^4.58.0",
|
|
45
|
+
"@wordpress/deprecated": "^3.58.0",
|
|
46
|
+
"@wordpress/dom": "^3.58.0",
|
|
47
|
+
"@wordpress/element": "^5.35.0",
|
|
48
|
+
"@wordpress/hooks": "^3.58.0",
|
|
49
|
+
"@wordpress/html-entities": "^3.58.0",
|
|
50
|
+
"@wordpress/i18n": "^4.58.0",
|
|
51
|
+
"@wordpress/icons": "^9.49.0",
|
|
52
|
+
"@wordpress/interface": "^5.35.0",
|
|
53
|
+
"@wordpress/keyboard-shortcuts": "^4.35.0",
|
|
54
|
+
"@wordpress/keycodes": "^3.58.0",
|
|
55
|
+
"@wordpress/media-utils": "^4.49.0",
|
|
56
|
+
"@wordpress/notices": "^4.26.0",
|
|
57
|
+
"@wordpress/patterns": "^1.19.0",
|
|
58
|
+
"@wordpress/plugins": "^6.26.0",
|
|
59
|
+
"@wordpress/preferences": "^3.35.0",
|
|
60
|
+
"@wordpress/private-apis": "^0.40.0",
|
|
61
|
+
"@wordpress/reusable-blocks": "^4.35.0",
|
|
62
|
+
"@wordpress/rich-text": "^6.35.0",
|
|
63
|
+
"@wordpress/server-side-render": "^4.35.0",
|
|
64
|
+
"@wordpress/url": "^3.59.0",
|
|
65
|
+
"@wordpress/warning": "^2.58.0",
|
|
66
|
+
"@wordpress/wordcount": "^3.58.0",
|
|
67
|
+
"clsx": "^2.1.1",
|
|
68
68
|
"date-fns": "^3.6.0",
|
|
69
|
+
"deepmerge": "^4.3.0",
|
|
70
|
+
"is-plain-object": "^5.0.0",
|
|
69
71
|
"memize": "^2.1.0",
|
|
70
72
|
"react-autosize-textarea": "^7.1.0",
|
|
71
73
|
"remove-accents": "^0.5.0"
|
|
@@ -77,5 +79,5 @@
|
|
|
77
79
|
"publishConfig": {
|
|
78
80
|
"access": "public"
|
|
79
81
|
},
|
|
80
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "42f38f287506a6b3ed8ccba839b18ad066821044"
|
|
81
83
|
}
|
|
@@ -2,10 +2,92 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { _x } from '@wordpress/i18n';
|
|
5
|
+
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
6
|
+
|
|
7
|
+
const CONTENT = 'content';
|
|
5
8
|
|
|
6
9
|
export default {
|
|
7
10
|
name: 'core/pattern-overrides',
|
|
8
11
|
label: _x( 'Pattern Overrides', 'block bindings source' ),
|
|
9
|
-
|
|
12
|
+
getValue( { registry, clientId, attributeName } ) {
|
|
13
|
+
const { getBlockAttributes, getBlockParentsByBlockName } =
|
|
14
|
+
registry.select( blockEditorStore );
|
|
15
|
+
const currentBlockAttributes = getBlockAttributes( clientId );
|
|
16
|
+
const [ patternClientId ] = getBlockParentsByBlockName(
|
|
17
|
+
clientId,
|
|
18
|
+
'core/block',
|
|
19
|
+
true
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
const overridableValue =
|
|
23
|
+
getBlockAttributes( patternClientId )?.[ CONTENT ]?.[
|
|
24
|
+
currentBlockAttributes?.metadata?.name
|
|
25
|
+
]?.[ attributeName ];
|
|
26
|
+
|
|
27
|
+
// If there is no pattern client ID, or it is not overwritten, return the default value.
|
|
28
|
+
if ( ! patternClientId || overridableValue === undefined ) {
|
|
29
|
+
return currentBlockAttributes[ attributeName ];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return overridableValue === '' ? undefined : overridableValue;
|
|
33
|
+
},
|
|
34
|
+
setValues( { registry, clientId, attributes } ) {
|
|
35
|
+
const { getBlockAttributes, getBlockParentsByBlockName, getBlocks } =
|
|
36
|
+
registry.select( blockEditorStore );
|
|
37
|
+
const currentBlockAttributes = getBlockAttributes( clientId );
|
|
38
|
+
const blockName = currentBlockAttributes?.metadata?.name;
|
|
39
|
+
if ( ! blockName ) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const [ patternClientId ] = getBlockParentsByBlockName(
|
|
44
|
+
clientId,
|
|
45
|
+
'core/block',
|
|
46
|
+
true
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
// If there is no pattern client ID, sync blocks with the same name and same attributes.
|
|
50
|
+
if ( ! patternClientId ) {
|
|
51
|
+
const syncBlocksWithSameName = ( blocks ) => {
|
|
52
|
+
for ( const block of blocks ) {
|
|
53
|
+
if ( block.attributes?.metadata?.name === blockName ) {
|
|
54
|
+
registry
|
|
55
|
+
.dispatch( blockEditorStore )
|
|
56
|
+
.updateBlockAttributes(
|
|
57
|
+
block.clientId,
|
|
58
|
+
attributes
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
syncBlocksWithSameName( block.innerBlocks );
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
syncBlocksWithSameName( getBlocks() );
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
const currentBindingValue =
|
|
69
|
+
getBlockAttributes( patternClientId )?.[ CONTENT ];
|
|
70
|
+
registry
|
|
71
|
+
.dispatch( blockEditorStore )
|
|
72
|
+
.updateBlockAttributes( patternClientId, {
|
|
73
|
+
[ CONTENT ]: {
|
|
74
|
+
...currentBindingValue,
|
|
75
|
+
[ blockName ]: {
|
|
76
|
+
...currentBindingValue?.[ blockName ],
|
|
77
|
+
...Object.entries( attributes ).reduce(
|
|
78
|
+
( acc, [ key, value ] ) => {
|
|
79
|
+
// TODO: We need a way to represent `undefined` in the serialized overrides.
|
|
80
|
+
// Also see: https://github.com/WordPress/gutenberg/pull/57249#discussion_r1452987871
|
|
81
|
+
// We use an empty string to represent undefined for now until
|
|
82
|
+
// we support a richer format for overrides and the block bindings API.
|
|
83
|
+
acc[ key ] = value === undefined ? '' : value;
|
|
84
|
+
return acc;
|
|
85
|
+
},
|
|
86
|
+
{}
|
|
87
|
+
),
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
} );
|
|
91
|
+
},
|
|
10
92
|
lockAttributesEditing: false,
|
|
11
93
|
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
.editor-autocompleters__user {
|
|
2
2
|
.editor-autocompleters__no-avatar::before {
|
|
3
|
-
/* stylelint-disable */
|
|
3
|
+
/* stylelint-disable-next-line font-family-no-missing-generic-family-keyword -- dashicons don't need a generic family keyword. */
|
|
4
4
|
font: normal 20px/1 dashicons;
|
|
5
|
-
/* stylelint-enable */
|
|
6
5
|
content: "\f110";
|
|
7
6
|
margin-right: 5px;
|
|
8
7
|
vertical-align: middle;
|
|
@@ -11,17 +11,6 @@ import { store as coreStore } from '@wordpress/core-data';
|
|
|
11
11
|
*/
|
|
12
12
|
import { store as editorStore } from '../../store';
|
|
13
13
|
|
|
14
|
-
/**
|
|
15
|
-
* AutosaveMonitor invokes `props.autosave()` within at most `interval` seconds after an unsaved change is detected.
|
|
16
|
-
*
|
|
17
|
-
* The logic is straightforward: a check is performed every `props.interval` seconds. If any changes are detected, `props.autosave()` is called.
|
|
18
|
-
* The time between the change and the autosave varies but is no larger than `props.interval` seconds. Refer to the code below for more details, such as
|
|
19
|
-
* the specific way of detecting changes.
|
|
20
|
-
*
|
|
21
|
-
* There are two caveats:
|
|
22
|
-
* * If `props.isAutosaveable` happens to be false at a time of checking for changes, the check is retried every second.
|
|
23
|
-
* * The timer may be disabled by setting `props.disableIntervalChecks` to `true`. In that mode, any change will immediately trigger `props.autosave()`.
|
|
24
|
-
*/
|
|
25
14
|
export class AutosaveMonitor extends Component {
|
|
26
15
|
constructor( props ) {
|
|
27
16
|
super( props );
|
|
@@ -92,9 +81,23 @@ export class AutosaveMonitor extends Component {
|
|
|
92
81
|
}
|
|
93
82
|
|
|
94
83
|
/**
|
|
95
|
-
* AutosaveMonitor component.
|
|
96
84
|
* Monitors the changes made to the edited post and triggers autosave if necessary.
|
|
97
85
|
*
|
|
86
|
+
* The logic is straightforward: a check is performed every `props.interval` seconds. If any changes are detected, `props.autosave()` is called.
|
|
87
|
+
* The time between the change and the autosave varies but is no larger than `props.interval` seconds. Refer to the code below for more details, such as
|
|
88
|
+
* the specific way of detecting changes.
|
|
89
|
+
*
|
|
90
|
+
* There are two caveats:
|
|
91
|
+
* * If `props.isAutosaveable` happens to be false at a time of checking for changes, the check is retried every second.
|
|
92
|
+
* * The timer may be disabled by setting `props.disableIntervalChecks` to `true`. In that mode, any change will immediately trigger `props.autosave()`.
|
|
93
|
+
*
|
|
94
|
+
* @param {Object} props - The properties passed to the component.
|
|
95
|
+
* @param {Function} props.autosave - The function to call when changes need to be saved.
|
|
96
|
+
* @param {number} props.interval - The maximum time in seconds between an unsaved change and an autosave.
|
|
97
|
+
* @param {boolean} props.isAutosaveable - If false, the check for changes is retried every second.
|
|
98
|
+
* @param {boolean} props.disableIntervalChecks - If true, disables the timer and any change will immediately trigger `props.autosave()`.
|
|
99
|
+
* @param {boolean} props.isDirty - Indicates if there are unsaved changes.
|
|
100
|
+
*
|
|
98
101
|
* @example
|
|
99
102
|
* ```jsx
|
|
100
103
|
* <AutosaveMonitor interval={30000} />
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import {
|
|
5
|
+
BlockSettingsMenuControls,
|
|
6
|
+
__unstableBlockSettingsMenuFirstItem as BlockSettingsMenuFirstItem,
|
|
7
|
+
store as blockEditorStore,
|
|
8
|
+
useBlockDisplayInformation,
|
|
9
|
+
} from '@wordpress/block-editor';
|
|
10
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
11
|
+
import { __experimentalText as Text, MenuItem } from '@wordpress/components';
|
|
12
|
+
import { useSelect, useDispatch } from '@wordpress/data';
|
|
13
|
+
import { __ } from '@wordpress/i18n';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Internal dependencies
|
|
17
|
+
*/
|
|
18
|
+
import { store as editorStore } from '../../store';
|
|
19
|
+
import { unlock } from '../../lock-unlock';
|
|
20
|
+
|
|
21
|
+
function ContentOnlySettingsMenuItems( { clientId, onClose } ) {
|
|
22
|
+
const { entity, onNavigateToEntityRecord } = useSelect(
|
|
23
|
+
( select ) => {
|
|
24
|
+
const {
|
|
25
|
+
getBlockEditingMode,
|
|
26
|
+
getBlockParentsByBlockName,
|
|
27
|
+
getSettings,
|
|
28
|
+
getBlockAttributes,
|
|
29
|
+
} = select( blockEditorStore );
|
|
30
|
+
const contentOnly =
|
|
31
|
+
getBlockEditingMode( clientId ) === 'contentOnly';
|
|
32
|
+
if ( ! contentOnly ) {
|
|
33
|
+
return {};
|
|
34
|
+
}
|
|
35
|
+
const patternParent = getBlockParentsByBlockName(
|
|
36
|
+
clientId,
|
|
37
|
+
'core/block',
|
|
38
|
+
true
|
|
39
|
+
)[ 0 ];
|
|
40
|
+
|
|
41
|
+
let record;
|
|
42
|
+
if ( patternParent ) {
|
|
43
|
+
record = select( coreStore ).getEntityRecord(
|
|
44
|
+
'postType',
|
|
45
|
+
'wp_block',
|
|
46
|
+
getBlockAttributes( patternParent ).ref
|
|
47
|
+
);
|
|
48
|
+
} else {
|
|
49
|
+
const { getCurrentPostType, getCurrentTemplateId } =
|
|
50
|
+
select( editorStore );
|
|
51
|
+
const currentPostType = getCurrentPostType();
|
|
52
|
+
const templateId = getCurrentTemplateId();
|
|
53
|
+
if ( currentPostType === 'page' && templateId ) {
|
|
54
|
+
record = select( coreStore ).getEntityRecord(
|
|
55
|
+
'postType',
|
|
56
|
+
'wp_template',
|
|
57
|
+
templateId
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
entity: record,
|
|
63
|
+
onNavigateToEntityRecord:
|
|
64
|
+
getSettings().onNavigateToEntityRecord,
|
|
65
|
+
};
|
|
66
|
+
},
|
|
67
|
+
[ clientId ]
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
if ( ! entity ) {
|
|
71
|
+
return (
|
|
72
|
+
<TemplateLockContentOnlyMenuItems
|
|
73
|
+
clientId={ clientId }
|
|
74
|
+
onClose={ onClose }
|
|
75
|
+
/>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const isPattern = entity.type === 'wp_block';
|
|
80
|
+
|
|
81
|
+
return (
|
|
82
|
+
<>
|
|
83
|
+
<BlockSettingsMenuFirstItem>
|
|
84
|
+
<MenuItem
|
|
85
|
+
onClick={ () => {
|
|
86
|
+
onNavigateToEntityRecord( {
|
|
87
|
+
postId: entity.id,
|
|
88
|
+
postType: entity.type,
|
|
89
|
+
} );
|
|
90
|
+
} }
|
|
91
|
+
>
|
|
92
|
+
{ isPattern ? __( 'Edit pattern' ) : __( 'Edit template' ) }
|
|
93
|
+
</MenuItem>
|
|
94
|
+
</BlockSettingsMenuFirstItem>
|
|
95
|
+
<Text
|
|
96
|
+
variant="muted"
|
|
97
|
+
as="p"
|
|
98
|
+
className="editor-content-only-settings-menu__description"
|
|
99
|
+
>
|
|
100
|
+
{ isPattern
|
|
101
|
+
? __(
|
|
102
|
+
'Edit the pattern to move, delete, or make further changes to this block.'
|
|
103
|
+
)
|
|
104
|
+
: __(
|
|
105
|
+
'Edit the template to move, delete, or make further changes to this block.'
|
|
106
|
+
) }
|
|
107
|
+
</Text>
|
|
108
|
+
</>
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function TemplateLockContentOnlyMenuItems( { clientId, onClose } ) {
|
|
113
|
+
const { contentLockingParent } = useSelect(
|
|
114
|
+
( select ) => {
|
|
115
|
+
const { getContentLockingParent } = unlock(
|
|
116
|
+
select( blockEditorStore )
|
|
117
|
+
);
|
|
118
|
+
return {
|
|
119
|
+
contentLockingParent: getContentLockingParent( clientId ),
|
|
120
|
+
};
|
|
121
|
+
},
|
|
122
|
+
[ clientId ]
|
|
123
|
+
);
|
|
124
|
+
const blockDisplayInformation =
|
|
125
|
+
useBlockDisplayInformation( contentLockingParent );
|
|
126
|
+
// Disable reason: We're using a hook here so it has to be on top-level.
|
|
127
|
+
// eslint-disable-next-line @wordpress/no-unused-vars-before-return
|
|
128
|
+
const { modifyContentLockBlock, selectBlock } = unlock(
|
|
129
|
+
useDispatch( blockEditorStore )
|
|
130
|
+
);
|
|
131
|
+
|
|
132
|
+
if ( ! blockDisplayInformation?.title ) {
|
|
133
|
+
return null;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
return (
|
|
137
|
+
<>
|
|
138
|
+
<BlockSettingsMenuFirstItem>
|
|
139
|
+
<MenuItem
|
|
140
|
+
onClick={ () => {
|
|
141
|
+
selectBlock( contentLockingParent );
|
|
142
|
+
modifyContentLockBlock( contentLockingParent );
|
|
143
|
+
onClose();
|
|
144
|
+
} }
|
|
145
|
+
>
|
|
146
|
+
{ __( 'Unlock' ) }
|
|
147
|
+
</MenuItem>
|
|
148
|
+
</BlockSettingsMenuFirstItem>
|
|
149
|
+
<Text
|
|
150
|
+
variant="muted"
|
|
151
|
+
as="p"
|
|
152
|
+
className="editor-content-only-settings-menu__description"
|
|
153
|
+
>
|
|
154
|
+
{ __(
|
|
155
|
+
'Temporarily unlock the parent block to edit, delete or make further changes to this block.'
|
|
156
|
+
) }
|
|
157
|
+
</Text>
|
|
158
|
+
</>
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export default function ContentOnlySettingsMenu() {
|
|
163
|
+
return (
|
|
164
|
+
<BlockSettingsMenuControls>
|
|
165
|
+
{ ( { selectedClientIds, onClose } ) =>
|
|
166
|
+
selectedClientIds.length === 1 && (
|
|
167
|
+
<ContentOnlySettingsMenuItems
|
|
168
|
+
clientId={ selectedClientIds[ 0 ] }
|
|
169
|
+
onClose={ onClose }
|
|
170
|
+
/>
|
|
171
|
+
)
|
|
172
|
+
}
|
|
173
|
+
</BlockSettingsMenuControls>
|
|
174
|
+
);
|
|
175
|
+
}
|
|
@@ -9,6 +9,11 @@ import { count as characterCount } from '@wordpress/wordcount';
|
|
|
9
9
|
*/
|
|
10
10
|
import { store as editorStore } from '../../store';
|
|
11
11
|
|
|
12
|
+
/**
|
|
13
|
+
* Renders the character count of the post content.
|
|
14
|
+
*
|
|
15
|
+
* @return {number} The character count.
|
|
16
|
+
*/
|
|
12
17
|
export default function CharacterCount() {
|
|
13
18
|
const content = useSelect(
|
|
14
19
|
( select ) => select( editorStore ).getEditedPostAttribute( 'content' ),
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* WordPress dependencies
|
|
8
|
+
*/
|
|
9
|
+
import {
|
|
10
|
+
BlockToolbar,
|
|
11
|
+
store as blockEditorStore,
|
|
12
|
+
privateApis as blockEditorPrivateApis,
|
|
13
|
+
} from '@wordpress/block-editor';
|
|
14
|
+
import { useEffect } from '@wordpress/element';
|
|
15
|
+
import { Button, Popover } from '@wordpress/components';
|
|
16
|
+
import { __ } from '@wordpress/i18n';
|
|
17
|
+
import { next, previous } from '@wordpress/icons';
|
|
18
|
+
import { useSelect } from '@wordpress/data';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Internal dependencies
|
|
22
|
+
*/
|
|
23
|
+
import { unlock } from '../../lock-unlock';
|
|
24
|
+
|
|
25
|
+
const { useHasBlockToolbar } = unlock( blockEditorPrivateApis );
|
|
26
|
+
|
|
27
|
+
function CollapsableBlockToolbar( { isCollapsed, onToggle } ) {
|
|
28
|
+
const { blockSelectionStart } = useSelect( ( select ) => {
|
|
29
|
+
return {
|
|
30
|
+
blockSelectionStart:
|
|
31
|
+
select( blockEditorStore ).getBlockSelectionStart(),
|
|
32
|
+
};
|
|
33
|
+
}, [] );
|
|
34
|
+
const hasBlockToolbar = useHasBlockToolbar();
|
|
35
|
+
|
|
36
|
+
const hasBlockSelection = !! blockSelectionStart;
|
|
37
|
+
|
|
38
|
+
useEffect( () => {
|
|
39
|
+
// If we have a new block selection, show the block tools
|
|
40
|
+
if ( blockSelectionStart ) {
|
|
41
|
+
onToggle( false );
|
|
42
|
+
}
|
|
43
|
+
}, [ blockSelectionStart, onToggle ] );
|
|
44
|
+
|
|
45
|
+
if ( ! hasBlockToolbar ) {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<>
|
|
51
|
+
<div
|
|
52
|
+
className={ clsx( 'editor-collapsible-block-toolbar', {
|
|
53
|
+
'is-collapsed': isCollapsed || ! hasBlockSelection,
|
|
54
|
+
} ) }
|
|
55
|
+
>
|
|
56
|
+
<BlockToolbar hideDragHandle />
|
|
57
|
+
</div>
|
|
58
|
+
<Popover.Slot name="block-toolbar" />
|
|
59
|
+
|
|
60
|
+
<Button
|
|
61
|
+
className="editor-collapsible-block-toolbar__toggle"
|
|
62
|
+
icon={ isCollapsed ? next : previous }
|
|
63
|
+
onClick={ () => {
|
|
64
|
+
onToggle( ! isCollapsed );
|
|
65
|
+
} }
|
|
66
|
+
label={
|
|
67
|
+
isCollapsed
|
|
68
|
+
? __( 'Show block tools' )
|
|
69
|
+
: __( 'Hide block tools' )
|
|
70
|
+
}
|
|
71
|
+
size="compact"
|
|
72
|
+
/>
|
|
73
|
+
</>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export default CollapsableBlockToolbar;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
.editor-collapsible-block-toolbar {
|
|
2
|
+
overflow: hidden;
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
height: $header-height;
|
|
6
|
+
|
|
7
|
+
.block-editor-block-contextual-toolbar {
|
|
8
|
+
border-bottom: 0;
|
|
9
|
+
height: 100%;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// These rules ensure that icons are always positioned in a way that lines up with the rest of the icons in the toolbar.
|
|
13
|
+
.block-editor-block-toolbar {
|
|
14
|
+
height: 100%;
|
|
15
|
+
// Push down so that buttons are centered vertically.
|
|
16
|
+
// It should be 14px (60px header height - 32px compact button height = 28 / 2),
|
|
17
|
+
// but there is a -1px top-margin down the stack that affects this.
|
|
18
|
+
padding-top: math.div($header-height - $button-size-compact, 2) + 1;
|
|
19
|
+
|
|
20
|
+
// Match the height of other buttons in the header toolbar.
|
|
21
|
+
.components-button:not(.block-editor-block-mover-button) {
|
|
22
|
+
height: $button-size-compact;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&::after {
|
|
27
|
+
content: "";
|
|
28
|
+
width: $border-width;
|
|
29
|
+
height: $grid-unit-30;
|
|
30
|
+
background-color: $gray-300;
|
|
31
|
+
margin-right: $grid-unit - $border-width;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Modified group borders.
|
|
35
|
+
.components-toolbar-group,
|
|
36
|
+
.components-toolbar {
|
|
37
|
+
border-right: none;
|
|
38
|
+
position: relative;
|
|
39
|
+
|
|
40
|
+
&::after {
|
|
41
|
+
content: "";
|
|
42
|
+
width: $border-width;
|
|
43
|
+
height: $grid-unit-30;
|
|
44
|
+
background-color: $gray-300;
|
|
45
|
+
top: $grid-unit-05;
|
|
46
|
+
position: absolute;
|
|
47
|
+
right: -$border-width;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
& .components-toolbar-group.components-toolbar-group {
|
|
51
|
+
&::after {
|
|
52
|
+
display: none;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.block-editor-block-mover {
|
|
58
|
+
// Match the height of other buttons in the header toolbar.
|
|
59
|
+
&.is-horizontal .block-editor-block-mover-button {
|
|
60
|
+
height: $button-size-compact;
|
|
61
|
+
overflow: visible;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Move up a little to prevent the toolbar shift when focus is on the vertical movers.
|
|
65
|
+
@include break-small() {
|
|
66
|
+
&:not(.is-horizontal) .block-editor-block-mover__move-button-container {
|
|
67
|
+
position: relative;
|
|
68
|
+
top: -10px;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&.is-collapsed {
|
|
74
|
+
display: none;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.editor-collapsible-block-toolbar__toggle {
|
|
79
|
+
margin-left: 2px; // Allow focus ring to be fully visible
|
|
80
|
+
}
|
|
@@ -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
|
|
@@ -111,7 +111,7 @@ export default function DocumentBar() {
|
|
|
111
111
|
|
|
112
112
|
return (
|
|
113
113
|
<div
|
|
114
|
-
className={
|
|
114
|
+
className={ clsx( 'editor-document-bar', {
|
|
115
115
|
'has-back-button': hasBackButton,
|
|
116
116
|
'is-global': isGlobalEntity,
|
|
117
117
|
} ) }
|
|
@@ -4,6 +4,14 @@
|
|
|
4
4
|
import { useSelect } from '@wordpress/data';
|
|
5
5
|
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Component check if there are any headings (core/heading blocks) present in the document.
|
|
9
|
+
*
|
|
10
|
+
* @param {Object} props Props.
|
|
11
|
+
* @param {Element} props.children Children to be rendered.
|
|
12
|
+
*
|
|
13
|
+
* @return {Component|null} The component to be rendered or null if there are headings.
|
|
14
|
+
*/
|
|
7
15
|
export default function DocumentOutlineCheck( { children } ) {
|
|
8
16
|
const hasHeadings = useSelect( ( select ) => {
|
|
9
17
|
const { getGlobalBlockCount } = select( blockEditorStore );
|
|
@@ -98,6 +98,16 @@ const isEmptyHeading = ( heading ) =>
|
|
|
98
98
|
! heading.attributes.content ||
|
|
99
99
|
heading.attributes.content.trim().length === 0;
|
|
100
100
|
|
|
101
|
+
/**
|
|
102
|
+
* Renders a document outline component.
|
|
103
|
+
*
|
|
104
|
+
* @param {Object} props Props.
|
|
105
|
+
* @param {Function} props.onSelect Function to be called when an outline item is selected.
|
|
106
|
+
* @param {boolean} props.isTitleSupported Indicates whether the title is supported.
|
|
107
|
+
* @param {boolean} props.hasOutlineItemsDisabled Indicates whether the outline items are disabled.
|
|
108
|
+
*
|
|
109
|
+
* @return {Component} The component to be rendered.
|
|
110
|
+
*/
|
|
101
111
|
export default function DocumentOutline( {
|
|
102
112
|
onSelect,
|
|
103
113
|
isTitleSupported,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
4
|
+
import clsx from 'clsx';
|
|
5
5
|
|
|
6
6
|
const TableOfContentsItem = ( {
|
|
7
7
|
children,
|
|
@@ -11,7 +11,7 @@ const TableOfContentsItem = ( {
|
|
|
11
11
|
onSelect,
|
|
12
12
|
} ) => (
|
|
13
13
|
<li
|
|
14
|
-
className={
|
|
14
|
+
className={ clsx(
|
|
15
15
|
'document-outline__item',
|
|
16
16
|
`is-${ level.toLowerCase() }`,
|
|
17
17
|
{
|