@wordpress/edit-post 7.31.0 → 7.33.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 +4 -0
- package/README.md +9 -323
- package/build/components/browser-url/index.js.map +1 -1
- package/build/components/editor-initialization/index.js +0 -1
- package/build/components/editor-initialization/index.js.map +1 -1
- package/build/components/editor-initialization/listener-hooks.js +1 -38
- package/build/components/editor-initialization/listener-hooks.js.map +1 -1
- package/build/components/header/fullscreen-mode-close/index.js.map +1 -1
- package/build/components/header/header-toolbar/index.native.js.map +1 -1
- package/build/components/header/index.js +5 -5
- package/build/components/header/index.js.map +1 -1
- package/build/components/header/index.native.js +1 -1
- package/build/components/header/index.native.js.map +1 -1
- package/build/components/header/main-dashboard-button/index.js.map +1 -1
- package/build/components/header/more-menu/index.js +7 -6
- package/build/components/header/more-menu/index.js.map +1 -1
- package/build/components/header/post-publish-button-or-toggle.js +11 -13
- package/build/components/header/post-publish-button-or-toggle.js.map +1 -1
- package/build/components/header/preferences-menu-item/index.js +12 -4
- package/build/components/header/preferences-menu-item/index.js.map +1 -1
- package/build/components/header/tools-more-menu-group/index.js.map +1 -1
- package/build/components/header/writing-menu/index.js.map +1 -1
- package/build/components/init-pattern-modal/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/index.js +1 -36
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/layout/actions-panel.js +4 -7
- package/build/components/layout/actions-panel.js.map +1 -1
- package/build/components/layout/index.js +16 -21
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/index.native.js.map +1 -1
- package/build/components/meta-boxes/index.js.map +1 -1
- package/build/components/meta-boxes/meta-box-visibility.js.map +1 -1
- package/build/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
- package/build/components/preferences-modal/enable-custom-fields.js.map +1 -1
- package/build/components/preferences-modal/enable-panel.js.map +1 -1
- package/build/components/preferences-modal/enable-publish-sidebar.js.map +1 -1
- package/build/components/preferences-modal/index.js +1 -21
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/preferences-modal/meta-boxes-section.js.map +1 -1
- package/build/components/sidebar/plugin-post-publish-panel/index.js +16 -64
- package/build/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
- package/build/components/sidebar/plugin-pre-publish-panel/index.js +16 -63
- package/build/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
- package/build/components/sidebar/post-format/index.js.map +1 -1
- package/build/components/sidebar/post-pending-status/index.js.map +1 -1
- package/build/components/sidebar/post-slug/index.js.map +1 -1
- package/build/components/sidebar/post-status/index.js +9 -9
- package/build/components/sidebar/post-status/index.js.map +1 -1
- package/build/components/sidebar/post-sticky/index.js.map +1 -1
- package/build/components/sidebar/post-trash/index.js.map +1 -1
- package/build/components/sidebar/post-visibility/index.js.map +1 -1
- package/build/components/sidebar/settings-header/index.js.map +1 -1
- package/build/components/sidebar/settings-sidebar/index.js +42 -40
- package/build/components/sidebar/settings-sidebar/index.js.map +1 -1
- package/build/components/text-editor/index.js.map +1 -1
- package/build/components/visual-editor/block-inspector-button.js +1 -1
- package/build/components/visual-editor/block-inspector-button.js.map +1 -1
- package/build/components/visual-editor/header.native.js.map +1 -1
- package/build/components/visual-editor/index.js +4 -1
- package/build/components/visual-editor/index.js.map +1 -1
- package/build/components/visual-editor/index.native.js.map +1 -1
- package/build/components/visual-editor/use-padding-appender.js +62 -0
- package/build/components/visual-editor/use-padding-appender.js.map +1 -0
- package/build/components/welcome-guide/default.js.map +1 -1
- package/build/components/welcome-guide/image.js.map +1 -1
- package/build/components/welcome-guide/index.js.map +1 -1
- package/build/components/welcome-guide/template.js.map +1 -1
- package/build/editor.js +9 -4
- package/build/editor.js.map +1 -1
- package/build/editor.native.js.map +1 -1
- package/build/hooks/commands/use-common-commands.js +7 -24
- package/build/hooks/commands/use-common-commands.js.map +1 -1
- package/build/hooks/components/index.js.map +1 -1
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/use-navigate-to-entity-record.js +36 -19
- package/build/hooks/use-navigate-to-entity-record.js.map +1 -1
- package/build/hooks/validate-multiple-use/index.js.map +1 -1
- package/build/index.js +7 -12
- package/build/index.js.map +1 -1
- package/build/index.native.js +2 -4
- package/build/index.native.js.map +1 -1
- package/build/lock-unlock.js.map +1 -1
- package/build/plugins/copy-content-menu-item/index.js.map +1 -1
- package/build/plugins/index.js.map +1 -1
- package/build/plugins/keyboard-shortcuts-help-menu-item/index.js +7 -4
- package/build/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
- package/build/plugins/welcome-guide-menu-item/index.js.map +1 -1
- package/build/store/actions.js +46 -31
- package/build/store/actions.js.map +1 -1
- package/build/store/constants.js.map +1 -1
- package/build/store/index.js +1 -1
- package/build/store/index.js.map +1 -1
- package/build/store/reducer.js +1 -15
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +44 -24
- package/build/store/selectors.js.map +1 -1
- package/build/utils/meta-boxes.js.map +1 -1
- package/build-module/components/browser-url/index.js.map +1 -1
- package/build-module/components/editor-initialization/index.js +1 -2
- package/build-module/components/editor-initialization/index.js.map +1 -1
- package/build-module/components/editor-initialization/listener-hooks.js +2 -38
- package/build-module/components/editor-initialization/listener-hooks.js.map +1 -1
- package/build-module/components/header/fullscreen-mode-close/index.js.map +1 -1
- package/build-module/components/header/header-toolbar/index.native.js.map +1 -1
- package/build-module/components/header/index.js +4 -4
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/header/index.native.js +1 -1
- package/build-module/components/header/index.native.js.map +1 -1
- package/build-module/components/header/main-dashboard-button/index.js.map +1 -1
- package/build-module/components/header/more-menu/index.js +5 -4
- package/build-module/components/header/more-menu/index.js.map +1 -1
- package/build-module/components/header/post-publish-button-or-toggle.js +11 -13
- package/build-module/components/header/post-publish-button-or-toggle.js.map +1 -1
- package/build-module/components/header/preferences-menu-item/index.js +11 -3
- package/build-module/components/header/preferences-menu-item/index.js.map +1 -1
- package/build-module/components/header/tools-more-menu-group/index.js.map +1 -1
- package/build-module/components/header/writing-menu/index.js.map +1 -1
- package/build-module/components/init-pattern-modal/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/index.js +1 -36
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/layout/actions-panel.js +4 -5
- package/build-module/components/layout/actions-panel.js.map +1 -1
- package/build-module/components/layout/index.js +15 -20
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/layout/index.native.js.map +1 -1
- package/build-module/components/meta-boxes/index.js.map +1 -1
- package/build-module/components/meta-boxes/meta-box-visibility.js.map +1 -1
- package/build-module/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
- package/build-module/components/preferences-modal/enable-custom-fields.js.map +1 -1
- package/build-module/components/preferences-modal/enable-panel.js.map +1 -1
- package/build-module/components/preferences-modal/enable-publish-sidebar.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +1 -20
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/preferences-modal/meta-boxes-section.js.map +1 -1
- package/build-module/components/sidebar/plugin-post-publish-panel/index.js +14 -62
- package/build-module/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
- package/build-module/components/sidebar/plugin-pre-publish-panel/index.js +14 -61
- package/build-module/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
- package/build-module/components/sidebar/post-format/index.js.map +1 -1
- package/build-module/components/sidebar/post-pending-status/index.js.map +1 -1
- package/build-module/components/sidebar/post-slug/index.js.map +1 -1
- package/build-module/components/sidebar/post-status/index.js +9 -10
- package/build-module/components/sidebar/post-status/index.js.map +1 -1
- package/build-module/components/sidebar/post-sticky/index.js.map +1 -1
- package/build-module/components/sidebar/post-trash/index.js.map +1 -1
- package/build-module/components/sidebar/post-visibility/index.js.map +1 -1
- package/build-module/components/sidebar/settings-header/index.js.map +1 -1
- package/build-module/components/sidebar/settings-sidebar/index.js +43 -41
- package/build-module/components/sidebar/settings-sidebar/index.js.map +1 -1
- package/build-module/components/text-editor/index.js.map +1 -1
- package/build-module/components/visual-editor/block-inspector-button.js +1 -1
- package/build-module/components/visual-editor/block-inspector-button.js.map +1 -1
- package/build-module/components/visual-editor/header.native.js.map +1 -1
- package/build-module/components/visual-editor/index.js +4 -1
- package/build-module/components/visual-editor/index.js.map +1 -1
- package/build-module/components/visual-editor/index.native.js.map +1 -1
- package/build-module/components/visual-editor/use-padding-appender.js +55 -0
- package/build-module/components/visual-editor/use-padding-appender.js.map +1 -0
- 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.map +1 -1
- package/build-module/components/welcome-guide/template.js.map +1 -1
- package/build-module/editor.js +9 -4
- package/build-module/editor.js.map +1 -1
- package/build-module/editor.native.js.map +1 -1
- package/build-module/hooks/commands/use-common-commands.js +9 -26
- package/build-module/hooks/commands/use-common-commands.js.map +1 -1
- package/build-module/hooks/components/index.js.map +1 -1
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/use-navigate-to-entity-record.js +37 -20
- package/build-module/hooks/use-navigate-to-entity-record.js.map +1 -1
- package/build-module/hooks/validate-multiple-use/index.js.map +1 -1
- package/build-module/index.js +8 -8
- package/build-module/index.js.map +1 -1
- package/build-module/index.native.js +2 -4
- 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.map +1 -1
- package/build-module/plugins/index.js.map +1 -1
- package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js +6 -3
- package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
- package/build-module/plugins/welcome-guide-menu-item/index.js.map +1 -1
- package/build-module/store/actions.js +38 -22
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/constants.js.map +1 -1
- package/build-module/store/index.js.map +1 -1
- package/build-module/store/reducer.js +1 -13
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +42 -21
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/meta-boxes.js.map +1 -1
- package/build-style/classic-rtl.css +2 -2
- package/build-style/classic.css +2 -2
- package/build-style/style-rtl.css +12 -454
- package/build-style/style.css +12 -454
- package/package.json +32 -34
- package/src/classic.scss +2 -1
- package/src/components/editor-initialization/index.js +1 -5
- package/src/components/editor-initialization/listener-hooks.js +1 -40
- package/src/components/editor-initialization/test/listener-hooks.js +1 -96
- package/src/components/header/index.js +3 -4
- package/src/components/header/index.native.js +1 -1
- package/src/components/header/more-menu/index.js +3 -4
- package/src/components/header/post-publish-button-or-toggle.js +10 -11
- package/src/components/header/preferences-menu-item/index.js +9 -3
- package/src/components/header/style.scss +5 -3
- package/src/components/header/test/index.js +13 -1
- package/src/components/keyboard-shortcuts/index.js +3 -44
- package/src/components/layout/actions-panel.js +5 -4
- package/src/components/layout/index.js +20 -42
- package/src/components/meta-boxes/meta-boxes-area/style.scss +1 -1
- package/src/components/preferences-modal/index.js +1 -24
- package/src/components/sidebar/plugin-post-publish-panel/index.js +12 -67
- package/src/components/sidebar/plugin-pre-publish-panel/index.js +12 -66
- package/src/components/sidebar/post-status/index.js +6 -9
- package/src/components/sidebar/settings-sidebar/index.js +64 -56
- package/src/components/visual-editor/block-inspector-button.js +1 -1
- package/src/components/visual-editor/index.js +4 -0
- package/src/components/visual-editor/use-padding-appender.js +66 -0
- package/src/editor.js +14 -4
- package/src/hooks/commands/use-common-commands.js +13 -28
- package/src/hooks/use-navigate-to-entity-record.js +37 -24
- package/src/index.js +11 -6
- package/src/index.native.js +1 -4
- package/src/plugins/keyboard-shortcuts-help-menu-item/index.js +5 -3
- package/src/store/actions.js +37 -24
- package/src/store/reducer.js +0 -13
- package/src/store/selectors.js +52 -36
- package/src/store/test/actions.js +11 -10
- package/src/style.scss +1 -20
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +0 -107
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +0 -1
- package/build/components/header/plugin-more-menu-item/index.js +0 -78
- package/build/components/header/plugin-more-menu-item/index.js.map +0 -1
- package/build/components/header/plugin-sidebar-more-menu-item/index.js +0 -71
- package/build/components/header/plugin-sidebar-more-menu-item/index.js.map +0 -1
- package/build/components/keyboard-shortcut-help-modal/config.js +0 -78
- package/build/components/keyboard-shortcut-help-modal/config.js.map +0 -1
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -49
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +0 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +0 -129
- package/build/components/keyboard-shortcut-help-modal/index.js.map +0 -1
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +0 -55
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +0 -1
- package/build/components/sidebar/plugin-post-status-info/index.js +0 -73
- package/build/components/sidebar/plugin-post-status-info/index.js.map +0 -1
- package/build/components/sidebar/plugin-sidebar/index.js +0 -104
- package/build/components/sidebar/plugin-sidebar/index.js.map +0 -1
- package/build/components/sidebar/template-summary/index.js +0 -36
- package/build/components/sidebar/template-summary/index.js.map +0 -1
- package/build/components/start-page-options/index.js +0 -107
- package/build/components/start-page-options/index.js.map +0 -1
- package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +0 -100
- package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +0 -1
- package/build-module/components/header/plugin-more-menu-item/index.js +0 -73
- package/build-module/components/header/plugin-more-menu-item/index.js.map +0 -1
- package/build-module/components/header/plugin-sidebar-more-menu-item/index.js +0 -65
- package/build-module/components/header/plugin-sidebar-more-menu-item/index.js.map +0 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js +0 -71
- package/build-module/components/keyboard-shortcut-help-modal/config.js.map +0 -1
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -41
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +0 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +0 -119
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +0 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +0 -48
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +0 -1
- package/build-module/components/sidebar/plugin-post-status-info/index.js +0 -66
- package/build-module/components/sidebar/plugin-post-status-info/index.js.map +0 -1
- package/build-module/components/sidebar/plugin-sidebar/index.js +0 -98
- package/build-module/components/sidebar/plugin-sidebar/index.js.map +0 -1
- package/build-module/components/sidebar/template-summary/index.js +0 -29
- package/build-module/components/sidebar/template-summary/index.js.map +0 -1
- package/build-module/components/start-page-options/index.js +0 -100
- package/build-module/components/start-page-options/index.js.map +0 -1
- package/src/components/block-settings-menu/plugin-block-settings-menu-item.js +0 -108
- package/src/components/header/plugin-more-menu-item/index.js +0 -73
- package/src/components/header/plugin-sidebar-more-menu-item/index.js +0 -64
- package/src/components/keyboard-shortcut-help-modal/config.js +0 -53
- package/src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -43
- package/src/components/keyboard-shortcut-help-modal/index.js +0 -159
- package/src/components/keyboard-shortcut-help-modal/shortcut.js +0 -67
- package/src/components/keyboard-shortcut-help-modal/style.scss +0 -61
- package/src/components/keyboard-shortcut-help-modal/test/index.js +0 -36
- package/src/components/sidebar/plugin-post-publish-panel/test/__snapshots__/index.js.snap +0 -39
- package/src/components/sidebar/plugin-post-publish-panel/test/index.js +0 -33
- package/src/components/sidebar/plugin-post-status-info/index.js +0 -63
- package/src/components/sidebar/plugin-post-status-info/test/__snapshots__/index.js.snap +0 -11
- package/src/components/sidebar/plugin-post-status-info/test/index.js +0 -29
- package/src/components/sidebar/plugin-pre-publish-panel/test/index.js +0 -33
- package/src/components/sidebar/plugin-sidebar/index.js +0 -94
- package/src/components/sidebar/template-summary/index.js +0 -37
- package/src/components/sidebar/template-summary/style.scss +0 -5
- package/src/components/start-page-options/index.js +0 -108
- package/src/components/start-page-options/style.scss +0 -26
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","MenuGroup","DropdownMenu","
|
|
1
|
+
{"version":3,"names":["__","MenuGroup","DropdownMenu","useViewportMatch","privateApis","editorPrivateApis","moreVertical","PreferencesMenuItem","ToolsMoreMenuGroup","WritingMenu","unlock","ModeSwitcher","ActionItem","PinnedItems","MoreMenu","showIconLabels","isLargeViewport","createElement","icon","label","popoverProps","placement","className","toggleProps","variant","tooltipPosition","showTooltip","size","onClose","Fragment","Slot","scope","name","as","fillProps","onClick"],"sources":["@wordpress/edit-post/src/components/header/more-menu/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { MenuGroup, DropdownMenu } from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { moreVertical } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport PreferencesMenuItem from '../preferences-menu-item';\nimport ToolsMoreMenuGroup from '../tools-more-menu-group';\nimport WritingMenu from '../writing-menu';\nimport { unlock } from '../../../lock-unlock';\n\nconst { ModeSwitcher, ActionItem, PinnedItems } = unlock( editorPrivateApis );\n\nconst MoreMenu = ( { showIconLabels } ) => {\n\tconst isLargeViewport = useViewportMatch( 'large' );\n\n\treturn (\n\t\t<DropdownMenu\n\t\t\ticon={ moreVertical }\n\t\t\tlabel={ __( 'Options' ) }\n\t\t\tpopoverProps={ {\n\t\t\t\tplacement: 'bottom-end',\n\t\t\t\tclassName: 'more-menu-dropdown__content',\n\t\t\t} }\n\t\t\ttoggleProps={ {\n\t\t\t\t...( showIconLabels && { variant: 'tertiary' } ),\n\t\t\t\ttooltipPosition: 'bottom',\n\t\t\t\tshowTooltip: ! showIconLabels,\n\t\t\t\tsize: 'compact',\n\t\t\t} }\n\t\t>\n\t\t\t{ ( { onClose } ) => (\n\t\t\t\t<>\n\t\t\t\t\t{ showIconLabels && ! isLargeViewport && (\n\t\t\t\t\t\t<PinnedItems.Slot\n\t\t\t\t\t\t\tclassName={ showIconLabels && 'show-icon-labels' }\n\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t<WritingMenu />\n\t\t\t\t\t<ModeSwitcher />\n\t\t\t\t\t<ActionItem.Slot\n\t\t\t\t\t\tname=\"core/plugin-more-menu\"\n\t\t\t\t\t\tlabel={ __( 'Plugins' ) }\n\t\t\t\t\t\tas={ MenuGroup }\n\t\t\t\t\t\tfillProps={ { onClick: onClose } }\n\t\t\t\t\t/>\n\t\t\t\t\t<ToolsMoreMenuGroup.Slot fillProps={ { onClose } } />\n\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t<PreferencesMenuItem />\n\t\t\t\t\t</MenuGroup>\n\t\t\t\t</>\n\t\t\t) }\n\t\t</DropdownMenu>\n\t);\n};\n\nexport default MoreMenu;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,EAAEC,YAAY,QAAQ,uBAAuB;AAC/D,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;AACpE,SAASC,YAAY,QAAQ,kBAAkB;;AAE/C;AACA;AACA;AACA,OAAOC,mBAAmB,MAAM,0BAA0B;AAC1D,OAAOC,kBAAkB,MAAM,0BAA0B;AACzD,OAAOC,WAAW,MAAM,iBAAiB;AACzC,SAASC,MAAM,QAAQ,sBAAsB;AAE7C,MAAM;EAAEC,YAAY;EAAEC,UAAU;EAAEC;AAAY,CAAC,GAAGH,MAAM,CAAEL,iBAAkB,CAAC;AAE7E,MAAMS,QAAQ,GAAGA,CAAE;EAAEC;AAAe,CAAC,KAAM;EAC1C,MAAMC,eAAe,GAAGb,gBAAgB,CAAE,OAAQ,CAAC;EAEnD,OACCc,aAAA,CAACf,YAAY;IACZgB,IAAI,EAAGZ,YAAc;IACrBa,KAAK,EAAGnB,EAAE,CAAE,SAAU,CAAG;IACzBoB,YAAY,EAAG;MACdC,SAAS,EAAE,YAAY;MACvBC,SAAS,EAAE;IACZ,CAAG;IACHC,WAAW,EAAG;MACb,IAAKR,cAAc,IAAI;QAAES,OAAO,EAAE;MAAW,CAAC,CAAE;MAChDC,eAAe,EAAE,QAAQ;MACzBC,WAAW,EAAE,CAAEX,cAAc;MAC7BY,IAAI,EAAE;IACP;EAAG,GAED,CAAE;IAAEC;EAAQ,CAAC,KACdX,aAAA,CAAAY,QAAA,QACGd,cAAc,IAAI,CAAEC,eAAe,IACpCC,aAAA,CAACJ,WAAW,CAACiB,IAAI;IAChBR,SAAS,EAAGP,cAAc,IAAI,kBAAoB;IAClDgB,KAAK,EAAC;EAAM,CACZ,CACD,EACDd,aAAA,CAACR,WAAW,MAAE,CAAC,EACfQ,aAAA,CAACN,YAAY,MAAE,CAAC,EAChBM,aAAA,CAACL,UAAU,CAACkB,IAAI;IACfE,IAAI,EAAC,uBAAuB;IAC5Bb,KAAK,EAAGnB,EAAE,CAAE,SAAU,CAAG;IACzBiC,EAAE,EAAGhC,SAAW;IAChBiC,SAAS,EAAG;MAAEC,OAAO,EAAEP;IAAQ;EAAG,CAClC,CAAC,EACFX,aAAA,CAACT,kBAAkB,CAACsB,IAAI;IAACI,SAAS,EAAG;MAAEN;IAAQ;EAAG,CAAE,CAAC,EACrDX,aAAA,CAAChB,SAAS,QACTgB,aAAA,CAACV,mBAAmB,MAAE,CACZ,CACV,CAEU,CAAC;AAEjB,CAAC;AAED,eAAeO,QAAQ","ignoreList":[]}
|
|
@@ -5,11 +5,6 @@ import { createElement } from "react";
|
|
|
5
5
|
import { useViewportMatch, compose } from '@wordpress/compose';
|
|
6
6
|
import { withDispatch, withSelect } from '@wordpress/data';
|
|
7
7
|
import { PostPublishButton, store as editorStore } from '@wordpress/editor';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Internal dependencies
|
|
11
|
-
*/
|
|
12
|
-
import { store as editPostStore } from '../../store';
|
|
13
8
|
export function PostPublishButtonOrToggle({
|
|
14
9
|
forceIsDirty,
|
|
15
10
|
hasPublishAction,
|
|
@@ -20,7 +15,9 @@ export function PostPublishButtonOrToggle({
|
|
|
20
15
|
isPublishSidebarOpened,
|
|
21
16
|
isScheduled,
|
|
22
17
|
togglePublishSidebar,
|
|
23
|
-
setEntitiesSavedStatesCallback
|
|
18
|
+
setEntitiesSavedStatesCallback,
|
|
19
|
+
postStatusHasChanged,
|
|
20
|
+
postStatus
|
|
24
21
|
}) {
|
|
25
22
|
const IS_TOGGLE = 'toggle';
|
|
26
23
|
const IS_BUTTON = 'button';
|
|
@@ -34,6 +31,7 @@ export function PostPublishButtonOrToggle({
|
|
|
34
31
|
* for a particular role (see https://wordpress.org/documentation/article/post-status/):
|
|
35
32
|
*
|
|
36
33
|
* - is published
|
|
34
|
+
* - post status has changed explicitely to something different than 'future' or 'publish'
|
|
37
35
|
* - is scheduled to be published
|
|
38
36
|
* - is pending and can't be published (but only for viewports >= medium).
|
|
39
37
|
* Originally, we considered showing a button for pending posts that couldn't be published
|
|
@@ -49,11 +47,9 @@ export function PostPublishButtonOrToggle({
|
|
|
49
47
|
* - if it is enabled, we show a TOGGLE
|
|
50
48
|
* - if it is disabled, we show a BUTTON
|
|
51
49
|
*/
|
|
52
|
-
if (isPublished || isScheduled && isBeingScheduled || isPending && !hasPublishAction && !isSmallerThanMediumViewport) {
|
|
50
|
+
if (isPublished || postStatusHasChanged && !['future', 'publish'].includes(postStatus) || isScheduled && isBeingScheduled || isPending && !hasPublishAction && !isSmallerThanMediumViewport) {
|
|
53
51
|
component = IS_BUTTON;
|
|
54
|
-
} else if (isSmallerThanMediumViewport) {
|
|
55
|
-
component = IS_TOGGLE;
|
|
56
|
-
} else if (isPublishSidebarEnabled) {
|
|
52
|
+
} else if (isSmallerThanMediumViewport || isPublishSidebarEnabled) {
|
|
57
53
|
component = IS_TOGGLE;
|
|
58
54
|
} else {
|
|
59
55
|
component = IS_BUTTON;
|
|
@@ -74,13 +70,15 @@ export default compose(withSelect(select => {
|
|
|
74
70
|
isPending: select(editorStore).isCurrentPostPending(),
|
|
75
71
|
isPublished: select(editorStore).isCurrentPostPublished(),
|
|
76
72
|
isPublishSidebarEnabled: select(editorStore).isPublishSidebarEnabled(),
|
|
77
|
-
isPublishSidebarOpened: select(
|
|
78
|
-
isScheduled: select(editorStore).isCurrentPostScheduled()
|
|
73
|
+
isPublishSidebarOpened: select(editorStore).isPublishSidebarOpened(),
|
|
74
|
+
isScheduled: select(editorStore).isCurrentPostScheduled(),
|
|
75
|
+
postStatus: select(editorStore).getEditedPostAttribute('status'),
|
|
76
|
+
postStatusHasChanged: select(editorStore).getPostEdits()?.status
|
|
79
77
|
};
|
|
80
78
|
}), withDispatch(dispatch => {
|
|
81
79
|
const {
|
|
82
80
|
togglePublishSidebar
|
|
83
|
-
} = dispatch(
|
|
81
|
+
} = dispatch(editorStore);
|
|
84
82
|
return {
|
|
85
83
|
togglePublishSidebar
|
|
86
84
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useViewportMatch","compose","withDispatch","withSelect","PostPublishButton","store","editorStore","
|
|
1
|
+
{"version":3,"names":["useViewportMatch","compose","withDispatch","withSelect","PostPublishButton","store","editorStore","PostPublishButtonOrToggle","forceIsDirty","hasPublishAction","isBeingScheduled","isPending","isPublished","isPublishSidebarEnabled","isPublishSidebarOpened","isScheduled","togglePublishSidebar","setEntitiesSavedStatesCallback","postStatusHasChanged","postStatus","IS_TOGGLE","IS_BUTTON","isSmallerThanMediumViewport","component","includes","createElement","isOpen","isToggle","onToggle","select","_select$getCurrentPos","getCurrentPost","_links","isEditedPostBeingScheduled","isCurrentPostPending","isCurrentPostPublished","isCurrentPostScheduled","getEditedPostAttribute","getPostEdits","status","dispatch"],"sources":["@wordpress/edit-post/src/components/header/post-publish-button-or-toggle.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useViewportMatch, compose } from '@wordpress/compose';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { PostPublishButton, store as editorStore } from '@wordpress/editor';\n\nexport function PostPublishButtonOrToggle( {\n\tforceIsDirty,\n\thasPublishAction,\n\tisBeingScheduled,\n\tisPending,\n\tisPublished,\n\tisPublishSidebarEnabled,\n\tisPublishSidebarOpened,\n\tisScheduled,\n\ttogglePublishSidebar,\n\tsetEntitiesSavedStatesCallback,\n\tpostStatusHasChanged,\n\tpostStatus,\n} ) {\n\tconst IS_TOGGLE = 'toggle';\n\tconst IS_BUTTON = 'button';\n\tconst isSmallerThanMediumViewport = useViewportMatch( 'medium', '<' );\n\tlet component;\n\n\t/**\n\t * Conditions to show a BUTTON (publish directly) or a TOGGLE (open publish sidebar):\n\t *\n\t * 1) We want to show a BUTTON when the post status is at the _final stage_\n\t * for a particular role (see https://wordpress.org/documentation/article/post-status/):\n\t *\n\t * - is published\n\t * - post status has changed explicitely to something different than 'future' or 'publish'\n\t * - is scheduled to be published\n\t * - is pending and can't be published (but only for viewports >= medium).\n\t * \t Originally, we considered showing a button for pending posts that couldn't be published\n\t * \t (for example, for an author with the contributor role). Some languages can have\n\t * \t long translations for \"Submit for review\", so given the lack of UI real estate available\n\t * \t we decided to take into account the viewport in that case.\n\t * \t See: https://github.com/WordPress/gutenberg/issues/10475\n\t *\n\t * 2) Then, in small viewports, we'll show a TOGGLE.\n\t *\n\t * 3) Finally, we'll use the publish sidebar status to decide:\n\t *\n\t * - if it is enabled, we show a TOGGLE\n\t * - if it is disabled, we show a BUTTON\n\t */\n\tif (\n\t\tisPublished ||\n\t\t( postStatusHasChanged &&\n\t\t\t! [ 'future', 'publish' ].includes( postStatus ) ) ||\n\t\t( isScheduled && isBeingScheduled ) ||\n\t\t( isPending && ! hasPublishAction && ! isSmallerThanMediumViewport )\n\t) {\n\t\tcomponent = IS_BUTTON;\n\t} else if ( isSmallerThanMediumViewport || isPublishSidebarEnabled ) {\n\t\tcomponent = IS_TOGGLE;\n\t} else {\n\t\tcomponent = IS_BUTTON;\n\t}\n\n\treturn (\n\t\t<PostPublishButton\n\t\t\tforceIsDirty={ forceIsDirty }\n\t\t\tisOpen={ isPublishSidebarOpened }\n\t\t\tisToggle={ component === IS_TOGGLE }\n\t\t\tonToggle={ togglePublishSidebar }\n\t\t\tsetEntitiesSavedStatesCallback={ setEntitiesSavedStatesCallback }\n\t\t/>\n\t);\n}\n\nexport default compose(\n\twithSelect( ( select ) => ( {\n\t\thasPublishAction:\n\t\t\tselect( editorStore ).getCurrentPost()?._links?.[\n\t\t\t\t'wp:action-publish'\n\t\t\t] ?? false,\n\t\tisBeingScheduled: select( editorStore ).isEditedPostBeingScheduled(),\n\t\tisPending: select( editorStore ).isCurrentPostPending(),\n\t\tisPublished: select( editorStore ).isCurrentPostPublished(),\n\t\tisPublishSidebarEnabled:\n\t\t\tselect( editorStore ).isPublishSidebarEnabled(),\n\t\tisPublishSidebarOpened: select( editorStore ).isPublishSidebarOpened(),\n\t\tisScheduled: select( editorStore ).isCurrentPostScheduled(),\n\t\tpostStatus: select( editorStore ).getEditedPostAttribute( 'status' ),\n\t\tpostStatusHasChanged: select( editorStore ).getPostEdits()?.status,\n\t} ) ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { togglePublishSidebar } = dispatch( editorStore );\n\t\treturn {\n\t\t\ttogglePublishSidebar,\n\t\t};\n\t} )\n)( PostPublishButtonOrToggle );\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,gBAAgB,EAAEC,OAAO,QAAQ,oBAAoB;AAC9D,SAASC,YAAY,EAAEC,UAAU,QAAQ,iBAAiB;AAC1D,SAASC,iBAAiB,EAAEC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AAE3E,OAAO,SAASC,yBAAyBA,CAAE;EAC1CC,YAAY;EACZC,gBAAgB;EAChBC,gBAAgB;EAChBC,SAAS;EACTC,WAAW;EACXC,uBAAuB;EACvBC,sBAAsB;EACtBC,WAAW;EACXC,oBAAoB;EACpBC,8BAA8B;EAC9BC,oBAAoB;EACpBC;AACD,CAAC,EAAG;EACH,MAAMC,SAAS,G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DtB,WAAW,EAAEiB,MAAM,CAAEvB,WAAY,CAAC,CAAC6B,sBAAsB,CAAC,CAAC;IAC3DtB,uBAAuB,EACtBgB,MAAM,CAAEvB,WAAY,CAAC,CAACO,uBAAuB,CAAC,CAAC;IAChDC,sBAAsB,EAAEe,MAAM,CAAEvB,WAAY,CAAC,CAACQ,sBAAsB,CAAC,CAAC;IACtEC,WAAW,EAAEc,MAAM,CAAEvB,WAAY,CAAC,CAAC8B,sBAAsB,CAAC,CAAC;IAC3DjB,UAAU,EAAEU,MAAM,CAAEvB,WAAY,CAAC,CAAC+B,sBAAsB,CAAE,QAAS,CAAC;IACpEnB,oBAAoB,EAAEW,MAAM,CAAEvB,WAAY,CAAC,CAACgC,YAAY,CAAC,CAAC,EAAEC;EAC7D,CAAC;AAAA,CAAG,CAAC,EACLrC,YAAY,CAAIsC,QAAQ,IAAM;EAC7B,MAAM;IAAExB;EAAqB,CAAC,GAAGwB,QAAQ,CAAElC,WAAY,CAAC;EACxD,OAAO;IACNU;EACD,CAAC;AACF,CAAE,CACH,CAAC,CAAET,yBAA0B,CAAC","ignoreList":[]}
|
|
@@ -5,19 +5,27 @@ import { createElement } from "react";
|
|
|
5
5
|
import { useDispatch } from '@wordpress/data';
|
|
6
6
|
import { __ } from '@wordpress/i18n';
|
|
7
7
|
import { MenuItem } from '@wordpress/components';
|
|
8
|
-
import {
|
|
8
|
+
import { privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Internal dependencies
|
|
12
12
|
*/
|
|
13
|
-
import {
|
|
13
|
+
import { unlock } from '../../../lock-unlock';
|
|
14
|
+
const {
|
|
15
|
+
interfaceStore
|
|
16
|
+
} = unlock(editorPrivateApis);
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Internal dependencies
|
|
20
|
+
*/
|
|
21
|
+
|
|
14
22
|
export default function PreferencesMenuItem() {
|
|
15
23
|
const {
|
|
16
24
|
openModal
|
|
17
25
|
} = useDispatch(interfaceStore);
|
|
18
26
|
return createElement(MenuItem, {
|
|
19
27
|
onClick: () => {
|
|
20
|
-
openModal(
|
|
28
|
+
openModal('editor/preferences');
|
|
21
29
|
}
|
|
22
30
|
}, __('Preferences'));
|
|
23
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useDispatch","__","MenuItem","
|
|
1
|
+
{"version":3,"names":["useDispatch","__","MenuItem","privateApis","editorPrivateApis","unlock","interfaceStore","PreferencesMenuItem","openModal","createElement","onClick"],"sources":["@wordpress/edit-post/src/components/header/preferences-menu-item/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { MenuItem } from '@wordpress/components';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\n\nconst { interfaceStore } = unlock( editorPrivateApis );\n\n/**\n * Internal dependencies\n */\n\nexport default function PreferencesMenuItem() {\n\tconst { openModal } = useDispatch( interfaceStore );\n\treturn (\n\t\t<MenuItem\n\t\t\tonClick={ () => {\n\t\t\t\topenModal( 'editor/preferences' );\n\t\t\t} }\n\t\t>\n\t\t\t{ __( 'Preferences' ) }\n\t\t</MenuItem>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,QAAQ,QAAQ,uBAAuB;AAChD,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,SAASC,MAAM,QAAQ,sBAAsB;AAE7C,MAAM;EAAEC;AAAe,CAAC,GAAGD,MAAM,CAAED,iBAAkB,CAAC;;AAEtD;AACA;AACA;;AAEA,eAAe,SAASG,mBAAmBA,CAAA,EAAG;EAC7C,MAAM;IAAEC;EAAU,CAAC,GAAGR,WAAW,CAAEM,cAAe,CAAC;EACnD,OACCG,aAAA,CAACP,QAAQ;IACRQ,OAAO,EAAGA,CAAA,KAAM;MACfF,SAAS,CAAE,oBAAqB,CAAC;IAClC;EAAG,GAEDP,EAAE,CAAE,aAAc,CACX,CAAC;AAEb","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createSlotFill","MenuGroup","__","Fill","ToolsMoreMenuGroup","Slot","fillProps","createElement","fills","length","label"],"sources":["@wordpress/edit-post/src/components/header/tools-more-menu-group/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill, MenuGroup } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nconst { Fill: ToolsMoreMenuGroup, Slot } =\n\tcreateSlotFill( 'ToolsMoreMenuGroup' );\n\nToolsMoreMenuGroup.Slot = ( { fillProps } ) => (\n\t<Slot fillProps={ fillProps }>\n\t\t{ ( fills ) =>\n\t\t\tfills.length > 0 && (\n\t\t\t\t<MenuGroup label={ __( 'Tools' ) }>{ fills }</MenuGroup>\n\t\t\t)\n\t\t}\n\t</Slot>\n);\n\nexport default ToolsMoreMenuGroup;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,cAAc,EAAEC,SAAS,QAAQ,uBAAuB;AACjE,SAASC,EAAE,QAAQ,iBAAiB;AAEpC,MAAM;EAAEC,IAAI,EAAEC,kBAAkB;EAAEC;AAAK,CAAC,GACvCL,cAAc,CAAE,oBAAqB,CAAC;AAEvCI,kBAAkB,CAACC,IAAI,GAAG,CAAE;EAAEC;AAAU,CAAC,KACxCC,aAAA,CAACF,IAAI;EAACC,SAAS,EAAGA;AAAW,GACxBE,KAAK,IACRA,KAAK,CAACC,MAAM,GAAG,CAAC,IACfF,aAAA,CAACN,SAAS;EAACS,KAAK,EAAGR,EAAE,CAAE,OAAQ;AAAG,GAAGM,KAAkB,CAGpD,CACN;AAED,eAAeJ,kBAAkB"}
|
|
1
|
+
{"version":3,"names":["createSlotFill","MenuGroup","__","Fill","ToolsMoreMenuGroup","Slot","fillProps","createElement","fills","length","label"],"sources":["@wordpress/edit-post/src/components/header/tools-more-menu-group/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill, MenuGroup } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nconst { Fill: ToolsMoreMenuGroup, Slot } =\n\tcreateSlotFill( 'ToolsMoreMenuGroup' );\n\nToolsMoreMenuGroup.Slot = ( { fillProps } ) => (\n\t<Slot fillProps={ fillProps }>\n\t\t{ ( fills ) =>\n\t\t\tfills.length > 0 && (\n\t\t\t\t<MenuGroup label={ __( 'Tools' ) }>{ fills }</MenuGroup>\n\t\t\t)\n\t\t}\n\t</Slot>\n);\n\nexport default ToolsMoreMenuGroup;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,cAAc,EAAEC,SAAS,QAAQ,uBAAuB;AACjE,SAASC,EAAE,QAAQ,iBAAiB;AAEpC,MAAM;EAAEC,IAAI,EAAEC,kBAAkB;EAAEC;AAAK,CAAC,GACvCL,cAAc,CAAE,oBAAqB,CAAC;AAEvCI,kBAAkB,CAACC,IAAI,GAAG,CAAE;EAAEC;AAAU,CAAC,KACxCC,aAAA,CAACF,IAAI;EAACC,SAAS,EAAGA;AAAW,GACxBE,KAAK,IACRA,KAAK,CAACC,MAAM,GAAG,CAAC,IACfF,aAAA,CAACN,SAAS;EAACS,KAAK,EAAGR,EAAE,CAAE,OAAQ;AAAG,GAAGM,KAAkB,CAGpD,CACN;AAED,eAAeJ,kBAAkB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useDispatch","MenuGroup","__","_x","useViewportMatch","displayShortcut","PreferenceToggleMenuItem","store","preferencesStore","editorStore","WritingMenu","set","setPreference","toggleDistractionFree","turnOffDistractionFree","isLargeViewport","createElement","label","scope","name","onToggle","info","messageActivated","messageDeactivated","handleToggling","shortcut","primaryShift","secondary"],"sources":["@wordpress/edit-post/src/components/header/writing-menu/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { MenuGroup } from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport {\n\tPreferenceToggleMenuItem,\n\tstore as preferencesStore,\n} from '@wordpress/preferences';\nimport { store as editorStore } from '@wordpress/editor';\n\nfunction WritingMenu() {\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\tconst { toggleDistractionFree } = useDispatch( editorStore );\n\n\tconst turnOffDistractionFree = () => {\n\t\tsetPreference( 'core', 'distractionFree', false );\n\t};\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tif ( ! isLargeViewport ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<MenuGroup label={ _x( 'View', 'noun' ) }>\n\t\t\t<PreferenceToggleMenuItem\n\t\t\t\tscope=\"core\"\n\t\t\t\tname=\"fixedToolbar\"\n\t\t\t\tonToggle={ turnOffDistractionFree }\n\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\tinfo={ __(\n\t\t\t\t\t'Access all block and document tools in a single place'\n\t\t\t\t) }\n\t\t\t\tmessageActivated={ __( 'Top toolbar activated' ) }\n\t\t\t\tmessageDeactivated={ __( 'Top toolbar deactivated' ) }\n\t\t\t/>\n\t\t\t<PreferenceToggleMenuItem\n\t\t\t\tscope=\"core\"\n\t\t\t\tname=\"distractionFree\"\n\t\t\t\thandleToggling={ false }\n\t\t\t\tonToggle={ toggleDistractionFree }\n\t\t\t\tlabel={ __( 'Distraction free' ) }\n\t\t\t\tinfo={ __( 'Write with calmness' ) }\n\t\t\t\tmessageActivated={ __( 'Distraction free mode activated' ) }\n\t\t\t\tmessageDeactivated={ __( 'Distraction free mode deactivated' ) }\n\t\t\t\tshortcut={ displayShortcut.primaryShift( '\\\\' ) }\n\t\t\t/>\n\t\t\t<PreferenceToggleMenuItem\n\t\t\t\tscope=\"core\"\n\t\t\t\tname=\"focusMode\"\n\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\tinfo={ __( 'Focus on one block at a time' ) }\n\t\t\t\tmessageActivated={ __( 'Spotlight mode activated' ) }\n\t\t\t\tmessageDeactivated={ __( 'Spotlight mode deactivated' ) }\n\t\t\t/>\n\t\t\t<PreferenceToggleMenuItem\n\t\t\t\tscope=\"core/edit-post\"\n\t\t\t\tname=\"fullscreenMode\"\n\t\t\t\tlabel={ __( 'Fullscreen mode' ) }\n\t\t\t\tinfo={ __( 'Show and hide the admin user interface' ) }\n\t\t\t\tmessageActivated={ __( 'Fullscreen mode activated' ) }\n\t\t\t\tmessageDeactivated={ __( 'Fullscreen mode deactivated' ) }\n\t\t\t\tshortcut={ displayShortcut.secondary( 'f' ) }\n\t\t\t/>\n\t\t</MenuGroup>\n\t);\n}\n\nexport default WritingMenu;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,SAAS,QAAQ,uBAAuB;AACjD,SAASC,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SACCC,wBAAwB,EACxBC,KAAK,IAAIC,gBAAgB,QACnB,wBAAwB;AAC/B,SAASD,KAAK,IAAIE,WAAW,QAAQ,mBAAmB;AAExD,SAASC,WAAWA,CAAA,EAAG;EACtB,MAAM;IAAEC,GAAG,EAAEC;EAAc,CAAC,GAAGZ,WAAW,CAAEQ,gBAAiB,CAAC;EAC9D,MAAM;IAAEK;EAAsB,CAAC,GAAGb,WAAW,CAAES,WAAY,CAAC;EAE5D,MAAMK,sBAAsB,GAAGA,CAAA,KAAM;IACpCF,aAAa,CAAE,MAAM,EAAE,iBAAiB,EAAE,KAAM,CAAC;EAClD,CAAC;EAED,MAAMG,eAAe,GAAGX,gBAAgB,CAAE,QAAS,CAAC;EACpD,IAAK,CAA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EAAGf,EAAE,CAAE,iBAAkB,CAAG;IACjCmB,IAAI,EAAGnB,EAAE,CAAE,wCAAyC,CAAG;IACvDoB,gBAAgB,EAAGpB,EAAE,CAAE,2BAA4B,CAAG;IACtDqB,kBAAkB,EAAGrB,EAAE,CAAE,6BAA8B,CAAG;IAC1DuB,QAAQ,EAAGpB,eAAe,CAACsB,SAAS,CAAE,GAAI;EAAG,CAC7C,CACS,CAAC;AAEd;AAEA,eAAejB,WAAW"}
|
|
1
|
+
{"version":3,"names":["useDispatch","MenuGroup","__","_x","useViewportMatch","displayShortcut","PreferenceToggleMenuItem","store","preferencesStore","editorStore","WritingMenu","set","setPreference","toggleDistractionFree","turnOffDistractionFree","isLargeViewport","createElement","label","scope","name","onToggle","info","messageActivated","messageDeactivated","handleToggling","shortcut","primaryShift","secondary"],"sources":["@wordpress/edit-post/src/components/header/writing-menu/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { MenuGroup } from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport {\n\tPreferenceToggleMenuItem,\n\tstore as preferencesStore,\n} from '@wordpress/preferences';\nimport { store as editorStore } from '@wordpress/editor';\n\nfunction WritingMenu() {\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\tconst { toggleDistractionFree } = useDispatch( editorStore );\n\n\tconst turnOffDistractionFree = () => {\n\t\tsetPreference( 'core', 'distractionFree', false );\n\t};\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tif ( ! isLargeViewport ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<MenuGroup label={ _x( 'View', 'noun' ) }>\n\t\t\t<PreferenceToggleMenuItem\n\t\t\t\tscope=\"core\"\n\t\t\t\tname=\"fixedToolbar\"\n\t\t\t\tonToggle={ turnOffDistractionFree }\n\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\tinfo={ __(\n\t\t\t\t\t'Access all block and document tools in a single place'\n\t\t\t\t) }\n\t\t\t\tmessageActivated={ __( 'Top toolbar activated' ) }\n\t\t\t\tmessageDeactivated={ __( 'Top toolbar deactivated' ) }\n\t\t\t/>\n\t\t\t<PreferenceToggleMenuItem\n\t\t\t\tscope=\"core\"\n\t\t\t\tname=\"distractionFree\"\n\t\t\t\thandleToggling={ false }\n\t\t\t\tonToggle={ toggleDistractionFree }\n\t\t\t\tlabel={ __( 'Distraction free' ) }\n\t\t\t\tinfo={ __( 'Write with calmness' ) }\n\t\t\t\tmessageActivated={ __( 'Distraction free mode activated' ) }\n\t\t\t\tmessageDeactivated={ __( 'Distraction free mode deactivated' ) }\n\t\t\t\tshortcut={ displayShortcut.primaryShift( '\\\\' ) }\n\t\t\t/>\n\t\t\t<PreferenceToggleMenuItem\n\t\t\t\tscope=\"core\"\n\t\t\t\tname=\"focusMode\"\n\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\tinfo={ __( 'Focus on one block at a time' ) }\n\t\t\t\tmessageActivated={ __( 'Spotlight mode activated' ) }\n\t\t\t\tmessageDeactivated={ __( 'Spotlight mode deactivated' ) }\n\t\t\t/>\n\t\t\t<PreferenceToggleMenuItem\n\t\t\t\tscope=\"core/edit-post\"\n\t\t\t\tname=\"fullscreenMode\"\n\t\t\t\tlabel={ __( 'Fullscreen mode' ) }\n\t\t\t\tinfo={ __( 'Show and hide the admin user interface' ) }\n\t\t\t\tmessageActivated={ __( 'Fullscreen mode activated' ) }\n\t\t\t\tmessageDeactivated={ __( 'Fullscreen mode deactivated' ) }\n\t\t\t\tshortcut={ displayShortcut.secondary( 'f' ) }\n\t\t\t/>\n\t\t</MenuGroup>\n\t);\n}\n\nexport default WritingMenu;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,SAAS,QAAQ,uBAAuB;AACjD,SAASC,EAAE,EAAEC,EAAE,QAAQ,i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,EAAGpB,EAAE,CAAE,iCAAkC,CAAG;IAC5DqB,kBAAkB,EAAGrB,EAAE,CAAE,mCAAoC,CAAG;IAChEuB,QAAQ,EAAGpB,eAAe,CAACqB,YAAY,CAAE,IAAK;EAAG,CACjD,CAAC,EACFV,aAAA,CAACV,wBAAwB;IACxBY,KAAK,EAAC,MAAM;IACZC,IAAI,EAAC,WAAW;IAChBF,KAAK,EAAGf,EAAE,CAAE,gBAAiB,CAAG;IAChCmB,IAAI,EAAGnB,EAAE,CAAE,8BAA+B,CAAG;IAC7CoB,gBAAgB,EAAGpB,EAAE,CAAE,0BAA2B,CAAG;IACrDqB,kBAAkB,EAAGrB,EAAE,CAAE,4BAA6B;EAAG,CACzD,CAAC,EACFc,aAAA,CAACV,wBAAwB;IACxBY,KAAK,EAAC,gBAAgB;IACtBC,IAAI,EAAC,gBAAgB;IACrBF,KAAK,EAAGf,EAAE,CAAE,iBAAkB,CAAG;IACjCmB,IAAI,EAAGnB,EAAE,CAAE,wCAAyC,CAAG;IACvDoB,gBAAgB,EAAGpB,EAAE,CAAE,2BAA4B,CAAG;IACtDqB,kBAAkB,EAAGrB,EAAE,CAAE,6BAA8B,CAAG;IAC1DuB,QAAQ,EAAGpB,eAAe,CAACsB,SAAS,CAAE,GAAI;EAAG,CAC7C,CACS,CAAC;AAEd;AAEA,eAAejB,WAAW","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useSelect","useDispatch","__","_x","Modal","Button","__experimentalHStack","HStack","__experimentalVStack","VStack","ToggleControl","TextControl","useEffect","useState","store","editorStore","privateApis","blockEditorPrivateApis","unlock","ReusableBlocksRenameHint","InitPatternModal","editPost","isModalOpen","setIsModalOpen","syncType","setSyncType","undefined","title","setTitle","postType","isNewPost","select","getEditedPostAttribute","isCleanNewPost","createElement","Fragment","onRequestClose","overlayClassName","onSubmit","event","preventDefault","meta","wp_pattern_sync_status","spacing","label","value","onChange","placeholder","className","__nextHasNoMarginBottom","__next40pxDefaultSize","help","checked","justify","variant","type","disabled","__experimentalIsFocusable"],"sources":["@wordpress/edit-post/src/components/init-pattern-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tModal,\n\tButton,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tToggleControl,\n\tTextControl,\n} from '@wordpress/components';\nimport { useEffect, useState } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\n\nimport { unlock } from '../../lock-unlock';\n\nconst { ReusableBlocksRenameHint } = unlock( blockEditorPrivateApis );\n\nexport default function InitPatternModal() {\n\tconst { editPost } = useDispatch( editorStore );\n\tconst [ isModalOpen, setIsModalOpen ] = useState( false );\n\tconst [ syncType, setSyncType ] = useState( undefined );\n\tconst [ title, setTitle ] = useState( '' );\n\n\tconst { postType, isNewPost } = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute, isCleanNewPost } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\tpostType: getEditedPostAttribute( 'type' ),\n\t\t\tisNewPost: isCleanNewPost(),\n\t\t};\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tif ( isNewPost && postType === 'wp_block' ) {\n\t\t\tsetIsModalOpen( true );\n\t\t}\n\t\t// We only want the modal to open when the page is first loaded.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [] );\n\n\tif ( postType !== 'wp_block' || ! isNewPost ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ isModalOpen && (\n\t\t\t\t<Modal\n\t\t\t\t\ttitle={ __( 'Create pattern' ) }\n\t\t\t\t\tonRequestClose={ () => {\n\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t} }\n\t\t\t\t\toverlayClassName=\"reusable-blocks-menu-items__convert-modal\"\n\t\t\t\t>\n\t\t\t\t\t<form\n\t\t\t\t\t\tonSubmit={ ( event ) => {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t\t\teditPost( {\n\t\t\t\t\t\t\t\ttitle,\n\t\t\t\t\t\t\t\tmeta: {\n\t\t\t\t\t\t\t\t\twp_pattern_sync_status: syncType,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t<VStack spacing=\"5\">\n\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\t\t\t\tvalue={ title }\n\t\t\t\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\t\t\t\tplaceholder={ __( 'My pattern' ) }\n\t\t\t\t\t\t\t\tclassName=\"patterns-create-modal__name-input\"\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<ReusableBlocksRenameHint />\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t\t\t\t'Synced',\n\t\t\t\t\t\t\t\t\t'Option that makes an individual pattern synchronized'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Sync this pattern across multiple locations.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tchecked={ ! syncType }\n\t\t\t\t\t\t\t\tonChange={ () => {\n\t\t\t\t\t\t\t\t\tsetSyncType(\n\t\t\t\t\t\t\t\t\t\t! syncType ? 'unsynced' : undefined\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<HStack justify=\"right\">\n\t\t\t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C7CC,uBAAuB;IACvBC,qBAAqB;EAAA,CACrB,CAAC,EACFhB,aAAA,CAACf,wBAAwB,MAAE,CAAC,EAC5Be,aAAA,CAACxB,aAAa;IACbkC,KAAK,EAAGzC,EAAE,CACT,QAAQ,EACR,sDACD,CAAG;IACHgD,IAAI,EAAGjD,EAAE,CACR,8CACD,CAAG;IACHkD,OAAO,EAAG,CAAE5B,QAAU;IACtBsB,QAAQ,EAAGA,CAAA,KAAM;MAChBrB,WAAW,CACV,CAAED,QAAQ,GAAG,UAAU,GAAGE,SAC3B,CAAC;IACF;EAAG,CACH,CAAC,EACFQ,aAAA,CAAC3B,MAAM;IAAC8C,OAAO,EAAC;EAAO,GACtBnB,aAAA,CAAC7B,MAAM;IACNiD,OAAO,EAAC,SAAS;IACjBC,IAAI,EAAC,QAAQ;IACbC,QAAQ,EAAG,CAAE7B,KAAO;IACpB8B,yBAAyB;EAAA,GAEvBvD,EAAE,CAAE,QAAS,CACR,CACD,CACD,CACH,CACA,CAEP,CAAC;AAEL"}
|
|
1
|
+
{"version":3,"names":["useSelect","useDispatch","__","_x","Modal","Button","__experimentalHStack","HStack","__experimentalVStack","VStack","ToggleControl","TextControl","useEffect","useState","store","editorStore","privateApis","blockEditorPrivateApis","unlock","ReusableBlocksRenameHint","InitPatternModal","editPost","isModalOpen","setIsModalOpen","syncType","setSyncType","undefined","title","setTitle","postType","isNewPost","select","getEditedPostAttribute","isCleanNewPost","createElement","Fragment","onRequestClose","overlayClassName","onSubmit","event","preventDefault","meta","wp_pattern_sync_status","spacing","label","value","onChange","placeholder","className","__nextHasNoMarginBottom","__next40pxDefaultSize","help","checked","justify","variant","type","disabled","__experimentalIsFocusable"],"sources":["@wordpress/edit-post/src/components/init-pattern-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tModal,\n\tButton,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tToggleControl,\n\tTextControl,\n} from '@wordpress/components';\nimport { useEffect, useState } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\n\nimport { unlock } from '../../lock-unlock';\n\nconst { ReusableBlocksRenameHint } = unlock( blockEditorPrivateApis );\n\nexport default function InitPatternModal() {\n\tconst { editPost } = useDispatch( editorStore );\n\tconst [ isModalOpen, setIsModalOpen ] = useState( false );\n\tconst [ syncType, setSyncType ] = useState( undefined );\n\tconst [ title, setTitle ] = useState( '' );\n\n\tconst { postType, isNewPost } = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute, isCleanNewPost } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\tpostType: getEditedPostAttribute( 'type' ),\n\t\t\tisNewPost: isCleanNewPost(),\n\t\t};\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tif ( isNewPost && postType === 'wp_block' ) {\n\t\t\tsetIsModalOpen( true );\n\t\t}\n\t\t// We only want the modal to open when the page is first loaded.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [] );\n\n\tif ( postType !== 'wp_block' || ! isNewPost ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ isModalOpen && (\n\t\t\t\t<Modal\n\t\t\t\t\ttitle={ __( 'Create pattern' ) }\n\t\t\t\t\tonRequestClose={ () => {\n\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t} }\n\t\t\t\t\toverlayClassName=\"reusable-blocks-menu-items__convert-modal\"\n\t\t\t\t>\n\t\t\t\t\t<form\n\t\t\t\t\t\tonSubmit={ ( event ) => {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t\t\teditPost( {\n\t\t\t\t\t\t\t\ttitle,\n\t\t\t\t\t\t\t\tmeta: {\n\t\t\t\t\t\t\t\t\twp_pattern_sync_status: syncType,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t<VStack spacing=\"5\">\n\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\t\t\t\tvalue={ title }\n\t\t\t\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\t\t\t\tplaceholder={ __( 'My pattern' ) }\n\t\t\t\t\t\t\t\tclassName=\"patterns-create-modal__name-input\"\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<ReusableBlocksRenameHint />\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t\t\t\t'Synced',\n\t\t\t\t\t\t\t\t\t'Option that makes an individual pattern synchronized'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Sync this pattern across multiple locations.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tchecked={ ! syncType }\n\t\t\t\t\t\t\t\tonChange={ () => {\n\t\t\t\t\t\t\t\t\tsetSyncType(\n\t\t\t\t\t\t\t\t\t\t! syncType ? 'unsynced' : undefined\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\t\t\tdisabled={ ! title }\n\t\t\t\t\t\t\t\t\t__experimentalIsFocusable\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Create' ) }\n\t\t\t\t\t\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AAE5B,QAAU;IACtBsB,QAAQ,EAAGA,CAAA,KAAM;MAChBrB,WAAW,CACV,CAAED,QAAQ,GAAG,UAAU,GAAGE,SAC3B,CAAC;IACF;EAAG,CACH,CAAC,EACFQ,aAAA,CAAC3B,MAAM;IAAC8C,OAAO,EAAC;EAAO,GACtBnB,aAAA,CAAC7B,MAAM;IACNiD,OAAO,EAAC,SAAS;IACjBC,IAAI,EAAC,QAAQ;IACbC,QAAQ,EAAG,CAAE7B,KAAO;IACpB8B,yBAAyB;EAAA,GAEvBvD,EAAE,CAAE,QAAS,CACR,CACD,CACD,CACH,CACA,CAEP,CAAC;AAEL","ignoreList":[]}
|
|
@@ -14,11 +14,6 @@ import { createBlock } from '@wordpress/blocks';
|
|
|
14
14
|
import { store as editPostStore } from '../../store';
|
|
15
15
|
function KeyboardShortcuts() {
|
|
16
16
|
const {
|
|
17
|
-
isEditorSidebarOpened
|
|
18
|
-
} = useSelect(editPostStore);
|
|
19
|
-
const {
|
|
20
|
-
openGeneralSidebar,
|
|
21
|
-
closeGeneralSidebar,
|
|
22
17
|
toggleFeature
|
|
23
18
|
} = useDispatch(editPostStore);
|
|
24
19
|
const {
|
|
@@ -30,8 +25,7 @@ function KeyboardShortcuts() {
|
|
|
30
25
|
const {
|
|
31
26
|
getBlockName,
|
|
32
27
|
getSelectedBlockClientId,
|
|
33
|
-
getBlockAttributes
|
|
34
|
-
getBlockSelectionStart
|
|
28
|
+
getBlockAttributes
|
|
35
29
|
} = useSelect(blockEditorStore);
|
|
36
30
|
const handleTextLevelShortcut = (event, level) => {
|
|
37
31
|
event.preventDefault();
|
|
@@ -65,15 +59,6 @@ function KeyboardShortcuts() {
|
|
|
65
59
|
character: 'f'
|
|
66
60
|
}
|
|
67
61
|
});
|
|
68
|
-
registerShortcut({
|
|
69
|
-
name: 'core/edit-post/toggle-sidebar',
|
|
70
|
-
category: 'global',
|
|
71
|
-
description: __('Show or hide the Settings sidebar.'),
|
|
72
|
-
keyCombination: {
|
|
73
|
-
modifier: 'primaryShift',
|
|
74
|
-
character: ','
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
62
|
registerShortcut({
|
|
78
63
|
name: 'core/edit-post/next-region',
|
|
79
64
|
category: 'global',
|
|
@@ -103,15 +88,6 @@ function KeyboardShortcuts() {
|
|
|
103
88
|
character: '~'
|
|
104
89
|
}]
|
|
105
90
|
});
|
|
106
|
-
registerShortcut({
|
|
107
|
-
name: 'core/edit-post/keyboard-shortcuts',
|
|
108
|
-
category: 'main',
|
|
109
|
-
description: __('Display these keyboard shortcuts.'),
|
|
110
|
-
keyCombination: {
|
|
111
|
-
modifier: 'access',
|
|
112
|
-
character: 'h'
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
91
|
registerShortcut({
|
|
116
92
|
name: 'core/edit-post/transform-heading-to-paragraph',
|
|
117
93
|
category: 'block-library',
|
|
@@ -136,17 +112,6 @@ function KeyboardShortcuts() {
|
|
|
136
112
|
useShortcut('core/edit-post/toggle-fullscreen', () => {
|
|
137
113
|
toggleFeature('fullscreenMode');
|
|
138
114
|
});
|
|
139
|
-
useShortcut('core/edit-post/toggle-sidebar', event => {
|
|
140
|
-
// This shortcut has no known clashes, but use preventDefault to prevent any
|
|
141
|
-
// obscure shortcuts from triggering.
|
|
142
|
-
event.preventDefault();
|
|
143
|
-
if (isEditorSidebarOpened()) {
|
|
144
|
-
closeGeneralSidebar();
|
|
145
|
-
} else {
|
|
146
|
-
const sidebarToOpen = getBlockSelectionStart() ? 'edit-post/block' : 'edit-post/document';
|
|
147
|
-
openGeneralSidebar(sidebarToOpen);
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
115
|
useShortcut('core/edit-post/transform-heading-to-paragraph', event => handleTextLevelShortcut(event, 0));
|
|
151
116
|
[1, 2, 3, 4, 5, 6].forEach(level => {
|
|
152
117
|
//the loop is based off on a constant therefore
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useEffect","useSelect","useDispatch","useShortcut","store","keyboardShortcutsStore","__","blockEditorStore","createBlock","editPostStore","KeyboardShortcuts","
|
|
1
|
+
{"version":3,"names":["useEffect","useSelect","useDispatch","useShortcut","store","keyboardShortcutsStore","__","blockEditorStore","createBlock","editPostStore","KeyboardShortcuts","toggleFeature","registerShortcut","replaceBlocks","getBlockName","getSelectedBlockClientId","getBlockAttributes","handleTextLevelShortcut","event","level","preventDefault","destinationBlockName","currentClientId","blockName","attributes","textAlign","destinationTextAlign","content","name","category","description","keyCombination","modifier","character","aliases","forEach"],"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 blockEditorStore } from '@wordpress/block-editor';\nimport { createBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nfunction KeyboardShortcuts() {\n\tconst { toggleFeature } = useDispatch( editPostStore );\n\tconst { registerShortcut } = useDispatch( keyboardShortcutsStore );\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-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/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/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( 'core/edit-post/toggle-fullscreen', () => {\n\t\ttoggleFeature( 'fullscreenMode' );\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,gBAAgB,QAAQ,yBAAyB;AACnE,SAASC,WAAW,QAAQ,mBAAmB;;AAE/C;AACA;AACA;AACA,SAASJ,KAAK,IAAIK,aAAa,QAAQ,aAAa;AAEpD,SAASC,iBAAiBA,CAAA,EAAG;EAC5B,MA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AAC;QACpDyB,cAAc,EAAE;UACfC,QAAQ,EAAE,QAAQ;UAClBC,SAAS,EAAG,GAAGd,KAAO;QACvB;MACD,CAAE,CAAC;IACJ,CAAE,CAAC;EACJ,CAAC,EAAE,EAAG,CAAC;EAEPhB,WAAW,CAAE,kCAAkC,EAAE,MAAM;IACtDQ,aAAa,CAAE,gBAAiB,CAAC;EAClC,CAAE,CAAC;EAEHR,WAAW,CAAE,+CAA+C,EAAIe,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;IACAhB,WAAW,CACT,iDAAiDgB,KAAO,EAAC,EACxDD,KAAK,IAAMD,uBAAuB,CAAEC,KAAK,EAAEC,KAAM,CACpD,CAAC;EACF,CAAE,CAAC;EAEH,OAAO,IAAI;AACZ;AAEA,eAAeT,iBAAiB","ignoreList":[]}
|
|
@@ -2,16 +2,15 @@ import { createElement, Fragment } from "react";
|
|
|
2
2
|
/**
|
|
3
3
|
* WordPress dependencies
|
|
4
4
|
*/
|
|
5
|
-
import { EntitiesSavedStates, PostPublishPanel, store as editorStore } from '@wordpress/editor';
|
|
5
|
+
import { EntitiesSavedStates, PostPublishPanel, PluginPrePublishPanel, PluginPostPublishPanel, store as editorStore } from '@wordpress/editor';
|
|
6
6
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
7
7
|
import { Button, createSlotFill } from '@wordpress/components';
|
|
8
8
|
import { __ } from '@wordpress/i18n';
|
|
9
9
|
import { useCallback } from '@wordpress/element';
|
|
10
|
+
|
|
10
11
|
/**
|
|
11
12
|
* Internal dependencies
|
|
12
13
|
*/
|
|
13
|
-
import PluginPostPublishPanel from '../sidebar/plugin-post-publish-panel';
|
|
14
|
-
import PluginPrePublishPanel from '../sidebar/plugin-pre-publish-panel';
|
|
15
14
|
import { store as editPostStore } from '../../store';
|
|
16
15
|
const {
|
|
17
16
|
Fill,
|
|
@@ -26,13 +25,13 @@ export default function ActionsPanel({
|
|
|
26
25
|
const {
|
|
27
26
|
closePublishSidebar,
|
|
28
27
|
togglePublishSidebar
|
|
29
|
-
} = useDispatch(
|
|
28
|
+
} = useDispatch(editorStore);
|
|
30
29
|
const {
|
|
31
30
|
publishSidebarOpened,
|
|
32
31
|
hasActiveMetaboxes,
|
|
33
32
|
hasNonPostEntityChanges
|
|
34
33
|
} = useSelect(select => ({
|
|
35
|
-
publishSidebarOpened: select(
|
|
34
|
+
publishSidebarOpened: select(editorStore).isPublishSidebarOpened(),
|
|
36
35
|
hasActiveMetaboxes: select(editPostStore).hasMetaBoxes(),
|
|
37
36
|
hasNonPostEntityChanges: select(editorStore).hasNonPostEntityChanges()
|
|
38
37
|
}), []);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["EntitiesSavedStates","PostPublishPanel","store","editorStore","useSelect","useDispatch","Button","createSlotFill","__","useCallback","
|
|
1
|
+
{"version":3,"names":["EntitiesSavedStates","PostPublishPanel","PluginPrePublishPanel","PluginPostPublishPanel","store","editorStore","useSelect","useDispatch","Button","createSlotFill","__","useCallback","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\tPluginPrePublishPanel,\n\tPluginPostPublishPanel,\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/**\n * Internal dependencies\n */\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( editorStore );\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( editorStore ).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,qBAAqB,EACrBC,sBAAsB,EACtBC,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;;AAEhD;AACA;AACA;AACA,SAASP,KAAK,IAAIQ,aAAa,QAAQ,aAAa;AAEpD,MAAM;EAAEC,IAAI;EAAEC;AAAK,CAAC,GAAGL,cAAc,CAAE,cAAe,CAAC;AAEvD,OAAO,MAAMM,gBAAgB,GAAGF,IAAI;AAEpC,eAAe,SAASG,YAAY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OAAO,EAAC,WAAW;MACnBD,SAAS,EAAC,+CAA+C;MACzDE,OAAO,EAAGhB,oBAAsB;MAChC,iBAAgB;IAAO,GAErBX,EAAE,CAAE,oBAAqB,CACpB,CACJ,CACL;EACF;;EAEA;EACA;EACA,OACCoB,aAAA,CAAAQ,QAAA,QACGnB,yBAAyB,IAC1BW,aAAA,CAAC9B,mBAAmB;IAACuC,KAAK,EAAGrB;EAA0B,CAAE,CACzD,EACDY,aAAA,CAAChB,IAAI;IAAC0B,gBAAgB;EAAA,CAAE,CAAC,EACvB,CAAErB,yBAAyB,IAAIU,kBAChC,CAAC;AAEL","ignoreList":[]}
|
|
@@ -10,11 +10,10 @@ import classnames from 'classnames';
|
|
|
10
10
|
import { AutosaveMonitor, LocalAutosaveMonitor, UnsavedChangesWarning, EditorNotices, EditorKeyboardShortcutsRegister, EditorKeyboardShortcuts, EditorSnackbars, store as editorStore, privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
11
11
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
12
12
|
import { BlockBreadcrumb, BlockToolbar, privateApis as blockEditorPrivateApis, store as blockEditorStore } from '@wordpress/block-editor';
|
|
13
|
-
import {
|
|
13
|
+
import { ScrollLock } from '@wordpress/components';
|
|
14
14
|
import { useViewportMatch } from '@wordpress/compose';
|
|
15
15
|
import { PluginArea } from '@wordpress/plugins';
|
|
16
16
|
import { __, _x, sprintf } from '@wordpress/i18n';
|
|
17
|
-
import { ComplementaryArea, FullscreenMode, InterfaceSkeleton, store as interfaceStore } from '@wordpress/interface';
|
|
18
17
|
import { useState, useEffect, useCallback, useMemo } from '@wordpress/element';
|
|
19
18
|
import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';
|
|
20
19
|
import { store as noticesStore } from '@wordpress/notices';
|
|
@@ -28,7 +27,6 @@ import { privateApis as coreCommandsPrivateApis } from '@wordpress/core-commands
|
|
|
28
27
|
import TextEditor from '../text-editor';
|
|
29
28
|
import VisualEditor from '../visual-editor';
|
|
30
29
|
import EditPostKeyboardShortcuts from '../keyboard-shortcuts';
|
|
31
|
-
import KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';
|
|
32
30
|
import EditPostPreferencesModal from '../preferences-modal';
|
|
33
31
|
import InitPatternModal from '../init-pattern-modal';
|
|
34
32
|
import BrowserURL from '../browser-url';
|
|
@@ -37,7 +35,6 @@ import SettingsSidebar from '../sidebar/settings-sidebar';
|
|
|
37
35
|
import MetaBoxes from '../meta-boxes';
|
|
38
36
|
import WelcomeGuide from '../welcome-guide';
|
|
39
37
|
import ActionsPanel from './actions-panel';
|
|
40
|
-
import StartPageOptions from '../start-page-options';
|
|
41
38
|
import { store as editPostStore } from '../../store';
|
|
42
39
|
import { unlock } from '../../lock-unlock';
|
|
43
40
|
import useCommonCommands from '../../hooks/commands/use-common-commands';
|
|
@@ -52,7 +49,11 @@ const {
|
|
|
52
49
|
} = unlock(commandsPrivateApis);
|
|
53
50
|
const {
|
|
54
51
|
InserterSidebar,
|
|
55
|
-
ListViewSidebar
|
|
52
|
+
ListViewSidebar,
|
|
53
|
+
ComplementaryArea,
|
|
54
|
+
FullscreenMode,
|
|
55
|
+
InterfaceSkeleton,
|
|
56
|
+
interfaceStore
|
|
56
57
|
} = unlock(editorPrivateApis);
|
|
57
58
|
const interfaceLabels = {
|
|
58
59
|
/* translators: accessibility text for the editor top bar landmark region. */
|
|
@@ -110,7 +111,6 @@ function Layout({
|
|
|
110
111
|
const isWideViewport = useViewportMatch('large');
|
|
111
112
|
const isLargeViewport = useViewportMatch('medium');
|
|
112
113
|
const {
|
|
113
|
-
openGeneralSidebar,
|
|
114
114
|
closeGeneralSidebar
|
|
115
115
|
} = useDispatch(editPostStore);
|
|
116
116
|
const {
|
|
@@ -148,7 +148,7 @@ function Layout({
|
|
|
148
148
|
const postTypeLabel = getPostTypeLabel();
|
|
149
149
|
return {
|
|
150
150
|
showMetaBoxes: select(editorStore).getRenderingMode() === 'post-only',
|
|
151
|
-
sidebarIsOpened: !!(select(interfaceStore).getActiveComplementaryArea(
|
|
151
|
+
sidebarIsOpened: !!(select(interfaceStore).getActiveComplementaryArea('core') || select(editorStore).isPublishSidebarOpened()),
|
|
152
152
|
isFullscreenActive: select(editPostStore).isFeatureActive('fullscreenMode'),
|
|
153
153
|
isInserterOpened: select(editorStore).isInserterOpened(),
|
|
154
154
|
isListViewOpened: select(editorStore).isListViewOpened(),
|
|
@@ -171,7 +171,6 @@ function Layout({
|
|
|
171
171
|
const commandContext = hasBlockSelected ? 'block-selection-edit' : 'post-editor-edit';
|
|
172
172
|
useCommandContext(commandContext);
|
|
173
173
|
const styles = useEditorStyles();
|
|
174
|
-
const openSidebarPanel = () => openGeneralSidebar(hasBlockSelected ? 'edit-post/block' : 'edit-post/document');
|
|
175
174
|
|
|
176
175
|
// Inserter and Sidebars are mutually exclusive
|
|
177
176
|
useEffect(() => {
|
|
@@ -210,7 +209,10 @@ function Layout({
|
|
|
210
209
|
const secondarySidebarLabel = isListViewOpened ? __('Document Overview') : __('Block Library');
|
|
211
210
|
const secondarySidebar = () => {
|
|
212
211
|
if (mode === 'visual' && isInserterOpened) {
|
|
213
|
-
return createElement(InserterSidebar,
|
|
212
|
+
return createElement(InserterSidebar, {
|
|
213
|
+
closeGeneralSidebar: closeGeneralSidebar,
|
|
214
|
+
isRightSidebarOpen: sidebarIsOpened
|
|
215
|
+
});
|
|
214
216
|
}
|
|
215
217
|
if (mode === 'visual' && isListViewOpened) {
|
|
216
218
|
return createElement(ListViewSidebar, null);
|
|
@@ -238,16 +240,9 @@ function Layout({
|
|
|
238
240
|
}),
|
|
239
241
|
editorNotices: createElement(EditorNotices, null),
|
|
240
242
|
secondarySidebar: secondarySidebar(),
|
|
241
|
-
sidebar:
|
|
242
|
-
|
|
243
|
-
},
|
|
244
|
-
variant: "secondary",
|
|
245
|
-
className: "edit-post-layout__toggle-sidebar-panel-button",
|
|
246
|
-
onClick: openSidebarPanel,
|
|
247
|
-
"aria-expanded": false
|
|
248
|
-
}, hasBlockSelected ? __('Open block settings') : __('Open document settings'))), createElement(ComplementaryArea.Slot, {
|
|
249
|
-
scope: "core/edit-post"
|
|
250
|
-
})),
|
|
243
|
+
sidebar: !isDistractionFree && createElement(ComplementaryArea.Slot, {
|
|
244
|
+
scope: "core"
|
|
245
|
+
}),
|
|
251
246
|
notices: createElement(EditorSnackbars, null),
|
|
252
247
|
content: createElement(Fragment, null, !isDistractionFree && createElement(EditorNotices, null), (mode === 'text' || !isRichEditingEnabled) && createElement(TextEditor, null), !isLargeViewport && createElement(BlockToolbar, {
|
|
253
248
|
hideDragHandle: true
|
|
@@ -274,7 +269,7 @@ function Layout({
|
|
|
274
269
|
previous: previousShortcut,
|
|
275
270
|
next: nextShortcut
|
|
276
271
|
}
|
|
277
|
-
}), createElement(EditPostPreferencesModal, null), createElement(
|
|
272
|
+
}), createElement(EditPostPreferencesModal, null), createElement(WelcomeGuide, null), createElement(InitPatternModal, null), createElement(PluginArea, {
|
|
278
273
|
onError: onPluginAreaError
|
|
279
274
|
}), !isDistractionFree && createElement(SettingsSidebar, null));
|
|
280
275
|
}
|