@wordpress/edit-post 7.16.0 → 7.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/README.md +6 -1
- package/build/components/block-manager/category.js +1 -14
- package/build/components/block-manager/category.js.map +1 -1
- package/build/components/block-manager/checklist.js +1 -5
- package/build/components/block-manager/checklist.js.map +1 -1
- package/build/components/block-manager/index.js +11 -23
- package/build/components/block-manager/index.js.map +1 -1
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +3 -11
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
- package/build/components/browser-url/index.js +6 -23
- package/build/components/browser-url/index.js.map +1 -1
- package/build/components/device-preview/index.js +1 -11
- package/build/components/device-preview/index.js.map +1 -1
- package/build/components/editor-initialization/index.js +0 -2
- package/build/components/editor-initialization/index.js.map +1 -1
- package/build/components/editor-initialization/listener-hooks.js +1 -12
- package/build/components/editor-initialization/listener-hooks.js.map +1 -1
- package/build/components/header/document-actions/index.js +1 -17
- package/build/components/header/document-actions/index.js.map +1 -1
- package/build/components/header/fullscreen-mode-close/index.js +3 -22
- package/build/components/header/fullscreen-mode-close/index.js.map +1 -1
- package/build/components/header/header-toolbar/index.js +5 -22
- package/build/components/header/header-toolbar/index.js.map +1 -1
- package/build/components/header/header-toolbar/index.native.js +2 -24
- package/build/components/header/header-toolbar/index.native.js.map +1 -1
- package/build/components/header/index.js +3 -20
- package/build/components/header/index.js.map +1 -1
- package/build/components/header/index.native.js +1 -13
- package/build/components/header/index.native.js.map +1 -1
- package/build/components/header/main-dashboard-button/index.js +1 -7
- package/build/components/header/main-dashboard-button/index.js.map +1 -1
- package/build/components/header/mode-switcher/index.js +6 -21
- package/build/components/header/mode-switcher/index.js.map +1 -1
- package/build/components/header/more-menu/index.js +1 -12
- package/build/components/header/more-menu/index.js.map +1 -1
- package/build/components/header/plugin-more-menu-item/index.js +0 -8
- package/build/components/header/plugin-more-menu-item/index.js.map +1 -1
- package/build/components/header/plugin-sidebar-more-menu-item/index.js +3 -4
- package/build/components/header/plugin-sidebar-more-menu-item/index.js.map +1 -1
- package/build/components/header/post-publish-button-or-toggle.js +2 -11
- package/build/components/header/post-publish-button-or-toggle.js.map +1 -1
- package/build/components/header/preferences-menu-item/index.js +1 -7
- package/build/components/header/preferences-menu-item/index.js.map +1 -1
- package/build/components/header/tools-more-menu-group/index.js +1 -6
- package/build/components/header/tools-more-menu-group/index.js.map +1 -1
- package/build/components/header/writing-menu/index.js +1 -15
- package/build/components/header/writing-menu/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/config.js +1 -2
- package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +1 -9
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +4 -25
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +1 -6
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build/components/keyboard-shortcuts/index.js +4 -23
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/layout/actions-panel.js +7 -17
- package/build/components/layout/actions-panel.js.map +1 -1
- package/build/components/layout/index.js +47 -82
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/index.native.js +5 -34
- package/build/components/layout/index.native.js.map +1 -1
- package/build/components/meta-boxes/index.js +4 -12
- package/build/components/meta-boxes/index.js.map +1 -1
- package/build/components/meta-boxes/meta-box-visibility.js +1 -12
- package/build/components/meta-boxes/meta-box-visibility.js.map +1 -1
- package/build/components/meta-boxes/meta-boxes-area/index.js +0 -10
- package/build/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
- package/build/components/preferences-modal/index.js +1 -18
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/preferences-modal/meta-boxes-section.js +3 -13
- package/build/components/preferences-modal/meta-boxes-section.js.map +1 -1
- package/build/components/preferences-modal/options/enable-custom-fields.js +10 -11
- package/build/components/preferences-modal/options/enable-custom-fields.js.map +1 -1
- package/build/components/preferences-modal/options/enable-feature.js +0 -7
- package/build/components/preferences-modal/options/enable-feature.js.map +1 -1
- package/build/components/preferences-modal/options/enable-panel.js +0 -7
- package/build/components/preferences-modal/options/enable-panel.js.map +1 -1
- package/build/components/preferences-modal/options/enable-plugin-document-setting-panel.js +1 -6
- package/build/components/preferences-modal/options/enable-plugin-document-setting-panel.js.map +1 -1
- package/build/components/preferences-modal/options/enable-publish-sidebar.js +2 -8
- package/build/components/preferences-modal/options/enable-publish-sidebar.js.map +1 -1
- package/build/components/preferences-modal/options/index.js +0 -6
- package/build/components/preferences-modal/options/index.js.map +1 -1
- package/build/components/secondary-sidebar/inserter-sidebar.js +1 -9
- package/build/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
- package/build/components/secondary-sidebar/list-view-outline.js +1 -8
- package/build/components/secondary-sidebar/list-view-outline.js.map +1 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +32 -44
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build/components/sidebar/discussion-panel/index.js +0 -11
- package/build/components/sidebar/discussion-panel/index.js.map +1 -1
- package/build/components/sidebar/featured-image/index.js +0 -15
- package/build/components/sidebar/featured-image/index.js.map +1 -1
- package/build/components/sidebar/last-revision/index.js +1 -5
- package/build/components/sidebar/last-revision/index.js.map +1 -1
- package/build/components/sidebar/page-attributes/index.js +0 -14
- package/build/components/sidebar/page-attributes/index.js.map +1 -1
- package/build/components/sidebar/plugin-document-setting-panel/index.js +44 -61
- package/build/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
- package/build/components/sidebar/plugin-post-publish-panel/index.js +19 -25
- package/build/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
- package/build/components/sidebar/plugin-post-status-info/index.js +2 -5
- package/build/components/sidebar/plugin-post-status-info/index.js.map +1 -1
- package/build/components/sidebar/plugin-pre-publish-panel/index.js +19 -25
- package/build/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
- package/build/components/sidebar/plugin-sidebar/index.js +0 -8
- package/build/components/sidebar/plugin-sidebar/index.js.map +1 -1
- package/build/components/sidebar/post-author/index.js +1 -5
- package/build/components/sidebar/post-author/index.js.map +1 -1
- package/build/components/sidebar/post-excerpt/index.js +0 -13
- package/build/components/sidebar/post-excerpt/index.js.map +1 -1
- package/build/components/sidebar/post-format/index.js +1 -5
- package/build/components/sidebar/post-format/index.js.map +1 -1
- package/build/components/sidebar/post-pending-status/index.js +1 -5
- package/build/components/sidebar/post-pending-status/index.js.map +1 -1
- package/build/components/sidebar/post-schedule/index.js +5 -9
- package/build/components/sidebar/post-schedule/index.js.map +1 -1
- package/build/components/sidebar/post-slug/index.js +1 -5
- package/build/components/sidebar/post-slug/index.js.map +1 -1
- package/build/components/sidebar/post-status/index.js +0 -24
- package/build/components/sidebar/post-status/index.js.map +1 -1
- package/build/components/sidebar/post-sticky/index.js +1 -5
- package/build/components/sidebar/post-sticky/index.js.map +1 -1
- package/build/components/sidebar/post-taxonomies/index.js +1 -6
- package/build/components/sidebar/post-taxonomies/index.js.map +1 -1
- package/build/components/sidebar/post-taxonomies/taxonomy-panel.js +1 -11
- package/build/components/sidebar/post-taxonomies/taxonomy-panel.js.map +1 -1
- package/build/components/sidebar/post-template/create-modal.js +1 -16
- package/build/components/sidebar/post-template/create-modal.js.map +1 -1
- package/build/components/sidebar/post-template/form.js +3 -16
- package/build/components/sidebar/post-template/form.js.map +1 -1
- package/build/components/sidebar/post-template/index.js +5 -24
- package/build/components/sidebar/post-template/index.js.map +1 -1
- package/build/components/sidebar/post-trash/index.js +1 -3
- package/build/components/sidebar/post-trash/index.js.map +1 -1
- package/build/components/sidebar/post-url/index.js +5 -9
- package/build/components/sidebar/post-url/index.js.map +1 -1
- package/build/components/sidebar/post-visibility/index.js +5 -10
- package/build/components/sidebar/post-visibility/index.js.map +1 -1
- package/build/components/sidebar/settings-header/index.js +12 -17
- package/build/components/sidebar/settings-header/index.js.map +1 -1
- package/build/components/sidebar/settings-sidebar/index.js +2 -29
- package/build/components/sidebar/settings-sidebar/index.js.map +1 -1
- package/build/components/sidebar/template-summary/index.js +1 -9
- package/build/components/sidebar/template-summary/index.js.map +1 -1
- package/build/components/start-page-options/index.js +1 -15
- package/build/components/start-page-options/index.js.map +1 -1
- package/build/components/text-editor/index.js +1 -8
- package/build/components/text-editor/index.js.map +1 -1
- package/build/components/view-link/index.js +3 -10
- package/build/components/view-link/index.js.map +1 -1
- package/build/components/visual-editor/block-inspector-button.js +1 -11
- package/build/components/visual-editor/block-inspector-button.js.map +1 -1
- package/build/components/visual-editor/header.native.js +1 -12
- package/build/components/visual-editor/header.native.js.map +1 -1
- package/build/components/visual-editor/index.js +33 -53
- package/build/components/visual-editor/index.js.map +1 -1
- package/build/components/visual-editor/index.native.js +1 -9
- package/build/components/visual-editor/index.native.js.map +1 -1
- package/build/components/welcome-guide/default.js +1 -8
- package/build/components/welcome-guide/default.js.map +1 -1
- package/build/components/welcome-guide/image.js +0 -2
- package/build/components/welcome-guide/image.js.map +1 -1
- package/build/components/welcome-guide/index.js +1 -11
- package/build/components/welcome-guide/index.js.map +1 -1
- package/build/components/welcome-guide/template.js +1 -8
- package/build/components/welcome-guide/template.js.map +1 -1
- package/build/editor.js +7 -29
- package/build/editor.js.map +1 -1
- package/build/editor.native.js +10 -35
- package/build/editor.native.js.map +1 -1
- package/build/hooks/commands/use-common-commands.js +10 -24
- package/build/hooks/commands/use-common-commands.js.map +1 -1
- package/build/hooks/components/index.js +1 -3
- package/build/hooks/components/index.js.map +1 -1
- package/build/hooks/index.js +0 -1
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/validate-multiple-use/index.js +10 -18
- package/build/hooks/validate-multiple-use/index.js.map +1 -1
- package/build/index.js +14 -47
- package/build/index.js.map +1 -1
- package/build/index.native.js +0 -9
- package/build/index.native.js.map +1 -1
- package/build/lock-unlock.js +1 -2
- package/build/lock-unlock.js.map +1 -1
- package/build/plugins/copy-content-menu-item/index.js +1 -10
- package/build/plugins/copy-content-menu-item/index.js.map +1 -1
- package/build/plugins/index.js +5 -22
- package/build/plugins/index.js.map +1 -1
- package/build/plugins/keyboard-shortcuts-help-menu-item/index.js +1 -10
- package/build/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
- package/build/plugins/welcome-guide-menu-item/index.js +1 -6
- package/build/plugins/welcome-guide-menu-item/index.js.map +1 -1
- package/build/store/actions.js +53 -120
- package/build/store/actions.js.map +1 -1
- package/build/store/constants.js +2 -3
- package/build/store/constants.js.map +1 -1
- package/build/store/index.js +0 -9
- package/build/store/index.js.map +1 -1
- package/build/store/reducer.js +9 -42
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +63 -91
- package/build/store/selectors.js.map +1 -1
- package/build/utils/meta-boxes.js +0 -4
- package/build/utils/meta-boxes.js.map +1 -1
- package/build-module/components/block-manager/category.js +1 -8
- package/build-module/components/block-manager/category.js.map +1 -1
- package/build-module/components/block-manager/checklist.js +0 -3
- package/build-module/components/block-manager/checklist.js.map +1 -1
- package/build-module/components/block-manager/index.js +11 -14
- package/build-module/components/block-manager/index.js.map +1 -1
- package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +2 -8
- package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
- package/build-module/components/browser-url/index.js +7 -14
- package/build-module/components/browser-url/index.js.map +1 -1
- package/build-module/components/device-preview/index.js +1 -3
- package/build-module/components/device-preview/index.js.map +1 -1
- package/build-module/components/editor-initialization/index.js +1 -1
- package/build-module/components/editor-initialization/index.js.map +1 -1
- package/build-module/components/editor-initialization/listener-hooks.js +3 -5
- package/build-module/components/editor-initialization/listener-hooks.js.map +1 -1
- package/build-module/components/header/document-actions/index.js +1 -10
- package/build-module/components/header/document-actions/index.js.map +1 -1
- package/build-module/components/header/fullscreen-mode-close/index.js +4 -13
- package/build-module/components/header/fullscreen-mode-close/index.js.map +1 -1
- package/build-module/components/header/header-toolbar/index.js +5 -13
- package/build-module/components/header/header-toolbar/index.js.map +1 -1
- package/build-module/components/header/header-toolbar/index.native.js +3 -11
- package/build-module/components/header/header-toolbar/index.native.js.map +1 -1
- package/build-module/components/header/index.js +3 -5
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/header/index.native.js +2 -9
- package/build-module/components/header/index.native.js.map +1 -1
- package/build-module/components/header/main-dashboard-button/index.js +0 -5
- package/build-module/components/header/main-dashboard-button/index.js.map +1 -1
- package/build-module/components/header/mode-switcher/index.js +8 -16
- package/build-module/components/header/mode-switcher/index.js.map +1 -1
- package/build-module/components/header/more-menu/index.js +1 -4
- package/build-module/components/header/more-menu/index.js.map +1 -1
- package/build-module/components/header/plugin-more-menu-item/index.js +1 -2
- package/build-module/components/header/plugin-more-menu-item/index.js.map +1 -1
- package/build-module/components/header/plugin-sidebar-more-menu-item/index.js +3 -2
- package/build-module/components/header/plugin-sidebar-more-menu-item/index.js.map +1 -1
- package/build-module/components/header/post-publish-button-or-toggle.js +2 -5
- package/build-module/components/header/post-publish-button-or-toggle.js.map +1 -1
- package/build-module/components/header/preferences-menu-item/index.js +1 -2
- package/build-module/components/header/preferences-menu-item/index.js.map +1 -1
- package/build-module/components/header/tools-more-menu-group/index.js +0 -3
- package/build-module/components/header/tools-more-menu-group/index.js.map +1 -1
- package/build-module/components/header/writing-menu/index.js +1 -8
- package/build-module/components/header/writing-menu/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +1 -6
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +5 -13
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +0 -5
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/index.js +4 -14
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/layout/actions-panel.js +6 -8
- package/build-module/components/layout/actions-panel.js.map +1 -1
- package/build-module/components/layout/index.js +50 -57
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/layout/index.native.js +6 -20
- package/build-module/components/layout/index.native.js.map +1 -1
- package/build-module/components/meta-boxes/index.js +4 -6
- package/build-module/components/meta-boxes/index.js.map +1 -1
- package/build-module/components/meta-boxes/meta-box-visibility.js +1 -9
- package/build-module/components/meta-boxes/meta-box-visibility.js.map +1 -1
- package/build-module/components/meta-boxes/meta-boxes-area/index.js +3 -7
- package/build-module/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +2 -5
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/preferences-modal/meta-boxes-section.js +3 -5
- package/build-module/components/preferences-modal/meta-boxes-section.js.map +1 -1
- package/build-module/components/preferences-modal/options/enable-custom-fields.js +9 -2
- package/build-module/components/preferences-modal/options/enable-custom-fields.js.map +1 -1
- package/build-module/components/preferences-modal/options/enable-feature.js +1 -1
- package/build-module/components/preferences-modal/options/enable-feature.js.map +1 -1
- package/build-module/components/preferences-modal/options/enable-panel.js +1 -1
- package/build-module/components/preferences-modal/options/enable-panel.js.map +1 -1
- package/build-module/components/preferences-modal/options/enable-plugin-document-setting-panel.js +1 -4
- package/build-module/components/preferences-modal/options/enable-plugin-document-setting-panel.js.map +1 -1
- package/build-module/components/preferences-modal/options/enable-publish-sidebar.js +2 -1
- package/build-module/components/preferences-modal/options/enable-publish-sidebar.js.map +1 -1
- package/build-module/components/preferences-modal/options/index.js.map +1 -1
- package/build-module/components/secondary-sidebar/inserter-sidebar.js +1 -2
- package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
- package/build-module/components/secondary-sidebar/list-view-outline.js +0 -3
- package/build-module/components/secondary-sidebar/list-view-outline.js.map +1 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +32 -30
- package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build-module/components/sidebar/discussion-panel/index.js +2 -7
- package/build-module/components/sidebar/discussion-panel/index.js.map +1 -1
- package/build-module/components/sidebar/featured-image/index.js +2 -7
- package/build-module/components/sidebar/featured-image/index.js.map +1 -1
- package/build-module/components/sidebar/last-revision/index.js +0 -3
- package/build-module/components/sidebar/last-revision/index.js.map +1 -1
- package/build-module/components/sidebar/page-attributes/index.js +2 -7
- package/build-module/components/sidebar/page-attributes/index.js.map +1 -1
- package/build-module/components/sidebar/plugin-document-setting-panel/index.js +46 -55
- package/build-module/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
- package/build-module/components/sidebar/plugin-post-publish-panel/index.js +19 -22
- package/build-module/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
- package/build-module/components/sidebar/plugin-post-status-info/index.js +1 -3
- package/build-module/components/sidebar/plugin-post-status-info/index.js.map +1 -1
- package/build-module/components/sidebar/plugin-pre-publish-panel/index.js +19 -22
- package/build-module/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
- package/build-module/components/sidebar/plugin-sidebar/index.js +2 -3
- package/build-module/components/sidebar/plugin-sidebar/index.js.map +1 -1
- package/build-module/components/sidebar/post-author/index.js +0 -1
- package/build-module/components/sidebar/post-author/index.js.map +1 -1
- package/build-module/components/sidebar/post-excerpt/index.js +2 -7
- package/build-module/components/sidebar/post-excerpt/index.js.map +1 -1
- package/build-module/components/sidebar/post-format/index.js +0 -1
- package/build-module/components/sidebar/post-format/index.js.map +1 -1
- package/build-module/components/sidebar/post-pending-status/index.js +0 -1
- package/build-module/components/sidebar/post-pending-status/index.js.map +1 -1
- package/build-module/components/sidebar/post-schedule/index.js +4 -5
- package/build-module/components/sidebar/post-schedule/index.js.map +1 -1
- package/build-module/components/sidebar/post-slug/index.js +0 -1
- package/build-module/components/sidebar/post-slug/index.js.map +1 -1
- package/build-module/components/sidebar/post-status/index.js +2 -6
- package/build-module/components/sidebar/post-status/index.js.map +1 -1
- package/build-module/components/sidebar/post-sticky/index.js +0 -1
- package/build-module/components/sidebar/post-sticky/index.js.map +1 -1
- package/build-module/components/sidebar/post-taxonomies/index.js +1 -4
- package/build-module/components/sidebar/post-taxonomies/index.js.map +1 -1
- package/build-module/components/sidebar/post-taxonomies/taxonomy-panel.js +1 -7
- package/build-module/components/sidebar/post-taxonomies/taxonomy-panel.js.map +1 -1
- package/build-module/components/sidebar/post-template/create-modal.js +1 -10
- package/build-module/components/sidebar/post-template/create-modal.js.map +1 -1
- package/build-module/components/sidebar/post-template/form.js +3 -6
- package/build-module/components/sidebar/post-template/form.js.map +1 -1
- package/build-module/components/sidebar/post-template/index.js +5 -16
- package/build-module/components/sidebar/post-template/index.js.map +1 -1
- package/build-module/components/sidebar/post-trash/index.js +0 -1
- package/build-module/components/sidebar/post-trash/index.js.map +1 -1
- package/build-module/components/sidebar/post-url/index.js +4 -5
- package/build-module/components/sidebar/post-url/index.js.map +1 -1
- package/build-module/components/sidebar/post-visibility/index.js +4 -6
- package/build-module/components/sidebar/post-visibility/index.js.map +1 -1
- package/build-module/components/sidebar/settings-header/index.js +12 -13
- package/build-module/components/sidebar/settings-header/index.js.map +1 -1
- package/build-module/components/sidebar/settings-sidebar/index.js +2 -9
- package/build-module/components/sidebar/settings-sidebar/index.js.map +1 -1
- package/build-module/components/sidebar/template-summary/index.js +1 -6
- package/build-module/components/sidebar/template-summary/index.js.map +1 -1
- package/build-module/components/start-page-options/index.js +1 -8
- package/build-module/components/start-page-options/index.js.map +1 -1
- package/build-module/components/text-editor/index.js +1 -2
- package/build-module/components/text-editor/index.js.map +1 -1
- package/build-module/components/view-link/index.js +2 -3
- package/build-module/components/view-link/index.js.map +1 -1
- package/build-module/components/visual-editor/block-inspector-button.js +1 -5
- package/build-module/components/visual-editor/block-inspector-button.js.map +1 -1
- package/build-module/components/visual-editor/header.native.js +1 -4
- package/build-module/components/visual-editor/header.native.js.map +1 -1
- package/build-module/components/visual-editor/index.js +34 -43
- package/build-module/components/visual-editor/index.js.map +1 -1
- package/build-module/components/visual-editor/index.native.js +1 -5
- package/build-module/components/visual-editor/index.native.js.map +1 -1
- package/build-module/components/welcome-guide/default.js +1 -2
- package/build-module/components/welcome-guide/default.js.map +1 -1
- package/build-module/components/welcome-guide/image.js.map +1 -1
- package/build-module/components/welcome-guide/index.js +1 -6
- package/build-module/components/welcome-guide/index.js.map +1 -1
- package/build-module/components/welcome-guide/template.js +1 -2
- package/build-module/components/welcome-guide/template.js.map +1 -1
- package/build-module/editor.js +7 -14
- package/build-module/editor.js.map +1 -1
- package/build-module/editor.native.js +11 -23
- package/build-module/editor.native.js.map +1 -1
- package/build-module/hooks/commands/use-common-commands.js +11 -14
- package/build-module/hooks/commands/use-common-commands.js.map +1 -1
- package/build-module/hooks/components/index.js +0 -2
- package/build-module/hooks/components/index.js.map +1 -1
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/validate-multiple-use/index.js +9 -11
- package/build-module/hooks/validate-multiple-use/index.js.map +1 -1
- package/build-module/index.js +16 -25
- package/build-module/index.js.map +1 -1
- package/build-module/index.native.js +2 -3
- package/build-module/index.native.js.map +1 -1
- package/build-module/lock-unlock.js.map +1 -1
- package/build-module/plugins/copy-content-menu-item/index.js +0 -3
- package/build-module/plugins/copy-content-menu-item/index.js.map +1 -1
- package/build-module/plugins/index.js +5 -11
- package/build-module/plugins/index.js.map +1 -1
- package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js +1 -2
- package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
- package/build-module/plugins/welcome-guide-menu-item/index.js +1 -2
- package/build-module/plugins/welcome-guide-menu-item/index.js.map +1 -1
- package/build-module/store/actions.js +55 -66
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/constants.js +2 -2
- package/build-module/store/constants.js.map +1 -1
- package/build-module/store/index.js +2 -2
- package/build-module/store/index.js.map +1 -1
- package/build-module/store/reducer.js +10 -33
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +63 -64
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/meta-boxes.js +0 -2
- package/build-module/utils/meta-boxes.js.map +1 -1
- package/build-style/style-rtl.css +19 -9
- package/build-style/style.css +19 -9
- package/package.json +32 -32
- package/src/components/keyboard-shortcut-help-modal/test/__snapshots__/index.js.snap +29 -0
- package/src/components/keyboard-shortcuts/index.js +2 -2
- package/src/components/layout/index.js +56 -40
- package/src/components/preferences-modal/options/enable-custom-fields.js +15 -4
- package/src/components/preferences-modal/options/test/enable-custom-fields.js +6 -1
- package/src/components/sidebar/plugin-document-setting-panel/index.js +54 -65
- package/src/components/sidebar/plugin-post-publish-panel/index.js +23 -27
- package/src/components/sidebar/plugin-pre-publish-panel/index.js +25 -28
- package/src/components/sidebar/post-schedule/style.scss +2 -0
- package/src/components/visual-editor/index.js +9 -8
- package/src/components/visual-editor/style.scss +5 -1
- package/src/hooks/commands/use-common-commands.js +8 -12
- package/src/store/selectors.js +10 -3
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import { createElement } from "@wordpress/element";
|
|
2
|
-
|
|
3
2
|
/**
|
|
4
3
|
* WordPress dependencies
|
|
5
4
|
*/
|
|
6
5
|
import { useSelect } from '@wordpress/data';
|
|
7
6
|
import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';
|
|
7
|
+
|
|
8
8
|
/**
|
|
9
9
|
* Internal dependencies
|
|
10
10
|
*/
|
|
11
|
-
|
|
12
11
|
import Shortcut from './shortcut';
|
|
13
|
-
|
|
14
12
|
function DynamicShortcut({
|
|
15
13
|
name
|
|
16
14
|
}) {
|
|
@@ -30,17 +28,14 @@ function DynamicShortcut({
|
|
|
30
28
|
description: getShortcutDescription(name)
|
|
31
29
|
};
|
|
32
30
|
}, [name]);
|
|
33
|
-
|
|
34
31
|
if (!keyCombination) {
|
|
35
32
|
return null;
|
|
36
33
|
}
|
|
37
|
-
|
|
38
34
|
return createElement(Shortcut, {
|
|
39
35
|
keyCombination: keyCombination,
|
|
40
36
|
description: description,
|
|
41
37
|
aliases: aliases
|
|
42
38
|
});
|
|
43
39
|
}
|
|
44
|
-
|
|
45
40
|
export default DynamicShortcut;
|
|
46
41
|
//# sourceMappingURL=dynamic-shortcut.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["useSelect","store","keyboardShortcutsStore","Shortcut","DynamicShortcut","name","keyCombination","description","aliases","select","getShortcutKeyCombination","getShortcutDescription","getShortcutAliases","createElement"],"sources":["@wordpress/edit-post/src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\n\n/**\n * Internal dependencies\n */\nimport Shortcut from './shortcut';\n\nfunction DynamicShortcut( { name } ) {\n\tconst { keyCombination, description, aliases } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetShortcutKeyCombination,\n\t\t\t\tgetShortcutDescription,\n\t\t\t\tgetShortcutAliases,\n\t\t\t} = select( keyboardShortcutsStore );\n\n\t\t\treturn {\n\t\t\t\tkeyCombination: getShortcutKeyCombination( name ),\n\t\t\t\taliases: getShortcutAliases( name ),\n\t\t\t\tdescription: getShortcutDescription( name ),\n\t\t\t};\n\t\t},\n\t\t[ name ]\n\t);\n\n\tif ( ! keyCombination ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Shortcut\n\t\t\tkeyCombination={ keyCombination }\n\t\t\tdescription={ description }\n\t\t\taliases={ aliases }\n\t\t/>\n\t);\n}\n\nexport default DynamicShortcut;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,sBAAsB,QAAQ,+BAA+B;;AAE/E;AACA;AACA;AACA,OAAOC,QAAQ,MAAM,YAAY;AAEjC,SAASC,eAAeA,CAAE;EAAEC;AAAK,CAAC,EAAG;EACpC,MAAM;IAAEC,cAAc;IAAEC,WAAW;IAAEC;EAAQ,CAAC,GAAGR,SAAS,CACvDS,MAAM,IAAM;IACb,MAAM;MACLC,yBAAyB;MACzBC,sBAAsB;MACtBC;IACD,CAAC,GAAGH,MAAM,CAAEP,sBAAuB,CAAC;IAEpC,OAAO;MACNI,cAAc,EAAEI,yBAAyB,CAAEL,IAAK,CAAC;MACjDG,OAAO,EAAEI,kBAAkB,CAAEP,IAAK,CAAC;MACnCE,WAAW,EAAEI,sBAAsB,CAAEN,IAAK;IAC3C,CAAC;EACF,CAAC,EACD,CAAEA,IAAI,CACP,CAAC;EAED,IAAK,CAAEC,cAAc,EAAG;IACvB,OAAO,IAAI;EACZ;EAEA,OACCO,aAAA,CAACV,QAAQ;IACRG,cAAc,EAAGA,cAAgB;IACjCC,WAAW,EAAGA,WAAa;IAC3BC,OAAO,EAAGA;EAAS,CACnB,CAAC;AAEJ;AAEA,eAAeJ,eAAe"}
|
|
@@ -1,28 +1,26 @@
|
|
|
1
1
|
import { createElement } from "@wordpress/element";
|
|
2
|
-
|
|
3
2
|
/**
|
|
4
3
|
* External dependencies
|
|
5
4
|
*/
|
|
6
5
|
import classnames from 'classnames';
|
|
6
|
+
|
|
7
7
|
/**
|
|
8
8
|
* WordPress dependencies
|
|
9
9
|
*/
|
|
10
|
-
|
|
11
10
|
import { Modal } from '@wordpress/components';
|
|
12
11
|
import { __ } from '@wordpress/i18n';
|
|
13
12
|
import { useShortcut, store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';
|
|
14
13
|
import { withSelect, withDispatch, useSelect } from '@wordpress/data';
|
|
15
14
|
import { compose } from '@wordpress/compose';
|
|
16
15
|
import { store as interfaceStore } from '@wordpress/interface';
|
|
16
|
+
|
|
17
17
|
/**
|
|
18
18
|
* Internal dependencies
|
|
19
19
|
*/
|
|
20
|
-
|
|
21
20
|
import { textFormattingShortcuts } from './config';
|
|
22
21
|
import Shortcut from './shortcut';
|
|
23
22
|
import DynamicShortcut from './dynamic-shortcut';
|
|
24
23
|
export const KEYBOARD_SHORTCUT_HELP_MODAL_NAME = 'edit-post/keyboard-shortcut-help';
|
|
25
|
-
|
|
26
24
|
const ShortcutList = ({
|
|
27
25
|
shortcuts
|
|
28
26
|
}) =>
|
|
@@ -30,7 +28,6 @@ const ShortcutList = ({
|
|
|
30
28
|
* Disable reason: The `list` ARIA role is redundant but
|
|
31
29
|
* Safari+VoiceOver won't announce the list otherwise.
|
|
32
30
|
*/
|
|
33
|
-
|
|
34
31
|
/* eslint-disable jsx-a11y/no-redundant-roles */
|
|
35
32
|
createElement("ul", {
|
|
36
33
|
className: "edit-post-keyboard-shortcut-help-modal__shortcut-list",
|
|
@@ -40,10 +37,10 @@ createElement("ul", {
|
|
|
40
37
|
key: index
|
|
41
38
|
}, typeof shortcut === 'string' ? createElement(DynamicShortcut, {
|
|
42
39
|
name: shortcut
|
|
43
|
-
}) : createElement(Shortcut, {
|
|
40
|
+
}) : createElement(Shortcut, {
|
|
41
|
+
...shortcut
|
|
44
42
|
}))))
|
|
45
|
-
/* eslint-enable jsx-a11y/no-redundant-roles
|
|
46
|
-
;
|
|
43
|
+
/* eslint-enable jsx-a11y/no-redundant-roles */;
|
|
47
44
|
|
|
48
45
|
const ShortcutSection = ({
|
|
49
46
|
title,
|
|
@@ -56,7 +53,6 @@ const ShortcutSection = ({
|
|
|
56
53
|
}, title), createElement(ShortcutList, {
|
|
57
54
|
shortcuts: shortcuts
|
|
58
55
|
}));
|
|
59
|
-
|
|
60
56
|
const ShortcutCategorySection = ({
|
|
61
57
|
title,
|
|
62
58
|
categoryName,
|
|
@@ -70,17 +66,14 @@ const ShortcutCategorySection = ({
|
|
|
70
66
|
shortcuts: categoryShortcuts.concat(additionalShortcuts)
|
|
71
67
|
});
|
|
72
68
|
};
|
|
73
|
-
|
|
74
69
|
export function KeyboardShortcutHelpModal({
|
|
75
70
|
isModalActive,
|
|
76
71
|
toggleModal
|
|
77
72
|
}) {
|
|
78
73
|
useShortcut('core/edit-post/keyboard-shortcuts', toggleModal);
|
|
79
|
-
|
|
80
74
|
if (!isModalActive) {
|
|
81
75
|
return null;
|
|
82
76
|
}
|
|
83
|
-
|
|
84
77
|
return createElement(Modal, {
|
|
85
78
|
className: "edit-post-keyboard-shortcut-help-modal",
|
|
86
79
|
title: __('Keyboard shortcuts'),
|
|
@@ -103,7 +96,6 @@ export function KeyboardShortcutHelpModal({
|
|
|
103
96
|
character: '/'
|
|
104
97
|
},
|
|
105
98
|
description: __('Change the block type after adding a new paragraph.'),
|
|
106
|
-
|
|
107
99
|
/* translators: The forward-slash character. e.g. '/'. */
|
|
108
100
|
ariaLabel: __('Forward-slash')
|
|
109
101
|
}]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["classnames","Modal","__","useShortcut","store","keyboardShortcutsStore","withSelect","withDispatch","useSelect","compose","interfaceStore","textFormattingShortcuts","Shortcut","DynamicShortcut","KEYBOARD_SHORTCUT_HELP_MODAL_NAME","ShortcutList","shortcuts","createElement","className","role","map","shortcut","index","key","name","ShortcutSection","title","ShortcutCategorySection","categoryName","additionalShortcuts","categoryShortcuts","select","getCategoryShortcuts","concat","KeyboardShortcutHelpModal","isModalActive","toggleModal","closeButtonLabel","onRequestClose","keyCombination","character","description","ariaLabel","dispatch","openModal","closeModal"],"sources":["@wordpress/edit-post/src/components/keyboard-shortcut-help-modal/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Modal } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { withSelect, withDispatch, useSelect } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { textFormattingShortcuts } from './config';\nimport Shortcut from './shortcut';\nimport DynamicShortcut from './dynamic-shortcut';\n\nexport const KEYBOARD_SHORTCUT_HELP_MODAL_NAME =\n\t'edit-post/keyboard-shortcut-help';\n\nconst ShortcutList = ( { shortcuts } ) => (\n\t/*\n\t * Disable reason: The `list` ARIA role is redundant but\n\t * Safari+VoiceOver won't announce the list otherwise.\n\t */\n\t/* eslint-disable jsx-a11y/no-redundant-roles */\n\t<ul\n\t\tclassName=\"edit-post-keyboard-shortcut-help-modal__shortcut-list\"\n\t\trole=\"list\"\n\t>\n\t\t{ shortcuts.map( ( shortcut, index ) => (\n\t\t\t<li\n\t\t\t\tclassName=\"edit-post-keyboard-shortcut-help-modal__shortcut\"\n\t\t\t\tkey={ index }\n\t\t\t>\n\t\t\t\t{ typeof shortcut === 'string' ? (\n\t\t\t\t\t<DynamicShortcut name={ shortcut } />\n\t\t\t\t) : (\n\t\t\t\t\t<Shortcut { ...shortcut } />\n\t\t\t\t) }\n\t\t\t</li>\n\t\t) ) }\n\t</ul>\n\t/* eslint-enable jsx-a11y/no-redundant-roles */\n);\n\nconst ShortcutSection = ( { title, shortcuts, className } ) => (\n\t<section\n\t\tclassName={ classnames(\n\t\t\t'edit-post-keyboard-shortcut-help-modal__section',\n\t\t\tclassName\n\t\t) }\n\t>\n\t\t{ !! title && (\n\t\t\t<h2 className=\"edit-post-keyboard-shortcut-help-modal__section-title\">\n\t\t\t\t{ title }\n\t\t\t</h2>\n\t\t) }\n\t\t<ShortcutList shortcuts={ shortcuts } />\n\t</section>\n);\n\nconst ShortcutCategorySection = ( {\n\ttitle,\n\tcategoryName,\n\tadditionalShortcuts = [],\n} ) => {\n\tconst categoryShortcuts = useSelect(\n\t\t( select ) => {\n\t\t\treturn select( keyboardShortcutsStore ).getCategoryShortcuts(\n\t\t\t\tcategoryName\n\t\t\t);\n\t\t},\n\t\t[ categoryName ]\n\t);\n\n\treturn (\n\t\t<ShortcutSection\n\t\t\ttitle={ title }\n\t\t\tshortcuts={ categoryShortcuts.concat( additionalShortcuts ) }\n\t\t/>\n\t);\n};\n\nexport function KeyboardShortcutHelpModal( { isModalActive, toggleModal } ) {\n\tuseShortcut( 'core/edit-post/keyboard-shortcuts', toggleModal );\n\n\tif ( ! isModalActive ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Modal\n\t\t\tclassName=\"edit-post-keyboard-shortcut-help-modal\"\n\t\t\ttitle={ __( 'Keyboard shortcuts' ) }\n\t\t\tcloseButtonLabel={ __( 'Close' ) }\n\t\t\tonRequestClose={ toggleModal }\n\t\t>\n\t\t\t<ShortcutSection\n\t\t\t\tclassName=\"edit-post-keyboard-shortcut-help-modal__main-shortcuts\"\n\t\t\t\tshortcuts={ [ 'core/edit-post/keyboard-shortcuts' ] }\n\t\t\t/>\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'Global shortcuts' ) }\n\t\t\t\tcategoryName=\"global\"\n\t\t\t/>\n\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'Selection shortcuts' ) }\n\t\t\t\tcategoryName=\"selection\"\n\t\t\t/>\n\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'Block shortcuts' ) }\n\t\t\t\tcategoryName=\"block\"\n\t\t\t\tadditionalShortcuts={ [\n\t\t\t\t\t{\n\t\t\t\t\t\tkeyCombination: { character: '/' },\n\t\t\t\t\t\tdescription: __(\n\t\t\t\t\t\t\t'Change the block type after adding a new paragraph.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t/* translators: The forward-slash character. e.g. '/'. */\n\t\t\t\t\t\tariaLabel: __( 'Forward-slash' ),\n\t\t\t\t\t},\n\t\t\t\t] }\n\t\t\t/>\n\t\t\t<ShortcutSection\n\t\t\t\ttitle={ __( 'Text formatting' ) }\n\t\t\t\tshortcuts={ textFormattingShortcuts }\n\t\t\t/>\n\t\t</Modal>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => ( {\n\t\tisModalActive: select( interfaceStore ).isModalActive(\n\t\t\tKEYBOARD_SHORTCUT_HELP_MODAL_NAME\n\t\t),\n\t} ) ),\n\twithDispatch( ( dispatch, { isModalActive } ) => {\n\t\tconst { openModal, closeModal } = dispatch( interfaceStore );\n\n\t\treturn {\n\t\t\ttoggleModal: () =>\n\t\t\t\tisModalActive\n\t\t\t\t\t? closeModal()\n\t\t\t\t\t: openModal( KEYBOARD_SHORTCUT_HELP_MODAL_NAME ),\n\t\t};\n\t} ),\n] )( KeyboardShortcutHelpModal );\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SACCC,WAAW,EACXC,KAAK,IAAIC,sBAAsB,QACzB,+BAA+B;AACtC,SAASC,UAAU,EAAEC,YAAY,EAAEC,SAAS,QAAQ,iBAAiB;AACrE,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASL,KAAK,IAAIM,cAAc,QAAQ,sBAAsB;;AAE9D;AACA;AACA;AACA,SAASC,uBAAuB,QAAQ,UAAU;AAClD,OAAOC,QAAQ,MAAM,YAAY;AACjC,OAAOC,eAAe,MAAM,oBAAoB;AAEhD,OAAO,MAAMC,iCAAiC,GAC7C,kCAAkC;AAEnC,MAAMC,YAAY,GAAGA,CAAE;EAAEC;AAAU,CAAC;AACnC;AACD;AACA;AACA;AACC;AACAC,aAAA;EACCC,SAAS,EAAC,uDAAuD;EACjEC,IAAI,EAAC;AAAM,GAETH,SAAS,CAACI,GAAG,CAAE,CAAEC,QAAQ,EAAEC,KAAK,KACjCL,aAAA;EACCC,SAAS,EAAC,kDAAkD;EAC5DK,GAAG,EAAGD;AAAO,GAEX,OAAOD,QAAQ,KAAK,QAAQ,GAC7BJ,aAAA,CAACJ,eAAe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
import { createElement } from "@wordpress/element";
|
|
2
|
-
|
|
3
2
|
/**
|
|
4
3
|
* WordPress dependencies
|
|
5
4
|
*/
|
|
6
5
|
import { Fragment } from '@wordpress/element';
|
|
7
6
|
import { displayShortcutList, shortcutAriaLabel } from '@wordpress/keycodes';
|
|
8
|
-
|
|
9
7
|
function KeyCombination({
|
|
10
8
|
keyCombination,
|
|
11
9
|
forceAriaLabel
|
|
@@ -21,14 +19,12 @@ function KeyCombination({
|
|
|
21
19
|
key: index
|
|
22
20
|
}, character);
|
|
23
21
|
}
|
|
24
|
-
|
|
25
22
|
return createElement("kbd", {
|
|
26
23
|
key: index,
|
|
27
24
|
className: "edit-post-keyboard-shortcut-help-modal__shortcut-key"
|
|
28
25
|
}, character);
|
|
29
26
|
}));
|
|
30
27
|
}
|
|
31
|
-
|
|
32
28
|
function Shortcut({
|
|
33
29
|
description,
|
|
34
30
|
keyCombination,
|
|
@@ -48,6 +44,5 @@ function Shortcut({
|
|
|
48
44
|
key: index
|
|
49
45
|
}))));
|
|
50
46
|
}
|
|
51
|
-
|
|
52
47
|
export default Shortcut;
|
|
53
48
|
//# sourceMappingURL=shortcut.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["Fragment","displayShortcutList","shortcutAriaLabel","KeyCombination","keyCombination","forceAriaLabel","shortcut","modifier","character","ariaLabel","createElement","className","Array","isArray","map","index","key","Shortcut","description","aliases","alias"],"sources":["@wordpress/edit-post/src/components/keyboard-shortcut-help-modal/shortcut.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Fragment } from '@wordpress/element';\nimport { displayShortcutList, shortcutAriaLabel } from '@wordpress/keycodes';\n\nfunction KeyCombination( { keyCombination, forceAriaLabel } ) {\n\tconst shortcut = keyCombination.modifier\n\t\t? displayShortcutList[ keyCombination.modifier ](\n\t\t\t\tkeyCombination.character\n\t\t )\n\t\t: keyCombination.character;\n\tconst ariaLabel = keyCombination.modifier\n\t\t? shortcutAriaLabel[ keyCombination.modifier ](\n\t\t\t\tkeyCombination.character\n\t\t )\n\t\t: keyCombination.character;\n\n\treturn (\n\t\t<kbd\n\t\t\tclassName=\"edit-post-keyboard-shortcut-help-modal__shortcut-key-combination\"\n\t\t\taria-label={ forceAriaLabel || ariaLabel }\n\t\t>\n\t\t\t{ ( Array.isArray( shortcut ) ? shortcut : [ shortcut ] ).map(\n\t\t\t\t( character, index ) => {\n\t\t\t\t\tif ( character === '+' ) {\n\t\t\t\t\t\treturn <Fragment key={ index }>{ character }</Fragment>;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<kbd\n\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\tclassName=\"edit-post-keyboard-shortcut-help-modal__shortcut-key\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ character }\n\t\t\t\t\t\t</kbd>\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t) }\n\t\t</kbd>\n\t);\n}\n\nfunction Shortcut( { description, keyCombination, aliases = [], ariaLabel } ) {\n\treturn (\n\t\t<>\n\t\t\t<div className=\"edit-post-keyboard-shortcut-help-modal__shortcut-description\">\n\t\t\t\t{ description }\n\t\t\t</div>\n\t\t\t<div className=\"edit-post-keyboard-shortcut-help-modal__shortcut-term\">\n\t\t\t\t<KeyCombination\n\t\t\t\t\tkeyCombination={ keyCombination }\n\t\t\t\t\tforceAriaLabel={ ariaLabel }\n\t\t\t\t/>\n\t\t\t\t{ aliases.map( ( alias, index ) => (\n\t\t\t\t\t<KeyCombination\n\t\t\t\t\t\tkeyCombination={ alias }\n\t\t\t\t\t\tforceAriaLabel={ ariaLabel }\n\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default Shortcut;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,mBAAmB,EA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AAK,KAC5BL,aAAA,CAACP,cAAc;IACdC,cAAc,EAAGgB,KAAO;IACxBf,cAAc,EAAGI,SAAW;IAC5BO,GAAG,EAAGD;EAAO,CACb,CACA,CACE,CACJ,CAAC;AAEL;AAEA,eAAeE,QAAQ"}
|
|
@@ -10,12 +10,11 @@ import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
|
10
10
|
import { store as noticesStore } from '@wordpress/notices';
|
|
11
11
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
12
12
|
import { createBlock } from '@wordpress/blocks';
|
|
13
|
+
|
|
13
14
|
/**
|
|
14
15
|
* Internal dependencies
|
|
15
16
|
*/
|
|
16
|
-
|
|
17
17
|
import { store as editPostStore } from '../../store';
|
|
18
|
-
|
|
19
18
|
function KeyboardShortcuts() {
|
|
20
19
|
const {
|
|
21
20
|
getBlockSelectionStart
|
|
@@ -50,14 +49,12 @@ function KeyboardShortcuts() {
|
|
|
50
49
|
const {
|
|
51
50
|
set: setPreference
|
|
52
51
|
} = useDispatch(preferencesStore);
|
|
53
|
-
|
|
54
52
|
const toggleDistractionFree = () => {
|
|
55
53
|
setPreference('core/edit-post', 'fixedToolbar', false);
|
|
56
54
|
setIsInserterOpened(false);
|
|
57
55
|
setIsListViewOpened(false);
|
|
58
56
|
closeGeneralSidebar();
|
|
59
57
|
};
|
|
60
|
-
|
|
61
58
|
const {
|
|
62
59
|
replaceBlocks
|
|
63
60
|
} = useDispatch(blockEditorStore);
|
|
@@ -66,22 +63,17 @@ function KeyboardShortcuts() {
|
|
|
66
63
|
getSelectedBlockClientId,
|
|
67
64
|
getBlockAttributes
|
|
68
65
|
} = useSelect(blockEditorStore);
|
|
69
|
-
|
|
70
66
|
const handleTextLevelShortcut = (event, level) => {
|
|
71
67
|
event.preventDefault();
|
|
72
68
|
const destinationBlockName = level === 0 ? 'core/paragraph' : 'core/heading';
|
|
73
69
|
const currentClientId = getSelectedBlockClientId();
|
|
74
|
-
|
|
75
70
|
if (currentClientId === null) {
|
|
76
71
|
return;
|
|
77
72
|
}
|
|
78
|
-
|
|
79
73
|
const blockName = getBlockName(currentClientId);
|
|
80
|
-
|
|
81
74
|
if (blockName !== 'core/paragraph' && blockName !== 'core/heading') {
|
|
82
75
|
return;
|
|
83
76
|
}
|
|
84
|
-
|
|
85
77
|
const attributes = getBlockAttributes(currentClientId);
|
|
86
78
|
const textAlign = blockName === 'core/paragraph' ? 'align' : 'textAlign';
|
|
87
79
|
const destinationTextAlign = destinationBlockName === 'core/paragraph' ? 'align' : 'textAlign';
|
|
@@ -93,7 +85,6 @@ function KeyboardShortcuts() {
|
|
|
93
85
|
}
|
|
94
86
|
}));
|
|
95
87
|
};
|
|
96
|
-
|
|
97
88
|
useEffect(() => {
|
|
98
89
|
registerShortcut({
|
|
99
90
|
name: 'core/edit-post/toggle-mode',
|
|
@@ -210,7 +201,7 @@ function KeyboardShortcuts() {
|
|
|
210
201
|
useShortcut('core/edit-post/toggle-distraction-free', () => {
|
|
211
202
|
toggleDistractionFree();
|
|
212
203
|
toggleFeature('distractionFree');
|
|
213
|
-
createInfoNotice(isFeatureActive('distractionFree') ? __('Distraction free
|
|
204
|
+
createInfoNotice(isFeatureActive('distractionFree') ? __('Distraction free on.') : __('Distraction free off.'), {
|
|
214
205
|
id: 'core/edit-post/distraction-free-mode/notice',
|
|
215
206
|
type: 'snackbar'
|
|
216
207
|
});
|
|
@@ -219,15 +210,15 @@ function KeyboardShortcuts() {
|
|
|
219
210
|
// This shortcut has no known clashes, but use preventDefault to prevent any
|
|
220
211
|
// obscure shortcuts from triggering.
|
|
221
212
|
event.preventDefault();
|
|
222
|
-
|
|
223
213
|
if (isEditorSidebarOpened()) {
|
|
224
214
|
closeGeneralSidebar();
|
|
225
215
|
} else {
|
|
226
216
|
const sidebarToOpen = getBlockSelectionStart() ? 'edit-post/block' : 'edit-post/document';
|
|
227
217
|
openGeneralSidebar(sidebarToOpen);
|
|
228
218
|
}
|
|
229
|
-
});
|
|
219
|
+
});
|
|
230
220
|
|
|
221
|
+
// Only opens the list view. Other functionality for this shortcut happens in the rendered sidebar.
|
|
231
222
|
useShortcut('core/edit-post/toggle-list-view', () => {
|
|
232
223
|
if (!isListViewOpened()) {
|
|
233
224
|
setIsListViewOpened(true);
|
|
@@ -242,6 +233,5 @@ function KeyboardShortcuts() {
|
|
|
242
233
|
});
|
|
243
234
|
return null;
|
|
244
235
|
}
|
|
245
|
-
|
|
246
236
|
export default KeyboardShortcuts;
|
|
247
237
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/keyboard-shortcuts/index.js"],"names":["useEffect","useSelect","useDispatch","useShortcut","store","keyboardShortcutsStore","__","editorStore","blockEditorStore","noticesStore","preferencesStore","createBlock","editPostStore","KeyboardShortcuts","getBlockSelectionStart","getEditorMode","isEditorSidebarOpened","isListViewOpened","isFeatureActive","isModeToggleDisabled","select","richEditingEnabled","codeEditingEnabled","getEditorSettings","createInfoNotice","switchEditorMode","openGeneralSidebar","closeGeneralSidebar","toggleFeature","setIsListViewOpened","setIsInserterOpened","registerShortcut","set","setPreference","toggleDistractionFree","replaceBlocks","getBlockName","getSelectedBlockClientId","getBlockAttributes","handleTextLevelShortcut","event","level","preventDefault","destinationBlockName","currentClientId","blockName","attributes","textAlign","destinationTextAlign","content","name","category","description","keyCombination","modifier","character","aliases","forEach","isDisabled","id","type","sidebarToOpen"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,oBAA1B;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SACCC,WADD,EAECC,KAAK,IAAIC,sBAFV,QAGO,+BAHP;AAIA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASF,KAAK,IAAIG,WAAlB,QAAqC,mBAArC;AACA,SAASH,KAAK,IAAII,gBAAlB,QAA0C,yBAA1C;AACA,SAASJ,KAAK,IAAIK,YAAlB,QAAsC,oBAAtC;AACA,SAASL,KA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AAqB,EAA1B,EAA+B;AAC9BW,MAAAA,mBAAmB;AACnB,KAFD,MAEO;AACN,YAAMkC,aAAa,GAAG/C,sBAAsB,KACzC,iBADyC,GAEzC,oBAFH;AAGAY,MAAAA,kBAAkB,CAAEmC,aAAF,CAAlB;AACA;AACD,GAbU,CAAX,CAzN4B,CAwO5B;;AACA1D,EAAAA,WAAW,CAAE,iCAAF,EAAqC,MAAM;AACrD,QAAK,CAAEc,gBAAgB,EAAvB,EAA4B;AAC3BY,MAAAA,mBAAmB,CAAE,IAAF,CAAnB;AACA;AACD,GAJU,CAAX;AAMA1B,EAAAA,WAAW,CAAE,+CAAF,EAAqDqC,KAAF,IAC7DD,uBAAuB,CAAEC,KAAF,EAAS,CAAT,CADb,CAAX;AAIA,GAAE,CAAF,EAAK,CAAL,EAAQ,CAAR,EAAW,CAAX,EAAc,CAAd,EAAiB,CAAjB,EAAqBiB,OAArB,CAAgChB,KAAF,IAAa;AAC1C;AACA;AACA;AACAtC,IAAAA,WAAW,CACT,iDAAiDsC,KAAO,EAD/C,EAERD,KAAF,IAAaD,uBAAuB,CAAEC,KAAF,EAASC,KAAT,CAF1B,CAAX;AAIA,GARD;AAUA,SAAO,IAAP;AACA;;AAED,eAAe5B,iBAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { __ } from '@wordpress/i18n';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { createBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nfunction KeyboardShortcuts() {\n\tconst { getBlockSelectionStart } = useSelect( blockEditorStore );\n\tconst {\n\t\tgetEditorMode,\n\t\tisEditorSidebarOpened,\n\t\tisListViewOpened,\n\t\tisFeatureActive,\n\t} = useSelect( editPostStore );\n\tconst isModeToggleDisabled = useSelect( ( select ) => {\n\t\tconst { richEditingEnabled, codeEditingEnabled } =\n\t\t\tselect( editorStore ).getEditorSettings();\n\t\treturn ! richEditingEnabled || ! codeEditingEnabled;\n\t}, [] );\n\n\tconst { createInfoNotice } = useDispatch( noticesStore );\n\n\tconst {\n\t\tswitchEditorMode,\n\t\topenGeneralSidebar,\n\t\tcloseGeneralSidebar,\n\t\ttoggleFeature,\n\t\tsetIsListViewOpened,\n\t\tsetIsInserterOpened,\n\t} = useDispatch( editPostStore );\n\tconst { registerShortcut } = useDispatch( keyboardShortcutsStore );\n\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst toggleDistractionFree = () => {\n\t\tsetPreference( 'core/edit-post', 'fixedToolbar', false );\n\t\tsetIsInserterOpened( false );\n\t\tsetIsListViewOpened( false );\n\t\tcloseGeneralSidebar();\n\t};\n\n\tconst { replaceBlocks } = useDispatch( blockEditorStore );\n\tconst { getBlockName, getSelectedBlockClientId, getBlockAttributes } =\n\t\tuseSelect( blockEditorStore );\n\n\tconst handleTextLevelShortcut = ( event, level ) => {\n\t\tevent.preventDefault();\n\t\tconst destinationBlockName =\n\t\t\tlevel === 0 ? 'core/paragraph' : 'core/heading';\n\t\tconst currentClientId = getSelectedBlockClientId();\n\t\tif ( currentClientId === null ) {\n\t\t\treturn;\n\t\t}\n\t\tconst blockName = getBlockName( currentClientId );\n\t\tif ( blockName !== 'core/paragraph' && blockName !== 'core/heading' ) {\n\t\t\treturn;\n\t\t}\n\t\tconst attributes = getBlockAttributes( currentClientId );\n\t\tconst textAlign =\n\t\t\tblockName === 'core/paragraph' ? 'align' : 'textAlign';\n\t\tconst destinationTextAlign =\n\t\t\tdestinationBlockName === 'core/paragraph' ? 'align' : 'textAlign';\n\n\t\treplaceBlocks(\n\t\t\tcurrentClientId,\n\t\t\tcreateBlock( destinationBlockName, {\n\t\t\t\tlevel,\n\t\t\t\tcontent: attributes.content,\n\t\t\t\t...{ [ destinationTextAlign ]: attributes[ textAlign ] },\n\t\t\t} )\n\t\t);\n\t};\n\n\tuseEffect( () => {\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-post/toggle-mode',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Switch between visual editor and code editor.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'secondary',\n\t\t\t\tcharacter: 'm',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-post/toggle-distraction-free',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Toggle distraction free mode.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primaryShift',\n\t\t\t\tcharacter: '\\\\',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-post/toggle-fullscreen',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Toggle fullscreen mode.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'secondary',\n\t\t\t\tcharacter: 'f',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-post/toggle-list-view',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Open the block list view.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'access',\n\t\t\t\tcharacter: 'o',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-post/toggle-sidebar',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Show or hide the Settings sidebar.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primaryShift',\n\t\t\t\tcharacter: ',',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-post/next-region',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Navigate to the next part of the editor.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'ctrl',\n\t\t\t\tcharacter: '`',\n\t\t\t},\n\t\t\taliases: [\n\t\t\t\t{\n\t\t\t\t\tmodifier: 'access',\n\t\t\t\t\tcharacter: 'n',\n\t\t\t\t},\n\t\t\t],\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-post/previous-region',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Navigate to the previous part of the editor.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'ctrlShift',\n\t\t\t\tcharacter: '`',\n\t\t\t},\n\t\t\taliases: [\n\t\t\t\t{\n\t\t\t\t\tmodifier: 'access',\n\t\t\t\t\tcharacter: 'p',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tmodifier: 'ctrlShift',\n\t\t\t\t\tcharacter: '~',\n\t\t\t\t},\n\t\t\t],\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-post/keyboard-shortcuts',\n\t\t\tcategory: 'main',\n\t\t\tdescription: __( 'Display these keyboard shortcuts.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'access',\n\t\t\t\tcharacter: 'h',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-post/transform-heading-to-paragraph',\n\t\t\tcategory: 'block-library',\n\t\t\tdescription: __( 'Transform heading to paragraph.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'access',\n\t\t\t\tcharacter: `0`,\n\t\t\t},\n\t\t} );\n\n\t\t[ 1, 2, 3, 4, 5, 6 ].forEach( ( level ) => {\n\t\t\tregisterShortcut( {\n\t\t\t\tname: `core/edit-post/transform-paragraph-to-heading-${ level }`,\n\t\t\t\tcategory: 'block-library',\n\t\t\t\tdescription: __( 'Transform paragraph to heading.' ),\n\t\t\t\tkeyCombination: {\n\t\t\t\t\tmodifier: 'access',\n\t\t\t\t\tcharacter: `${ level }`,\n\t\t\t\t},\n\t\t\t} );\n\t\t} );\n\t}, [] );\n\n\tuseShortcut(\n\t\t'core/edit-post/toggle-mode',\n\t\t() => {\n\t\t\tswitchEditorMode(\n\t\t\t\tgetEditorMode() === 'visual' ? 'text' : 'visual'\n\t\t\t);\n\t\t},\n\t\t{\n\t\t\tisDisabled: isModeToggleDisabled,\n\t\t}\n\t);\n\n\tuseShortcut( 'core/edit-post/toggle-fullscreen', () => {\n\t\ttoggleFeature( 'fullscreenMode' );\n\t} );\n\n\tuseShortcut( 'core/edit-post/toggle-distraction-free', () => {\n\t\ttoggleDistractionFree();\n\t\ttoggleFeature( 'distractionFree' );\n\t\tcreateInfoNotice(\n\t\t\tisFeatureActive( 'distractionFree' )\n\t\t\t\t? __( 'Distraction free mode turned on.' )\n\t\t\t\t: __( 'Distraction free mode turned off.' ),\n\t\t\t{\n\t\t\t\tid: 'core/edit-post/distraction-free-mode/notice',\n\t\t\t\ttype: 'snackbar',\n\t\t\t}\n\t\t);\n\t} );\n\n\tuseShortcut( 'core/edit-post/toggle-sidebar', ( event ) => {\n\t\t// This shortcut has no known clashes, but use preventDefault to prevent any\n\t\t// obscure shortcuts from triggering.\n\t\tevent.preventDefault();\n\n\t\tif ( isEditorSidebarOpened() ) {\n\t\t\tcloseGeneralSidebar();\n\t\t} else {\n\t\t\tconst sidebarToOpen = getBlockSelectionStart()\n\t\t\t\t? 'edit-post/block'\n\t\t\t\t: 'edit-post/document';\n\t\t\topenGeneralSidebar( sidebarToOpen );\n\t\t}\n\t} );\n\n\t// Only opens the list view. Other functionality for this shortcut happens in the rendered sidebar.\n\tuseShortcut( 'core/edit-post/toggle-list-view', () => {\n\t\tif ( ! isListViewOpened() ) {\n\t\t\tsetIsListViewOpened( true );\n\t\t}\n\t} );\n\n\tuseShortcut( 'core/edit-post/transform-heading-to-paragraph', ( event ) =>\n\t\thandleTextLevelShortcut( event, 0 )\n\t);\n\n\t[ 1, 2, 3, 4, 5, 6 ].forEach( ( level ) => {\n\t\t//the loop is based off on a constant therefore\n\t\t//the hook will execute the same way every time\n\t\t//eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tuseShortcut(\n\t\t\t`core/edit-post/transform-paragraph-to-heading-${ level }`,\n\t\t\t( event ) => handleTextLevelShortcut( event, level )\n\t\t);\n\t} );\n\n\treturn null;\n}\n\nexport default KeyboardShortcuts;\n"]}
|
|
1
|
+
{"version":3,"names":["useEffect","useSelect","useDispatch","useShortcut","store","keyboardShortcutsStore","__","editorStore","blockEditorStore","noticesStore","preferencesStore","createBlock","editPostStore","KeyboardShortcuts","getBlockSelectionStart","getEditorMode","isEditorSidebarOpened","isListViewOpened","isFeatureActive","isModeToggleDisabled","select","richEditingEnabled","codeEditingEnabled","getEditorSettings","createInfoNotice","switchEditorMode","openGeneralSidebar","closeGeneralSidebar","toggleFeature","setIsListViewOpened","setIsInserterOpened","registerShortcut","set","setPreference","toggleDistractionFree","replaceBlocks","getBlockName","getSelectedBlockClientId","getBlockAttributes","handleTextLevelShortcut","event","level","preventDefault","destinationBlockName","currentClientId","blockName","attributes","textAlign","destinationTextAlign","content","name","category","description","keyCombination","modifier","character","aliases","forEach","isDisabled","id","type","sidebarToOpen"],"sources":["@wordpress/edit-post/src/components/keyboard-shortcuts/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { __ } from '@wordpress/i18n';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { createBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nfunction KeyboardShortcuts() {\n\tconst { getBlockSelectionStart } = useSelect( blockEditorStore );\n\tconst {\n\t\tgetEditorMode,\n\t\tisEditorSidebarOpened,\n\t\tisListViewOpened,\n\t\tisFeatureActive,\n\t} = useSelect( editPostStore );\n\tconst isModeToggleDisabled = useSelect( ( select ) => {\n\t\tconst { richEditingEnabled, codeEditingEnabled } =\n\t\t\tselect( editorStore ).getEditorSettings();\n\t\treturn ! richEditingEnabled || ! codeEditingEnabled;\n\t}, [] );\n\n\tconst { createInfoNotice } = useDispatch( noticesStore );\n\n\tconst {\n\t\tswitchEditorMode,\n\t\topenGeneralSidebar,\n\t\tcloseGeneralSidebar,\n\t\ttoggleFeature,\n\t\tsetIsListViewOpened,\n\t\tsetIsInserterOpened,\n\t} = useDispatch( editPostStore );\n\tconst { registerShortcut } = useDispatch( keyboardShortcutsStore );\n\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst toggleDistractionFree = () => {\n\t\tsetPreference( 'core/edit-post', 'fixedToolbar', false );\n\t\tsetIsInserterOpened( false );\n\t\tsetIsListViewOpened( false );\n\t\tcloseGeneralSidebar();\n\t};\n\n\tconst { replaceBlocks } = useDispatch( blockEditorStore );\n\tconst { getBlockName, getSelectedBlockClientId, getBlockAttributes } =\n\t\tuseSelect( blockEditorStore );\n\n\tconst handleTextLevelShortcut = ( event, level ) => {\n\t\tevent.preventDefault();\n\t\tconst destinationBlockName =\n\t\t\tlevel === 0 ? 'core/paragraph' : 'core/heading';\n\t\tconst currentClientId = getSelectedBlockClientId();\n\t\tif ( currentClientId === null ) {\n\t\t\treturn;\n\t\t}\n\t\tconst blockName = getBlockName( currentClientId );\n\t\tif ( blockName !== 'core/paragraph' && blockName !== 'core/heading' ) {\n\t\t\treturn;\n\t\t}\n\t\tconst attributes = getBlockAttributes( currentClientId );\n\t\tconst textAlign =\n\t\t\tblockName === 'core/paragraph' ? 'align' : 'textAlign';\n\t\tconst destinationTextAlign =\n\t\t\tdestinationBlockName === 'core/paragraph' ? 'align' : 'textAlign';\n\n\t\treplaceBlocks(\n\t\t\tcurrentClientId,\n\t\t\tcreateBlock( destinationBlockName, {\n\t\t\t\tlevel,\n\t\t\t\tcontent: attributes.content,\n\t\t\t\t...{ [ destinationTextAlign ]: attributes[ textAlign ] },\n\t\t\t} )\n\t\t);\n\t};\n\n\tuseEffect( () => {\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-post/toggle-mode',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Switch between visual editor and code editor.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'secondary',\n\t\t\t\tcharacter: 'm',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-post/toggle-distraction-free',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Toggle distraction free mode.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primaryShift',\n\t\t\t\tcharacter: '\\\\',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-post/toggle-fullscreen',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Toggle fullscreen mode.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'secondary',\n\t\t\t\tcharacter: 'f',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-post/toggle-list-view',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Open the block list view.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'access',\n\t\t\t\tcharacter: 'o',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-post/toggle-sidebar',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Show or hide the Settings sidebar.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primaryShift',\n\t\t\t\tcharacter: ',',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-post/next-region',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Navigate to the next part of the editor.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'ctrl',\n\t\t\t\tcharacter: '`',\n\t\t\t},\n\t\t\taliases: [\n\t\t\t\t{\n\t\t\t\t\tmodifier: 'access',\n\t\t\t\t\tcharacter: 'n',\n\t\t\t\t},\n\t\t\t],\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-post/previous-region',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Navigate to the previous part of the editor.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'ctrlShift',\n\t\t\t\tcharacter: '`',\n\t\t\t},\n\t\t\taliases: [\n\t\t\t\t{\n\t\t\t\t\tmodifier: 'access',\n\t\t\t\t\tcharacter: 'p',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tmodifier: 'ctrlShift',\n\t\t\t\t\tcharacter: '~',\n\t\t\t\t},\n\t\t\t],\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-post/keyboard-shortcuts',\n\t\t\tcategory: 'main',\n\t\t\tdescription: __( 'Display these keyboard shortcuts.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'access',\n\t\t\t\tcharacter: 'h',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-post/transform-heading-to-paragraph',\n\t\t\tcategory: 'block-library',\n\t\t\tdescription: __( 'Transform heading to paragraph.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'access',\n\t\t\t\tcharacter: `0`,\n\t\t\t},\n\t\t} );\n\n\t\t[ 1, 2, 3, 4, 5, 6 ].forEach( ( level ) => {\n\t\t\tregisterShortcut( {\n\t\t\t\tname: `core/edit-post/transform-paragraph-to-heading-${ level }`,\n\t\t\t\tcategory: 'block-library',\n\t\t\t\tdescription: __( 'Transform paragraph to heading.' ),\n\t\t\t\tkeyCombination: {\n\t\t\t\t\tmodifier: 'access',\n\t\t\t\t\tcharacter: `${ level }`,\n\t\t\t\t},\n\t\t\t} );\n\t\t} );\n\t}, [] );\n\n\tuseShortcut(\n\t\t'core/edit-post/toggle-mode',\n\t\t() => {\n\t\t\tswitchEditorMode(\n\t\t\t\tgetEditorMode() === 'visual' ? 'text' : 'visual'\n\t\t\t);\n\t\t},\n\t\t{\n\t\t\tisDisabled: isModeToggleDisabled,\n\t\t}\n\t);\n\n\tuseShortcut( 'core/edit-post/toggle-fullscreen', () => {\n\t\ttoggleFeature( 'fullscreenMode' );\n\t} );\n\n\tuseShortcut( 'core/edit-post/toggle-distraction-free', () => {\n\t\ttoggleDistractionFree();\n\t\ttoggleFeature( 'distractionFree' );\n\t\tcreateInfoNotice(\n\t\t\tisFeatureActive( 'distractionFree' )\n\t\t\t\t? __( 'Distraction free on.' )\n\t\t\t\t: __( 'Distraction free off.' ),\n\t\t\t{\n\t\t\t\tid: 'core/edit-post/distraction-free-mode/notice',\n\t\t\t\ttype: 'snackbar',\n\t\t\t}\n\t\t);\n\t} );\n\n\tuseShortcut( 'core/edit-post/toggle-sidebar', ( event ) => {\n\t\t// This shortcut has no known clashes, but use preventDefault to prevent any\n\t\t// obscure shortcuts from triggering.\n\t\tevent.preventDefault();\n\n\t\tif ( isEditorSidebarOpened() ) {\n\t\t\tcloseGeneralSidebar();\n\t\t} else {\n\t\t\tconst sidebarToOpen = getBlockSelectionStart()\n\t\t\t\t? 'edit-post/block'\n\t\t\t\t: 'edit-post/document';\n\t\t\topenGeneralSidebar( sidebarToOpen );\n\t\t}\n\t} );\n\n\t// Only opens the list view. Other functionality for this shortcut happens in the rendered sidebar.\n\tuseShortcut( 'core/edit-post/toggle-list-view', () => {\n\t\tif ( ! isListViewOpened() ) {\n\t\t\tsetIsListViewOpened( true );\n\t\t}\n\t} );\n\n\tuseShortcut( 'core/edit-post/transform-heading-to-paragraph', ( event ) =>\n\t\thandleTextLevelShortcut( event, 0 )\n\t);\n\n\t[ 1, 2, 3, 4, 5, 6 ].forEach( ( level ) => {\n\t\t//the loop is based off on a constant therefore\n\t\t//the hook will execute the same way every time\n\t\t//eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tuseShortcut(\n\t\t\t`core/edit-post/transform-paragraph-to-heading-${ level }`,\n\t\t\t( event ) => handleTextLevelShortcut( event, level )\n\t\t);\n\t} );\n\n\treturn null;\n}\n\nexport default KeyboardShortcuts;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SACCC,WAAW,EACXC,KAAK,IAAIC,sBAAsB,QACzB,+BAA+B;AACtC,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASF,KAAK,IAAIG,WAAW,QAAQ,mBAAmB;AACxD,SAASH,KAAK,IAAII,gBAAgB,QAAQ,yBAAyB;AACnE,SAASJ,KAAK,IAAIK,YAAY,QAAQ,oBAAoB;AAC1D,SAASL,KAAK,IAAIM,gBAAgB,QAAQ,wBAAwB;AAClE,SAASC,WAAW,QAAQ,mBAAmB;;AAE/C;AACA;AACA;AACA,SAASP,KAAK,IAAIQ,aAAa,QAAQ,aAAa;AAEpD,SAASC,iBAAiBA,CAAA,EAAG;EAC5B,MAAM;IAAEC;EAAuB,CAAC,GAAGb,SAAS,CAAEO,gBAAiB,CAAC;EAChE,MAAM;IACLO,aAAa;IACbC,qBAAqB;IACrBC,gBAAgB;IAChBC;EACD,CAAC,GAAGjB,SAAS,CAAEW,aAAc,CAAC;EAC9B,MAAMO,oBAAoB,GAAGlB,SAAS,CAAImB,MAAM,IAAM;IACrD,MAAM;MAAEC,kBAAkB;MAAEC;IAAmB,CAAC,GAC/CF,MAAM,CAAEb,WAAY,CAAC,CAACgB,iBAAiB,CAAC,CAAC;IAC1C,OAAO,CAAEF,kBAAkB,IAAI,CAAEC,kBAAkB;EACpD,CAAC,EAAE,EAAG,CAAC;EAEP,MAAM;IAAEE;EAAiB,CAAC,GAAGtB,WAAW,CAAEO,YAAa,C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B,oBAAoB;MACvBY,kBAAkB,CAAEmC,aAAc,CAAC;IACpC;EACD,CAAE,CAAC;;EAEH;EACA1D,WAAW,CAAE,iCAAiC,EAAE,MAAM;IACrD,IAAK,CAAEc,gBAAgB,CAAC,CAAC,EAAG;MAC3BY,mBAAmB,CAAE,IAAK,CAAC;IAC5B;EACD,CAAE,CAAC;EAEH1B,WAAW,CAAE,+CAA+C,EAAIqC,KAAK,IACpED,uBAAuB,CAAEC,KAAK,EAAE,CAAE,CACnC,CAAC;EAED,CAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAE,CAACiB,OAAO,CAAIhB,KAAK,IAAM;IAC1C;IACA;IACA;IACAtC,WAAW,CACT,iDAAiDsC,KAAO,EAAC,EACxDD,KAAK,IAAMD,uBAAuB,CAAEC,KAAK,EAAEC,KAAM,CACpD,CAAC;EACF,CAAE,CAAC;EAEH,OAAO,IAAI;AACZ;AAEA,eAAe5B,iBAAiB"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { createElement, Fragment } from "@wordpress/element";
|
|
2
|
-
|
|
3
2
|
/**
|
|
4
3
|
* WordPress dependencies
|
|
5
4
|
*/
|
|
@@ -11,7 +10,6 @@ import { useCallback } from '@wordpress/element';
|
|
|
11
10
|
/**
|
|
12
11
|
* Internal dependencies
|
|
13
12
|
*/
|
|
14
|
-
|
|
15
13
|
import PluginPostPublishPanel from '../sidebar/plugin-post-publish-panel';
|
|
16
14
|
import PluginPrePublishPanel from '../sidebar/plugin-pre-publish-panel';
|
|
17
15
|
import { store as editPostStore } from '../../store';
|
|
@@ -38,11 +36,11 @@ export default function ActionsPanel({
|
|
|
38
36
|
hasActiveMetaboxes: select(editPostStore).hasMetaBoxes(),
|
|
39
37
|
hasNonPostEntityChanges: select(editorStore).hasNonPostEntityChanges()
|
|
40
38
|
}), []);
|
|
41
|
-
const openEntitiesSavedStates = useCallback(() => setEntitiesSavedStatesCallback(true), []);
|
|
42
|
-
// We don't want more than one present at a time, decide which to render.
|
|
39
|
+
const openEntitiesSavedStates = useCallback(() => setEntitiesSavedStatesCallback(true), []);
|
|
43
40
|
|
|
41
|
+
// It is ok for these components to be unmounted when not in visual use.
|
|
42
|
+
// We don't want more than one present at a time, decide which to render.
|
|
44
43
|
let unmountableContent;
|
|
45
|
-
|
|
46
44
|
if (publishSidebarOpened) {
|
|
47
45
|
unmountableContent = createElement(PostPublishPanel, {
|
|
48
46
|
onClose: closePublishSidebar,
|
|
@@ -68,10 +66,10 @@ export default function ActionsPanel({
|
|
|
68
66
|
onClick: togglePublishSidebar,
|
|
69
67
|
"aria-expanded": false
|
|
70
68
|
}, __('Open publish panel')));
|
|
71
|
-
}
|
|
72
|
-
// always mounted to retain its own component state (such as checkboxes).
|
|
73
|
-
|
|
69
|
+
}
|
|
74
70
|
|
|
71
|
+
// Since EntitiesSavedStates controls its own panel, we can keep it
|
|
72
|
+
// always mounted to retain its own component state (such as checkboxes).
|
|
75
73
|
return createElement(Fragment, null, isEntitiesSavedStatesOpen && createElement(EntitiesSavedStates, {
|
|
76
74
|
close: closeEntitiesSavedStates
|
|
77
75
|
}), createElement(Slot, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["EntitiesSavedStates","PostPublishPanel","store","editorStore","useSelect","useDispatch","Button","createSlotFill","__","useCallback","PluginPostPublishPanel","PluginPrePublishPanel","editPostStore","Fill","Slot","ActionsPanelFill","ActionsPanel","setEntitiesSavedStatesCallback","closeEntitiesSavedStates","isEntitiesSavedStatesOpen","closePublishSidebar","togglePublishSidebar","publishSidebarOpened","hasActiveMetaboxes","hasNonPostEntityChanges","select","isPublishSidebarOpened","hasMetaBoxes","openEntitiesSavedStates","unmountableContent","createElement","onClose","forceIsDirty","PrePublishExtension","PostPublishExtension","className","variant","onClick","Fragment","close","bubblesVirtually"],"sources":["@wordpress/edit-post/src/components/layout/actions-panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tEntitiesSavedStates,\n\tPostPublishPanel,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Button, createSlotFill } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useCallback } from '@wordpress/element';\n/**\n * Internal dependencies\n */\nimport PluginPostPublishPanel from '../sidebar/plugin-post-publish-panel';\nimport PluginPrePublishPanel from '../sidebar/plugin-pre-publish-panel';\nimport { store as editPostStore } from '../../store';\n\nconst { Fill, Slot } = createSlotFill( 'ActionsPanel' );\n\nexport const ActionsPanelFill = Fill;\n\nexport default function ActionsPanel( {\n\tsetEntitiesSavedStatesCallback,\n\tcloseEntitiesSavedStates,\n\tisEntitiesSavedStatesOpen,\n} ) {\n\tconst { closePublishSidebar, togglePublishSidebar } =\n\t\tuseDispatch( editPostStore );\n\tconst {\n\t\tpublishSidebarOpened,\n\t\thasActiveMetaboxes,\n\t\thasNonPostEntityChanges,\n\t} = useSelect(\n\t\t( select ) => ( {\n\t\t\tpublishSidebarOpened:\n\t\t\t\tselect( editPostStore ).isPublishSidebarOpened(),\n\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\thasNonPostEntityChanges:\n\t\t\t\tselect( editorStore ).hasNonPostEntityChanges(),\n\t\t} ),\n\t\t[]\n\t);\n\n\tconst openEntitiesSavedStates = useCallback(\n\t\t() => setEntitiesSavedStatesCallback( true ),\n\t\t[]\n\t);\n\n\t// It is ok for these components to be unmounted when not in visual use.\n\t// We don't want more than one present at a time, decide which to render.\n\tlet unmountableContent;\n\tif ( publishSidebarOpened ) {\n\t\tunmountableContent = (\n\t\t\t<PostPublishPanel\n\t\t\t\tonClose={ closePublishSidebar }\n\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\tPrePublishExtension={ PluginPrePublishPanel.Slot }\n\t\t\t\tPostPublishExtension={ PluginPostPublishPanel.Slot }\n\t\t\t/>\n\t\t);\n\t} else if ( hasNonPostEntityChanges ) {\n\t\tunmountableContent = (\n\t\t\t<div className=\"edit-post-layout__toggle-entities-saved-states-panel\">\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tclassName=\"edit-post-layout__toggle-entities-saved-states-panel-button\"\n\t\t\t\t\tonClick={ openEntitiesSavedStates }\n\t\t\t\t\taria-expanded={ false }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Open save panel' ) }\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t);\n\t} else {\n\t\tunmountableContent = (\n\t\t\t<div className=\"edit-post-layout__toggle-publish-panel\">\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tclassName=\"edit-post-layout__toggle-publish-panel-button\"\n\t\t\t\t\tonClick={ togglePublishSidebar }\n\t\t\t\t\taria-expanded={ false }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Open publish panel' ) }\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t);\n\t}\n\n\t// Since EntitiesSavedStates controls its own panel, we can keep it\n\t// always mounted to retain its own component state (such as checkboxes).\n\treturn (\n\t\t<>\n\t\t\t{ isEntitiesSavedStatesOpen && (\n\t\t\t\t<EntitiesSavedStates close={ closeEntitiesSavedStates } />\n\t\t\t) }\n\t\t\t<Slot bubblesVirtually />\n\t\t\t{ ! isEntitiesSavedStatesOpen && unmountableContent }\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,mBAAmB,EACnBC,gBAAgB,EAChBC,KAAK,IAAIC,WAAW,QACd,mBAAmB;AAC1B,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,MAAM,EAAEC,cAAc,QAAQ,uBAAuB;AAC9D,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,QAAQ,oBAAoB;AAChD;AACA;AACA;AACA,OAAOC,sBAAsB,MAAM,sCAAsC;AACzE,OAAOC,qBA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